From b5d297653819a3d79adb4ad55259733e986653d6 Mon Sep 17 00:00:00 2001 From: Russell McGuire Date: Thu, 25 Jun 2026 13:15:27 -0700 Subject: [PATCH 1/2] Update to Level Zero Spec v1.17.23 + New L0 Spec input from json + Updated to ChangeLog.md + Minor fixes to CONTRIBUTING.md Signed-off-by: Russell McGuire --- CHANGELOG.md | 4 + CMakeLists.txt | 2 +- CONTRIBUTING.md | 5 +- PRODUCT_GUID.txt | 4 +- include/layers/zel_tracing_register_cb.h | 1042 +- include/ze.py | 624 +- include/ze_api.h | 1788 ++- include/ze_ddi.h | 282 +- include/ze_ddi_common.h | 2 +- include/zer.py | 2 +- include/zer_api.h | 2 +- include/zer_ddi.h | 2 +- include/zes.py | 99 +- include/zes_api.h | 127 +- include/zes_ddi.h | 2 +- include/zet.py | 7 +- include/zet_api.h | 21 +- include/zet_ddi.h | 2 +- source/drivers/null/ze_nullddi.cpp | 1064 +- source/drivers/null/zet_nullddi.cpp | 8 +- source/layers/tracing/ze_tracing_cb_structs.h | 40 + .../layers/tracing/ze_tracing_register_cb.cpp | 416 + source/layers/tracing/ze_trcddi.cpp | 1220 +- .../generated/ze_certification.h | 156 + .../ze_parameter_validation.cpp | 450 +- .../ze_parameter_validation.h | 26 + .../zet_parameter_validation.cpp | 8 +- .../validation/common/ze_entry_points.h | 52 + .../ze_handle_lifetime.cpp | 384 +- .../ze_handle_lifetime.h | 26 + .../zet_handle_lifetime.cpp | 8 +- source/layers/validation/ze_valddi.cpp | 10740 +++++++++------- source/layers/validation/zet_valddi.cpp | 16 +- source/lib/ze_libapi.cpp | 8400 +++++++----- source/lib/ze_libddi.cpp | 80 + source/lib/ze_tracing_register_cb_libapi.cpp | 794 +- source/lib/zet_libapi.cpp | 14 +- source/loader/ze_ldrddi.cpp | 1512 ++- source/loader/ze_ldrddi.h | 185 +- source/loader/ze_ldrddi_driver_ddi.cpp | 930 +- source/loader/ze_loader_internal.h | 1 + source/loader/zet_ldrddi.cpp | 8 +- source/loader/zet_ldrddi.h | 8 +- source/loader/zet_ldrddi_driver_ddi.cpp | 8 +- source/utils/ze_to_string.h | 68 + source/utils/zes_to_string.h | 29 + 46 files changed, 22403 insertions(+), 8265 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e359313a..9489728b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Level zero loader changelog +## v1.32.0 + * Update to L0 Zero Spec v1.17.23: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-17-23 +* Fix: add .mako deduplication to prevent multiple to_string definitions +* Fix: CONTRIBUTING.md minor updates to versioning and command lines ## v1.31.0 * Fix: logger use-after-free in ZeLogger during teardown * Fix: .mako drift from actual headers diff --git a/CMakeLists.txt b/CMakeLists.txt index 0887fd09..084ad312 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.31.0) +project(level-zero VERSION 1.32.0) include(GNUInstallDirs) find_package(Git) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e126b9e..68c32235 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,13 +36,14 @@ To generate the code from the scripts, run the following commands: * Clone the specification repo: `git clone https://github.com/oneapi-src/level-zero-spec.git level-zero-spec` * Checkout the specification version in the specification repo, for example: * `cd level-zero-spec` - * `git checkout v1.12.15` + * `git checkout v1.17.23` * Generate the specification JSON file and Headers: * `cd level-zero-spec/scripts` * `python3 ./run.py --debug '--!html' '--!rst' '--!build' --ver 1.16` * Copy the Headers From Spec to Loader repo * `cp level-zero-spec/include/* level-zero/include/` * Execute the json2src script in the level-zero repo with the input.json in the specification repo with the corresponding spec version, for example (be sure you're inside the level-zero repository folder) + * `cd level-zero` * `./scripts/json2src.py --ver 1.16 --api-json ../level-zero-spec/scripts/input.json .` These scripts update the code with what would be generated in the next specification update. @@ -56,7 +57,7 @@ When releasing a new version of the Level Zero Loader, the following steps must The loader version is defined in the root [CMakeLists.txt](CMakeLists.txt) file using semantic versioning (https://semver.org/): ```cmake -project(level-zero VERSION 1.29.0) +project(level-zero VERSION 1.32.0) ``` Update the version number according to the type of changes: diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 80350fc4..1fa72bf5 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.31.0 -77da5b74-7f46-404c-af74-2663fbfc8bb1 \ No newline at end of file +1.32.0 +a4421a67-b1bb-4abe-8b70-9081ccb07991 \ 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 2b452e9e..b85f467f 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -58,6 +58,242 @@ typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeExecutableGraphGetSourceGraphExt +/// @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_executable_graph_get_source_graph_ext_params_t +{ + ze_executable_graph_handle_t* phGraph; + ze_graph_handle_t** pphSourceGraph; +} ze_executable_graph_get_source_graph_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeExecutableGraphGetSourceGraphExt +/// @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_pfnExecutableGraphGetSourceGraphExtCb_t)( + ze_executable_graph_get_source_graph_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeExecutableGraphDestroyExt +/// @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_executable_graph_destroy_ext_params_t +{ + ze_executable_graph_handle_t* phGraph; +} ze_executable_graph_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeExecutableGraphDestroyExt +/// @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_pfnExecutableGraphDestroyExtCb_t)( + ze_executable_graph_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphCreateExt +/// @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_create_ext_params_t +{ + ze_context_handle_t* phContext; + const void** ppNext; + ze_graph_handle_t** pphGraph; +} ze_graph_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphCreateExt +/// @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_pfnGraphCreateExtCb_t)( + ze_graph_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphGetPrimaryCommandListExt +/// @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_primary_command_list_ext_params_t +{ + ze_graph_handle_t* phGraph; + ze_command_list_handle_t** pphCommandList; +} ze_graph_get_primary_command_list_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphGetPrimaryCommandListExt +/// @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_pfnGraphGetPrimaryCommandListExtCb_t)( + ze_graph_get_primary_command_list_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphSetDestructionCallbackExt +/// @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_set_destruction_callback_ext_params_t +{ + ze_graph_handle_t* phGraph; + zex_mem_graph_free_callback_fn_t* ppfnCallback; + void** ppUserData; + const void** ppNext; +} ze_graph_set_destruction_callback_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphSetDestructionCallbackExt +/// @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_pfnGraphSetDestructionCallbackExtCb_t)( + ze_graph_set_destruction_callback_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphInstantiateExt +/// @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_instantiate_ext_params_t +{ + ze_graph_handle_t* phGraph; + const void** ppNext; + ze_executable_graph_handle_t** pphExecutableGraph; +} ze_graph_instantiate_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphInstantiateExt +/// @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_pfnGraphInstantiateExtCb_t)( + ze_graph_instantiate_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphIsEmptyExt +/// @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_is_empty_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_is_empty_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphIsEmptyExt +/// @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_pfnGraphIsEmptyExtCb_t)( + ze_graph_is_empty_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphDumpContentsExt +/// @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_dump_contents_ext_params_t +{ + ze_graph_handle_t* phGraph; + const char** pfilePath; + const void** ppNext; +} ze_graph_dump_contents_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphDumpContentsExt +/// @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_pfnGraphDumpContentsExtCb_t)( + ze_graph_dump_contents_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphDestroyExt +/// @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_destroy_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphDestroyExt +/// @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_pfnGraphDestroyExtCb_t)( + ze_graph_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -889,6 +1125,32 @@ typedef void (ZE_APICALL *ze_pfnDeviceValidateRuntimeRequirementsCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceGetCounterBasedEventMaxValue +/// @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_counter_based_event_max_value_params_t +{ + ze_device_handle_t* phDevice; + uint64_t** pmaxValue; +} ze_device_get_counter_based_event_max_value_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceGetCounterBasedEventMaxValue +/// @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_pfnDeviceGetCounterBasedEventMaxValueCb_t)( + ze_device_get_counter_based_event_max_value_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; @@ -1051,6 +1313,84 @@ typedef void (ZE_APICALL *ze_pfnContextCreateExCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandQueueGetFlags +/// @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_get_flags_params_t +{ + ze_command_queue_handle_t* phCmdQueue; + ze_command_queue_flags_t** ppFlags; +} ze_command_queue_get_flags_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandQueueGetFlags +/// @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_pfnCommandQueueGetFlagsCb_t)( + ze_command_queue_get_flags_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandQueueGetMode +/// @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_get_mode_params_t +{ + ze_command_queue_handle_t* phCmdQueue; + ze_command_queue_mode_t** ppMode; +} ze_command_queue_get_mode_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandQueueGetMode +/// @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_pfnCommandQueueGetModeCb_t)( + ze_command_queue_get_mode_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandQueueGetPriority +/// @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_get_priority_params_t +{ + ze_command_queue_handle_t* phCmdQueue; + ze_command_queue_priority_t** ppPriority; +} ze_command_queue_get_priority_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandQueueGetPriority +/// @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_pfnCommandQueueGetPriorityCb_t)( + ze_command_queue_get_priority_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; @@ -1178,205 +1518,527 @@ typedef struct _ze_command_list_append_signal_external_semaphore_ext_params_t /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendSignalExternalSemaphoreExt +/// @brief Callback function-pointer for zeCommandListAppendSignalExternalSemaphoreExt +/// @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_pfnCommandListAppendSignalExternalSemaphoreExtCb_t)( + ze_command_list_append_signal_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendWaitExternalSemaphoreExt +/// @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_external_semaphore_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + uint32_t* pnumSemaphores; + ze_external_semaphore_ext_handle_t** pphSemaphores; + ze_external_semaphore_wait_params_ext_t** pwaitParams; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_wait_external_semaphore_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendWaitExternalSemaphoreExt +/// @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_pfnCommandListAppendWaitExternalSemaphoreExtCb_t)( + ze_command_list_append_wait_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendLaunchKernelWithParameters +/// @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_launch_kernel_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_kernel_handle_t* phKernel; + const ze_group_count_t** ppGroupCounts; + const void ** ppNext; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_launch_kernel_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendLaunchKernelWithParameters +/// @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_pfnCommandListAppendLaunchKernelWithParametersCb_t)( + ze_command_list_append_launch_kernel_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendLaunchKernelWithArguments +/// @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_launch_kernel_with_arguments_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_kernel_handle_t* phKernel; + const ze_group_count_t* pgroupCounts; + const ze_group_size_t* pgroupSizes; + void *** ppArguments; + const void ** ppNext; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_launch_kernel_with_arguments_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendLaunchKernelWithArguments +/// @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_pfnCommandListAppendLaunchKernelWithArgumentsCb_t)( + ze_command_list_append_launch_kernel_with_arguments_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendMemoryCopyWithParameters +/// @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_memory_copy_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandList; + void** pdstptr; + const void** psrcptr; + size_t* psize; + const void** ppNext; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_memory_copy_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendMemoryCopyWithParameters +/// @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_pfnCommandListAppendMemoryCopyWithParametersCb_t)( + ze_command_list_append_memory_copy_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendMemoryFillWithParameters +/// @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_memory_fill_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandList; + void** pptr; + const void** ppattern; + size_t* ppattern_size; + size_t* psize; + const void** ppNext; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_memory_fill_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendMemoryFillWithParameters +/// @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_pfnCommandListAppendMemoryFillWithParametersCb_t)( + ze_command_list_append_memory_fill_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListImmediateAppendCommandListsWithParameters +/// @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_immediate_append_command_lists_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandListImmediate; + uint32_t* pnumCommandLists; + ze_command_list_handle_t** pphCommandLists; + const void** ppNext; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_immediate_append_command_lists_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListImmediateAppendCommandListsWithParameters +/// @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_pfnCommandListImmediateAppendCommandListsWithParametersCb_t)( + ze_command_list_immediate_append_command_lists_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListGetFlags +/// @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_get_flags_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_command_list_flags_t** ppFlags; +} ze_command_list_get_flags_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListGetFlags +/// @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_pfnCommandListGetFlagsCb_t)( + ze_command_list_get_flags_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListImmediateGetFlags +/// @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_immediate_get_flags_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_command_queue_flags_t** ppFlags; +} ze_command_list_immediate_get_flags_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListImmediateGetFlags +/// @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_pfnCommandListImmediateGetFlagsCb_t)( + ze_command_list_immediate_get_flags_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListImmediateGetMode +/// @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_immediate_get_mode_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_command_queue_mode_t** ppMode; +} ze_command_list_immediate_get_mode_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListImmediateGetMode +/// @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_pfnCommandListImmediateGetModeCb_t)( + ze_command_list_immediate_get_mode_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListImmediateGetPriority +/// @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_immediate_get_priority_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_command_queue_priority_t** ppPriority; +} ze_command_list_immediate_get_priority_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListImmediateGetPriority +/// @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_pfnCommandListImmediateGetPriorityCb_t)( + ze_command_list_immediate_get_priority_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListBeginGraphCaptureExt +/// @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_begin_graph_capture_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + const void** ppNext; +} ze_command_list_begin_graph_capture_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListBeginGraphCaptureExt +/// @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_pfnCommandListBeginGraphCaptureExtCb_t)( + ze_command_list_begin_graph_capture_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListBeginCaptureIntoGraphExt +/// @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_begin_capture_into_graph_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_graph_handle_t* phGraph; + const void** ppNext; +} ze_command_list_begin_capture_into_graph_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListBeginCaptureIntoGraphExt /// @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_pfnCommandListAppendSignalExternalSemaphoreExtCb_t)( - ze_command_list_append_signal_external_semaphore_ext_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListBeginCaptureIntoGraphExtCb_t)( + ze_command_list_begin_capture_into_graph_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListAppendWaitExternalSemaphoreExt +/// @brief Callback function parameters for zeCommandListIsGraphCaptureEnabledExt /// @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_external_semaphore_ext_params_t +typedef struct _ze_command_list_is_graph_capture_enabled_ext_params_t { ze_command_list_handle_t* phCommandList; - uint32_t* pnumSemaphores; - ze_external_semaphore_ext_handle_t** pphSemaphores; - ze_external_semaphore_wait_params_ext_t** pwaitParams; - ze_event_handle_t* phSignalEvent; - uint32_t* pnumWaitEvents; - ze_event_handle_t** pphWaitEvents; -} ze_command_list_append_wait_external_semaphore_ext_params_t; +} ze_command_list_is_graph_capture_enabled_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendWaitExternalSemaphoreExt +/// @brief Callback function-pointer for zeCommandListIsGraphCaptureEnabledExt /// @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_pfnCommandListAppendWaitExternalSemaphoreExtCb_t)( - ze_command_list_append_wait_external_semaphore_ext_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListIsGraphCaptureEnabledExtCb_t)( + ze_command_list_is_graph_capture_enabled_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListAppendLaunchKernelWithParameters +/// @brief Callback function parameters for zeCommandListEndGraphCaptureExt /// @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_launch_kernel_with_parameters_params_t +typedef struct _ze_command_list_end_graph_capture_ext_params_t { ze_command_list_handle_t* phCommandList; - ze_kernel_handle_t* phKernel; - const ze_group_count_t** ppGroupCounts; - const void ** ppNext; - ze_event_handle_t* phSignalEvent; - uint32_t* pnumWaitEvents; - ze_event_handle_t** pphWaitEvents; -} ze_command_list_append_launch_kernel_with_parameters_params_t; + const void** ppNext; + ze_graph_handle_t** pphGraph; +} ze_command_list_end_graph_capture_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendLaunchKernelWithParameters +/// @brief Callback function-pointer for zeCommandListEndGraphCaptureExt /// @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_pfnCommandListAppendLaunchKernelWithParametersCb_t)( - ze_command_list_append_launch_kernel_with_parameters_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListEndGraphCaptureExtCb_t)( + ze_command_list_end_graph_capture_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListAppendLaunchKernelWithArguments +/// @brief Callback function parameters for zeCommandListGetGraphExt /// @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_launch_kernel_with_arguments_params_t +typedef struct _ze_command_list_get_graph_ext_params_t { ze_command_list_handle_t* phCommandList; - ze_kernel_handle_t* phKernel; - const ze_group_count_t* pgroupCounts; - const ze_group_size_t* pgroupSizes; - void *** ppArguments; - const void ** ppNext; - ze_event_handle_t* phSignalEvent; - uint32_t* pnumWaitEvents; - ze_event_handle_t** pphWaitEvents; -} ze_command_list_append_launch_kernel_with_arguments_params_t; + ze_graph_handle_t** pphGraph; +} ze_command_list_get_graph_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendLaunchKernelWithArguments +/// @brief Callback function-pointer for zeCommandListGetGraphExt /// @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_pfnCommandListAppendLaunchKernelWithArgumentsCb_t)( - ze_command_list_append_launch_kernel_with_arguments_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListGetGraphExtCb_t)( + ze_command_list_get_graph_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListAppendMemoryCopyWithParameters +/// @brief Callback function parameters for zeCommandListAppendGraphExt /// @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_memory_copy_with_parameters_params_t +typedef struct _ze_command_list_append_graph_ext_params_t { ze_command_list_handle_t* phCommandList; - void** pdstptr; - const void** psrcptr; - size_t* psize; + ze_executable_graph_handle_t* phGraph; const void** ppNext; ze_event_handle_t* phSignalEvent; uint32_t* pnumWaitEvents; ze_event_handle_t** pphWaitEvents; -} ze_command_list_append_memory_copy_with_parameters_params_t; +} ze_command_list_append_graph_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendMemoryCopyWithParameters +/// @brief Callback function-pointer for zeCommandListAppendGraphExt /// @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_pfnCommandListAppendMemoryCopyWithParametersCb_t)( - ze_command_list_append_memory_copy_with_parameters_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListAppendGraphExtCb_t)( + ze_command_list_append_graph_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListAppendMemoryFillWithParameters +/// @brief Callback function parameters for zeCommandListAppendHostFunction /// @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_memory_fill_with_parameters_params_t +typedef struct _ze_command_list_append_host_function_params_t { ze_command_list_handle_t* phCommandList; - void** pptr; - const void** ppattern; - size_t* ppattern_size; - size_t* psize; + ze_host_function_callback_t* ppfnHostFunction; + void** ppUserData; const void** ppNext; ze_event_handle_t* phSignalEvent; uint32_t* pnumWaitEvents; ze_event_handle_t** pphWaitEvents; -} ze_command_list_append_memory_fill_with_parameters_params_t; +} ze_command_list_append_host_function_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListAppendMemoryFillWithParameters +/// @brief Callback function-pointer for zeCommandListAppendHostFunction /// @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_pfnCommandListAppendMemoryFillWithParametersCb_t)( - ze_command_list_append_memory_fill_with_parameters_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListAppendHostFunctionCb_t)( + ze_command_list_append_host_function_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListImmediateAppendCommandListsWithParameters +/// @brief Callback function parameters for zeCommandListIsMutableExp /// @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_immediate_append_command_lists_with_parameters_params_t +typedef struct _ze_command_list_is_mutable_exp_params_t { - ze_command_list_handle_t* phCommandListImmediate; - uint32_t* pnumCommandLists; - ze_command_list_handle_t** pphCommandLists; - const void** ppNext; - ze_event_handle_t* phSignalEvent; - uint32_t* pnumWaitEvents; - ze_event_handle_t** pphWaitEvents; -} ze_command_list_immediate_append_command_lists_with_parameters_params_t; + ze_command_list_handle_t* phCommandList; + ze_bool_t** ppIsMutable; +} ze_command_list_is_mutable_exp_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListImmediateAppendCommandListsWithParameters +/// @brief Callback function-pointer for zeCommandListIsMutableExp /// @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_pfnCommandListImmediateAppendCommandListsWithParametersCb_t)( - ze_command_list_immediate_append_command_lists_with_parameters_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListIsMutableExpCb_t)( + ze_command_list_is_mutable_exp_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData @@ -1901,6 +2563,32 @@ typedef void (ZE_APICALL *ze_pfnEventCounterBasedGetDeviceAddressCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeEventGetCounterBasedFlags +/// @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_event_get_counter_based_flags_params_t +{ + ze_event_handle_t* phEvent; + ze_event_counter_based_flags_t** ppFlags; +} ze_event_get_counter_based_flags_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeEventGetCounterBasedFlags +/// @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_pfnEventGetCounterBasedFlagsCb_t)( + ze_event_get_counter_based_flags_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeEventQueryTimestampsExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -3169,6 +3857,14 @@ zelTracerDeviceGetAggregatedCopyOffloadIncrementValueRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCounterBasedEventMaxValueRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceGetRuntimeRequirementsRegisterCallback( zel_tracer_handle_t hTracer, @@ -3273,6 +3969,30 @@ zelTracerCommandQueueGetIndexRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetModeCb_t pfnGetModeCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -3369,6 +4089,38 @@ zelTracerCommandListIsImmediateRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetFlagsCb_t pfnGetFlagsCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendBarrierRegisterCallback( zel_tracer_handle_t hTracer, @@ -3705,6 +4457,14 @@ zelTracerEventPoolGetFlagsRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerEventGetCounterBasedFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnEventGetCounterBasedFlagsCb_t pfnGetCounterBasedFlagsCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerFenceCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -4385,6 +5145,134 @@ zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListEndGraphCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphSetDestructionCallbackExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphInstantiateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphIsEmptyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphDumpContentsExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerExecutableGraphDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendHostFunctionRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, @@ -4697,6 +5585,14 @@ zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListIsMutableExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/include/ze.py b/include/ze.py index 1261b8dc..c35e5c57 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.16-r1.16.24 + @version v1.17-r1.17.23 """ import platform @@ -33,6 +33,10 @@ def ZE_MINOR_VERSION( _ver ): ## @brief Calling convention for all API functions # ZE_APICALL not required for python +############################################################################### +## @brief Callback function calling convention +# ZE_CALLBACK_CONV not required for python + ############################################################################### ## @brief Microsoft-specific dllexport storage-class attribute # ZE_APIEXPORT not required for python @@ -232,6 +236,18 @@ class ze_result_v(IntEnum): EXT_ERROR_OPERANDS_INCOMPATIBLE = 0x7800001f ## [Core, Extension] operands of comparison are not compatible ERROR_SURVIVABILITY_MODE_DETECTED = 0x78000020 ## [Sysman] device is in survivability mode, firmware update needed ERROR_ADDRESS_NOT_FOUND = 0x78000021 ## [Core] address not found within specified or current context + QUERY_TRUE = 0x78000022 ## [Core, Extension] query API returned true + QUERY_FALSE = 0x78000023 ## [Core, Extension] query API returned false + ERROR_INVALID_GRAPH = 0x78000024 ## [Core, Extension] graph object is invalid + ERROR_GRAPH_CAPTURE_UNSUPPORTED = 0x78000025 ## [Core, Extension] operation is not supported during graph capture + ERROR_GRAPH_CAPTURE_INVALIDATED = 0x78000026 ## [Core, Extension] operations failed and invalidated graph capture + ## session + ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT = 0x78000027 ## [Core, Extension] operation failed because it would merge two graph + ## capture sessions + ERROR_COMMAND_LIST_NOT_CAPTURING = 0x78000028 ## [Core, Extension] command list is not in graph capture mode + ERROR_GRAPH_UNJOINED_FORKS = 0x78000029 ## [Core, Extension] graph contains unjoined forks + ERROR_GRAPH_INTERNAL_EVENT = 0x7800002a ## [Core, Extension] operation failed because it uses a graph-internal + ## counter-based event outside of the graph ERROR_UNKNOWN = 0x7ffffffe ## [Core] unknown or internal error class ze_result_t(c_int): @@ -244,7 +260,8 @@ def __str__(self): class ze_structure_type_v(IntEnum): DRIVER_PROPERTIES = 0x1 ## ::ze_driver_properties_t DRIVER_IPC_PROPERTIES = 0x2 ## ::ze_driver_ipc_properties_t - DEVICE_PROPERTIES = 0x3 ## ::ze_device_properties_t + DEVICE_PROPERTIES = 0x3 ## ::ze_device_properties_t. @deprecated since 1.17: Use + ## ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 instead. DEVICE_COMPUTE_PROPERTIES = 0x4 ## ::ze_device_compute_properties_t DEVICE_MODULE_PROPERTIES = 0x5 ## ::ze_device_module_properties_t COMMAND_QUEUE_GROUP_PROPERTIES = 0x6 ## ::ze_command_queue_group_properties_t @@ -297,6 +314,8 @@ class ze_structure_type_v(IntEnum): EVENT_QUERY_KERNEL_TIMESTAMPS_RESULTS_EXT_PROPERTIES = 0x10012 ## ::ze_event_query_kernel_timestamps_results_ext_properties_t KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES = 0x10013 ## ::ze_kernel_max_group_size_ext_properties_t 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 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 @@ -361,6 +380,8 @@ class ze_structure_type_v(IntEnum): RUNTIME_REQUIREMENTS_MODULE_DESC = 0x00020044 ## ::ze_runtime_requirements_module_desc_t RUNTIME_REQUIREMENTS_GRAPH_DESC = 0x00020045 ## ::ze_runtime_requirements_graph_desc_t 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 class ze_structure_type_t(c_int): def __str__(self): @@ -545,7 +566,8 @@ class ze_api_version_v(IntEnum): _1_14 = ZE_MAKE_VERSION( 1, 14 ) ## version 1.14 _1_15 = ZE_MAKE_VERSION( 1, 15 ) ## version 1.15 _1_16 = ZE_MAKE_VERSION( 1, 16 ) ## version 1.16 - CURRENT = ZE_MAKE_VERSION( 1, 16 ) ## latest known version + _1_17 = ZE_MAKE_VERSION( 1, 17 ) ## version 1.17 + CURRENT = ZE_MAKE_VERSION( 1, 17 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -554,7 +576,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 16 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 17 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -684,13 +706,18 @@ class ze_device_properties_t(Structure): ("numEUsPerSubslice", c_ulong), ## [out] Maximum number of EUs per sub-slice. ("numSubslicesPerSlice", c_ulong), ## [out] Maximum number of sub-slices per slice. ("numSlices", c_ulong), ## [out] Maximum number of slices. - ("timerResolution", c_ulonglong), ## [out] Returns the resolution of device timer used for profiling, - ## timestamps, etc. When stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES the - ## units are in nanoseconds. When - ## stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 units are in - ## cycles/sec - ("timestampValidBits", c_ulong), ## [out] Returns the number of valid bits in the timestamp value. - ("kernelTimestampValidBits", c_ulong), ## [out] Returns the number of valid bits in the kernel timestamp values + ("timerResolution", c_ulonglong), ## [out] @deprecated when using ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES + ## since 1.17: Use ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 to obtain + ## timerResolution in cycles/sec for profiling and timestamps. + ("timestampValidBits", c_ulong), ## [out] Returns the number of valid bits in the timestamp value. (i.e + ## can be used to calculate the max value of the device timestamp in + ## hardware or get the mask of valid bits in the timestamp value). + ## timestampValidBits may or may not be same as the + ## kernelTimestampValidBits as they may be tracked using different + ## register sizes which are platform specific. + ("kernelTimestampValidBits", c_ulong), ## [out] Returns the number of valid bits in the kernel timestamp values. + ## (i.e can beused to calculate the max value of the kernel timestamp in + ## hardware or get the mask of valid bits in the kernel timestamp value). ("uuid", ze_device_uuid_t), ## [out] universal unique identifier. Note: Subdevices will have their ## own uuid. ("name", c_char * ZE_MAX_DEVICE_NAME) ## [out] Device name @@ -758,7 +785,7 @@ def __str__(self): ############################################################################### -## @brief Supported device dot product(dp) input data types flags +## @brief Supported device dot product(dp) input data types flags class ze_device_input_data_type_flags_v(IntEnum): DEVICE_INPUT_DATA_TYPE_NONE = ZE_BIT(0) ## No data types available for the supported dot product operation ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(1) ## Supports int8 data type with 4 packed data elements per SIMD lane. @@ -770,9 +797,14 @@ class ze_device_input_data_type_flags_v(IntEnum): DEVICE_INPUT_DATA_FP8_PACK4_PER_SIMD_LANE = ZE_BIT(7) ## Supports fp8 data type with 4 packed data elements per SIMD lane. DEVICE_INPUT_DATA_BF8_PACK4_PER_SIMD_LANE = ZE_BIT(8) ## Supports bf8 data type with 4 packed data elements per SIMD lane. DEVICE_INPUT_DATA_E2M1_PACK8_PER_SIMD_LANE = ZE_BIT(9) ## Supports e2m1 data type with 8 packed data elements per SIMD lane. - DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(10) ## Supports 8bit integer data type with 4 packed data elements per SIMD + DEVICE_INPUT_DATA_E3M0_PACK8_PER_SIMD_LANE = ZE_BIT(10) ## Supports e3m0 data type with 8 packed data elements per SIMD lane. + DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11) ## Supports 8bit integer data type with 4 packed data elements per SIMD ## lane.This is exclusively for DP4V dot product support - DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(11) ## Supports uint8 data type support for scaling, exclusive to BDPAS dot + DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12) ## Supports uint8 data type support for scaling, exclusive to BDPAS dot + ## product support. + DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13) ## Supports ue5m3 data type support for scaling, exclusive to BDPAS dot + ## product support. + DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14) ## Supports ue4m3 data type support for scaling, exclusive to BDPAS dot ## product support. class ze_device_input_data_type_flags_t(c_int): @@ -1413,6 +1445,9 @@ class ze_event_counter_based_flags_v(IntEnum): ## It is recommended to use this flag for most users that want to ## correlate timestamps from the host and device into a single timeline. ## For host timestamps see ::zeDeviceGetGlobalTimestamps. + 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). class ze_event_counter_based_flags_t(c_int): def __str__(self): @@ -1497,7 +1532,10 @@ class ze_event_counter_based_external_sync_allocation_desc_t(Structure): ## structure (i.e. contains stype and pNext). ("deviceAddress", POINTER(c_ulonglong)), ## [in] device address for external synchronization allocation ("hostAddress", POINTER(c_ulonglong)), ## [in] host address for external synchronization allocation - ("completionValue", c_ulonglong) ## [in] completion value for external synchronization allocation + ("completionValue", c_ulonglong) ## [in] completion value for external synchronization allocation. + ## Must not exceed the value returned by ::zeDeviceGetCounterBasedEventMaxValue. + ## User is also responsible for ensuring that any value written by the + ## application to `deviceAddress` or `hostAddress` does not exceed that maximum. ] ############################################################################### @@ -1512,7 +1550,11 @@ class ze_event_counter_based_external_aggregate_storage_desc_t(Structure): ## signaling of this event, must be device USM memory ("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 + ## or greater then this value then event is considered as completed. + ## Must not exceed the value returned by ::zeDeviceGetCounterBasedEventMaxValue. + ## User is responsible for ensuring that the value aggregated under + ## `deviceAddress` (initial value plus any number of `incrementValue` + ## additions) does not exceed that maximum at any point in time. ] ############################################################################### @@ -1521,21 +1563,22 @@ class ze_event_counter_based_external_aggregate_storage_desc_t(Structure): ## @details ## - The timestamp frequency can be queried from the `timerResolution` ## member of ::ze_device_properties_t. -## - The number of valid bits in the timestamp value can be queried from +## - The number of valid bits in the timestamp values can be inferred from ## the `kernelTimestampValidBits` member of ::ze_device_properties_t. class ze_kernel_timestamp_data_t(Structure): _fields_ = [ - ("kernelStart", c_ulonglong), ## [out] device clock at start of kernel execution - ("kernelEnd", c_ulonglong) ## [out] device clock at end of kernel execution + ("kernelStart", c_ulonglong), ## [out] time sample in tick counts at start of kernel execution + ("kernelEnd", c_ulonglong) ## [out] time sample in tick counts at end of kernel execution ] ############################################################################### ## @brief Kernel timestamp result class ze_kernel_timestamp_result_t(Structure): _fields_ = [ - ("global", ze_kernel_timestamp_data_t), ## [out] wall-clock data - ("context", ze_kernel_timestamp_data_t) ## [out] context-active data; only includes clocks while device context - ## was actively executing. + ("global", ze_kernel_timestamp_data_t), ## [out] wall-clock data; free running device clock indicating active + ## device state. + ("context", ze_kernel_timestamp_data_t) ## [out] context specific active data; only includes clocks while context + ## was actively executing on the device. ] ############################################################################### @@ -2454,26 +2497,26 @@ def __str__(self): ############################################################################### ## @brief Relaxed Allocation Limits Extension Name -ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME = "ZE_experimental_relaxed_allocation_limits" +ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME = "ZE_extension_relaxed_allocation_limits" ############################################################################### ## @brief Relaxed Allocation Limits Extension Version(s) -class ze_relaxed_allocation_limits_exp_version_v(IntEnum): +class ze_relaxed_allocation_limits_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_relaxed_allocation_limits_exp_version_t(c_int): +class ze_relaxed_allocation_limits_ext_version_t(c_int): def __str__(self): - return str(ze_relaxed_allocation_limits_exp_version_v(self.value)) + return str(ze_relaxed_allocation_limits_ext_version_v(self.value)) ############################################################################### ## @brief Supported relaxed memory allocation flags -class ze_relaxed_allocation_limits_exp_flags_v(IntEnum): +class ze_relaxed_allocation_limits_ext_flags_v(IntEnum): MAX_SIZE = ZE_BIT(0) ## Allocation size may exceed the `maxMemAllocSize` member of ## ::ze_device_properties_t. -class ze_relaxed_allocation_limits_exp_flags_t(c_int): +class ze_relaxed_allocation_limits_ext_flags_t(c_int): def __str__(self): return hex(self.value) @@ -2487,13 +2530,64 @@ def __str__(self): ## ::ze_device_mem_alloc_desc_t. ## - This structure may also be passed to ::zeMemAllocHost, via the `pNext` ## member of ::ze_host_mem_alloc_desc_t. +class ze_relaxed_allocation_limits_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). + ("flags", ze_relaxed_allocation_limits_ext_flags_t) ## [in] flags specifying allocation limits to relax. + ## must be 0 (default) or a valid combination of ::ze_relaxed_allocation_limits_ext_flag_t; + ] + +############################################################################### +## @brief [DEPRECATED] Relaxed Allocation Limits Extension Name. Use +## ::ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME instead. +ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME = "ZE_experimental_relaxed_allocation_limits" + +############################################################################### +## @brief [DEPRECATED] Relaxed Allocation Limits Extension Version(s). Use +## ::ze_relaxed_allocation_limits_ext_version_t instead. +class ze_relaxed_allocation_limits_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## [DEPRECATED] version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_relaxed_allocation_limits_exp_version_t(c_int): + def __str__(self): + return str(ze_relaxed_allocation_limits_exp_version_v(self.value)) + + +############################################################################### +## @brief [DEPRECATED] Supported relaxed memory allocation flags. Use +## ::ze_relaxed_allocation_limits_ext_flags_t instead. +class ze_relaxed_allocation_limits_exp_flags_v(IntEnum): + MAX_SIZE = ZE_BIT(0) ## [DEPRECATED] Allocation size may exceed the `maxMemAllocSize` member + ## of ::ze_device_properties_t. Use + ## ::ze_relaxed_allocation_limits_ext_flags_t MAX_SIZE instead. + +class ze_relaxed_allocation_limits_exp_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief [DEPRECATED] Relaxed limits memory allocation descriptor. Use +## ::ze_relaxed_allocation_limits_ext_desc_t instead. +## +## @details +## - [DEPRECATED] This structure may be passed to ::zeMemAllocShared or +## ::zeMemAllocDevice, via the `pNext` member of +## ::ze_device_mem_alloc_desc_t. Use +## ::ze_relaxed_allocation_limits_ext_desc_t instead. +## - [DEPRECATED] This structure may also be passed to ::zeMemAllocHost, +## via the `pNext` member of ::ze_host_mem_alloc_desc_t. Use +## ::ze_relaxed_allocation_limits_ext_desc_t instead. class ze_relaxed_allocation_limits_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). - ("flags", ze_relaxed_allocation_limits_exp_flags_t) ## [in] flags specifying allocation limits to relax. - ## must be 0 (default) or a valid combination of ::ze_relaxed_allocation_limits_exp_flag_t; + ("flags", ze_relaxed_allocation_limits_exp_flags_t) ## [in] [DEPRECATED] no longer supported, use + ## ::ze_relaxed_allocation_limits_ext_desc_t instead ] ############################################################################### @@ -2543,6 +2637,20 @@ def __str__(self): ## @details ## - This structure may be returned from ::zeDriverGetProperties, via the ## `pNext` member of ::ze_driver_properties_t. +## - Starting from spec version 1.17, support for this extension is assumed +## for any driver reporting API version 1.17 or later via +## ::zeDriverGetApiVersion; the loader does NOT need to query the +## extension property for such drivers. +## - For drivers reporting API version 1.16 or earlier, the loader must +## check for this extension before using DDI handles. +## - This guarantee enables Level Zero extensions introduced in spec v1.17 +## or later to embed handles directly inside Level Zero structures (e.g., +## via pNext chains) without requiring the loader to translate or unwrap +## handles. +## - Additionally, drivers may assume the loader will dispatch calls +## exclusively via the DDI tables embedded in their handles; the only +## exception is the global DDI table used during driver initialization +## and to read the reported API version. class ze_driver_ddi_handles_ext_properties_t(Structure): _fields_ = [ ("stype", ze_structure_type_t), ## [in] type of this structure @@ -3307,15 +3415,46 @@ def __str__(self): ## - This structure may be passed to ::zeMemAllocHost, via the `pNext` ## member of ::ze_host_mem_alloc_desc_t to map system memory for a host ## allocation. -## - The system memory pointer and size being mapped must be page aligned -## based on the supported page sizes on the device. +## - The `pSystemMemory` pointer and `size` being mapped must be aligned to +## the host page size. The host page size must be queried using +## operating-system-specific calls, as the mapped memory originates from +## the system allocator rather than from Level-Zero; there is no +## Level-Zero query for this value. +## - On success, the pointer returned from ::zeMemAllocHost is identical to +## `pSystemMemory`; the mapping preserves the virtual address, so the +## same address is valid on both the host and the device. +## - Memory from the application's heap, stack, or statically-allocated +## (global) storage is supported. Support for memory obtained by other +## means is platform- and driver-dependent and is not guaranteed. If +## `pSystemMemory` points to a memory type that cannot be mapped, +## ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +## - Host memory that is read-only can only be mapped successfully when the +## ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in +## ::ze_host_mem_alloc_desc_t; in that case device access to the mapped +## memory is read-only. +## - The system memory referenced by `pSystemMemory` must remain valid for +## the entire lifetime of the resulting allocation. Freeing or unmapping +## the underlying system memory before the allocation is released results +## in undefined behavior. +## - Mapped memory ranges must not overlap. Releasing a mapping with +## ::zeMemFree tears down the device page-table entries for its virtual +## address range. Because these page tables are shared across imports, +## releasing a mapping that overlaps another import also tears down the +## overlapping device page-table entries, leaving the other allocation +## invalid for device access. The host system memory itself is +## unaffected. +## - After mapping, ::zeMemGetAllocProperties reports the allocation type +## as ::ZE_MEMORY_TYPE_HOST_IMPORTED. +## - The mapping is released by passing the pointer to ::zeMemFree, like +## any other host allocation. class ze_external_memmap_sysmem_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). ("pSystemMemory", c_void_p), ## [in] system memory pointer to map; must be page-aligned. - ("size", c_ulonglong) ## [in] size of the system memory to map; must be page-aligned. + ("size", c_ulonglong) ## [in] size of the system memory to map; must be a multiple of the page + ## size. ] ############################################################################### @@ -3459,6 +3598,133 @@ class ze_ipc_mem_handle_type_ext_desc_t(Structure): ("typeFlags", ze_ipc_mem_handle_type_flags_t) ## [in] valid combination of ::ze_ipc_mem_handle_type_flag_t ] +############################################################################### +## @brief Record and Replay Graph Extension Name +ZE_RECORD_REPLAY_GRAPH_EXT_NAME = "ZE_extension_record_replay_graph" + +############################################################################### +## @brief Record and Replay Graph Extension Version(s) +class ze_record_replay_graph_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_record_replay_graph_ext_version_t(c_int): + def __str__(self): + return str(ze_record_replay_graph_ext_version_v(self.value)) + + +############################################################################### +## @brief Record and Replay Graph capability flags +class ze_record_replay_graph_ext_flags_v(IntEnum): + IMMUTABLE_GRAPH = ZE_BIT(0) ## Supports graphs that can't mutate + MUTABLE_GRAPH = ZE_BIT(1) ## Supports graphs that can mutate + SUBGRAPHS = ZE_BIT(2) ## Supports appending a subgraph into a graph + APPEND_COMMANDLIST = ZE_BIT(3) ## Supports appending a command list into a graph + CB_EXTERNAL_IPC = ZE_BIT(4) ## Supports waiting/signaling events that were created with both + ## ZEX_COUNTER_BASED_EVENT_FLAG_IPC and + ## ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL + +class ze_record_replay_graph_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Supported Record and Replay Graph properties. This structure is +## accepted as pNext to ::ze_device_properties_t +class ze_record_replay_graph_ext_properties_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). + ("graphFlags", ze_record_replay_graph_ext_flags_t) ## [out] record and replay flags + ] + +############################################################################### +## @brief Handle of an executable graph object +class ze_executable_graph_handle_t(c_void_p): + pass + +############################################################################### +## @brief Record and Replay Graph dump mode +class ze_record_replay_graph_ext_dump_mode_v(IntEnum): + DETAILED = 0x0 ## detailed mode (default) + SIMPLE = 0x1 ## simple mode + +class ze_record_replay_graph_ext_dump_mode_t(c_int): + def __str__(self): + return str(ze_record_replay_graph_ext_dump_mode_v(self.value)) + + +############################################################################### +## @brief Record and Replay Graph dump descriptor +## +## @details +## - Accepted as pNext in ::zeGraphDumpContentsExt. +class ze_record_replay_graph_ext_dump_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). + ("mode", ze_record_replay_graph_ext_dump_mode_t) ## [in] graph dump mode + ] + +############################################################################### +## @brief Callback function pointer type invoked when a graph is destroyed + +############################################################################### +## @brief Host Function callback type + +############################################################################### +## @brief Virtual Memory Read-Only Properties Extension Name +ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME = "ZE_extension_virtual_mem_readonly_properties" + +############################################################################### +## @brief Virtual Memory Read-Only Properties Extension Version(s) +class ze_virtual_mem_readonly_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_virtual_mem_readonly_properties_ext_version_t(c_int): + def __str__(self): + return str(ze_virtual_mem_readonly_properties_ext_version_v(self.value)) + + +############################################################################### +## @brief Read-only memory page capability values +class ze_device_readonly_memory_capability_v(IntEnum): + NONE = 0 ## Read-only attribute has no effect; the driver does not act on it. + HINT = 1 ## Read-only attribute is a performance hint to the OS; writes may still + ## succeed without fault. + ENFORCED = 2 ## Read-only attribute is hardware-enforced; writes to read-only pages + ## will cause a device fault. + +class ze_device_readonly_memory_capability_t(c_int): + def __str__(self): + return str(ze_device_readonly_memory_capability_v(self.value)) + + +############################################################################### +## @brief Device read-only memory capability properties +## +## @details +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t +class ze_device_readonly_memory_ext_properties_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). + ("readonlyCapability", ze_device_readonly_memory_capability_t) ## [out] Indicates device behavior when + ## ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no + ## effect; writes succeed normally. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a + ## performance hint; writes may still succeed. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is + ## hardware-enforced; writes cause a device fault. + ] + ############################################################################### ## @brief Cache_Reservation Extension Name ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" @@ -4308,6 +4574,8 @@ class ze_device_memory_ext_type_v(IntEnum): HBM3 = 23 ## HBM3 memory HBM3E = 24 ## HBM3E memory HBM4 = 25 ## HBM4 memory + LPDDR5X = 26 ## LPDDR5X memory + LPDDR6 = 27 ## LPDDR6 memory class ze_device_memory_ext_type_t(c_int): def __str__(self): @@ -4506,17 +4774,19 @@ class ze_event_query_kernel_timestamps_ext_properties_t(Structure): ## @brief Kernel timestamp clock data synchronized to the host time domain class ze_synchronized_timestamp_data_ext_t(Structure): _fields_ = [ - ("kernelStart", c_ulonglong), ## [out] synchronized clock at start of kernel execution - ("kernelEnd", c_ulonglong) ## [out] synchronized clock at end of kernel execution + ("kernelStart", c_ulonglong), ## [out] start of kernel execution in nanoseconds, on the host time + ## domain. + ("kernelEnd", c_ulonglong) ## [out] end of kernel execution in nanoseconds, on the host time domain. ] ############################################################################### ## @brief Synchronized kernel timestamp result class ze_synchronized_timestamp_result_ext_t(Structure): _fields_ = [ - ("global", ze_synchronized_timestamp_data_ext_t), ## [out] wall-clock data - ("context", ze_synchronized_timestamp_data_ext_t) ## [out] context-active data; only includes clocks while device context - ## was actively executing. + ("global", ze_synchronized_timestamp_data_ext_t), ## [out] wall-clock data; free running device clock when device was + ## active,on the host time domain + ("context", ze_synchronized_timestamp_data_ext_t) ## [out] context specific active data; only includes clocks while context + ## was actively executing on the device, on the host time domain ] ############################################################################### @@ -5594,6 +5864,69 @@ class _ze_rtas_parallel_operation_exp_dditable_t(Structure): ("pfnDestroyExp", c_void_p) ## _zeRTASParallelOperationDestroyExp_t ] +############################################################################### +## @brief Function-pointer for zeGraphCreateExt +if __use_win_types: + _zeGraphCreateExt_t = WINFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) +else: + _zeGraphCreateExt_t = CFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphGetPrimaryCommandListExt +if __use_win_types: + _zeGraphGetPrimaryCommandListExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) +else: + _zeGraphGetPrimaryCommandListExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphSetDestructionCallbackExt +if __use_win_types: + _zeGraphSetDestructionCallbackExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) +else: + _zeGraphSetDestructionCallbackExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeGraphInstantiateExt +if __use_win_types: + _zeGraphInstantiateExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) +else: + _zeGraphInstantiateExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphIsEmptyExt +if __use_win_types: + _zeGraphIsEmptyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphIsEmptyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + +############################################################################### +## @brief Function-pointer for zeGraphDumpContentsExt +if __use_win_types: + _zeGraphDumpContentsExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) +else: + _zeGraphDumpContentsExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeGraphDestroyExt +if __use_win_types: + _zeGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + + +############################################################################### +## @brief Table of Graph functions pointers +class _ze_graph_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeGraphCreateExt_t + ("pfnGetPrimaryCommandListExt", c_void_p), ## _zeGraphGetPrimaryCommandListExt_t + ("pfnSetDestructionCallbackExt", c_void_p), ## _zeGraphSetDestructionCallbackExt_t + ("pfnInstantiateExt", c_void_p), ## _zeGraphInstantiateExt_t + ("pfnIsEmptyExt", c_void_p), ## _zeGraphIsEmptyExt_t + ("pfnDumpContentsExt", c_void_p), ## _zeGraphDumpContentsExt_t + ("pfnDestroyExt", c_void_p) ## _zeGraphDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeInit if __use_win_types: @@ -5617,6 +5950,29 @@ class _ze_global_dditable_t(Structure): ("pfnInitDrivers", c_void_p) ## _zeInitDrivers_t ] +############################################################################### +## @brief Function-pointer for zeExecutableGraphGetSourceGraphExt +if __use_win_types: + _zeExecutableGraphGetSourceGraphExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) +else: + _zeExecutableGraphGetSourceGraphExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeExecutableGraphDestroyExt +if __use_win_types: + _zeExecutableGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) +else: + _zeExecutableGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) + + +############################################################################### +## @brief Table of ExecutableGraph functions pointers +class _ze_executable_graph_dditable_t(Structure): + _fields_ = [ + ("pfnGetSourceGraphExt", c_void_p), ## _zeExecutableGraphGetSourceGraphExt_t + ("pfnDestroyExt", c_void_p) ## _zeExecutableGraphDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeDriverGet if __use_win_types: @@ -5900,6 +6256,13 @@ class _ze_driver_exp_dditable_t(Structure): else: _zeDeviceValidateRuntimeRequirements_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, c_char_p, POINTER(ze_validate_runtime_requirements_output_t) ) +############################################################################### +## @brief Function-pointer for zeDeviceGetCounterBasedEventMaxValue +if __use_win_types: + _zeDeviceGetCounterBasedEventMaxValue_t = WINFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulonglong) ) +else: + _zeDeviceGetCounterBasedEventMaxValue_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulonglong) ) + ############################################################################### ## @brief Table of Device functions pointers @@ -5931,7 +6294,8 @@ class _ze_device_dditable_t(Structure): ("pfnGetAggregatedCopyOffloadIncrementValue", c_void_p), ## _zeDeviceGetAggregatedCopyOffloadIncrementValue_t ("pfnGetRuntimeRequirements", c_void_p), ## _zeDeviceGetRuntimeRequirements_t ("pfnGetRuntimeRequirementsKey", c_void_p), ## _zeDeviceGetRuntimeRequirementsKey_t - ("pfnValidateRuntimeRequirements", c_void_p) ## _zeDeviceValidateRuntimeRequirements_t + ("pfnValidateRuntimeRequirements", c_void_p), ## _zeDeviceValidateRuntimeRequirements_t + ("pfnGetCounterBasedEventMaxValue", c_void_p) ## _zeDeviceGetCounterBasedEventMaxValue_t ] ############################################################################### @@ -6070,6 +6434,27 @@ class _ze_context_dditable_t(Structure): else: _zeCommandQueueGetIndex_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(c_ulong) ) +############################################################################### +## @brief Function-pointer for zeCommandQueueGetFlags +if __use_win_types: + _zeCommandQueueGetFlags_t = WINFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_flags_t) ) +else: + _zeCommandQueueGetFlags_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_flags_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandQueueGetMode +if __use_win_types: + _zeCommandQueueGetMode_t = WINFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_mode_t) ) +else: + _zeCommandQueueGetMode_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_mode_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandQueueGetPriority +if __use_win_types: + _zeCommandQueueGetPriority_t = WINFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_priority_t) ) +else: + _zeCommandQueueGetPriority_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_priority_t) ) + ############################################################################### ## @brief Table of CommandQueue functions pointers @@ -6080,7 +6465,10 @@ class _ze_command_queue_dditable_t(Structure): ("pfnExecuteCommandLists", c_void_p), ## _zeCommandQueueExecuteCommandLists_t ("pfnSynchronize", c_void_p), ## _zeCommandQueueSynchronize_t ("pfnGetOrdinal", c_void_p), ## _zeCommandQueueGetOrdinal_t - ("pfnGetIndex", c_void_p) ## _zeCommandQueueGetIndex_t + ("pfnGetIndex", c_void_p), ## _zeCommandQueueGetIndex_t + ("pfnGetFlags", c_void_p), ## _zeCommandQueueGetFlags_t + ("pfnGetMode", c_void_p), ## _zeCommandQueueGetMode_t + ("pfnGetPriority", c_void_p) ## _zeCommandQueueGetPriority_t ] ############################################################################### @@ -6370,6 +6758,83 @@ class _ze_command_queue_dditable_t(Structure): else: _zeCommandListImmediateAppendCommandListsWithParameters_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_ulong, POINTER(ze_command_list_handle_t), c_void_p, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) +############################################################################### +## @brief Function-pointer for zeCommandListGetFlags +if __use_win_types: + _zeCommandListGetFlags_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_list_flags_t) ) +else: + _zeCommandListGetFlags_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_list_flags_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListImmediateGetFlags +if __use_win_types: + _zeCommandListImmediateGetFlags_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_flags_t) ) +else: + _zeCommandListImmediateGetFlags_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_flags_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListImmediateGetMode +if __use_win_types: + _zeCommandListImmediateGetMode_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_mode_t) ) +else: + _zeCommandListImmediateGetMode_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_mode_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListImmediateGetPriority +if __use_win_types: + _zeCommandListImmediateGetPriority_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_priority_t) ) +else: + _zeCommandListImmediateGetPriority_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_command_queue_priority_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListBeginGraphCaptureExt +if __use_win_types: + _zeCommandListBeginGraphCaptureExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p ) +else: + _zeCommandListBeginGraphCaptureExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeCommandListBeginCaptureIntoGraphExt +if __use_win_types: + _zeCommandListBeginCaptureIntoGraphExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, ze_graph_handle_t, c_void_p ) +else: + _zeCommandListBeginCaptureIntoGraphExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, ze_graph_handle_t, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeCommandListIsGraphCaptureEnabledExt +if __use_win_types: + _zeCommandListIsGraphCaptureEnabledExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t ) +else: + _zeCommandListIsGraphCaptureEnabledExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t ) + +############################################################################### +## @brief Function-pointer for zeCommandListEndGraphCaptureExt +if __use_win_types: + _zeCommandListEndGraphCaptureExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) +else: + _zeCommandListEndGraphCaptureExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListGetGraphExt +if __use_win_types: + _zeCommandListGetGraphExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_graph_handle_t) ) +else: + _zeCommandListGetGraphExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListAppendGraphExt +if __use_win_types: + _zeCommandListAppendGraphExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, ze_executable_graph_handle_t, c_void_p, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) +else: + _zeCommandListAppendGraphExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, ze_executable_graph_handle_t, c_void_p, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeCommandListAppendHostFunction +if __use_win_types: + _zeCommandListAppendHostFunction_t = WINFUNCTYPE( 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) ) +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 Table of CommandList functions pointers @@ -6415,7 +6880,18 @@ class _ze_command_list_dditable_t(Structure): ("pfnAppendLaunchKernelWithArguments", c_void_p), ## _zeCommandListAppendLaunchKernelWithArguments_t ("pfnAppendMemoryCopyWithParameters", c_void_p), ## _zeCommandListAppendMemoryCopyWithParameters_t ("pfnAppendMemoryFillWithParameters", c_void_p), ## _zeCommandListAppendMemoryFillWithParameters_t - ("pfnImmediateAppendCommandListsWithParameters", c_void_p) ## _zeCommandListImmediateAppendCommandListsWithParameters_t + ("pfnImmediateAppendCommandListsWithParameters", c_void_p), ## _zeCommandListImmediateAppendCommandListsWithParameters_t + ("pfnGetFlags", c_void_p), ## _zeCommandListGetFlags_t + ("pfnImmediateGetFlags", c_void_p), ## _zeCommandListImmediateGetFlags_t + ("pfnImmediateGetMode", c_void_p), ## _zeCommandListImmediateGetMode_t + ("pfnImmediateGetPriority", c_void_p), ## _zeCommandListImmediateGetPriority_t + ("pfnBeginGraphCaptureExt", c_void_p), ## _zeCommandListBeginGraphCaptureExt_t + ("pfnBeginCaptureIntoGraphExt", c_void_p), ## _zeCommandListBeginCaptureIntoGraphExt_t + ("pfnIsGraphCaptureEnabledExt", c_void_p), ## _zeCommandListIsGraphCaptureEnabledExt_t + ("pfnEndGraphCaptureExt", c_void_p), ## _zeCommandListEndGraphCaptureExt_t + ("pfnGetGraphExt", c_void_p), ## _zeCommandListGetGraphExt_t + ("pfnAppendGraphExt", c_void_p), ## _zeCommandListAppendGraphExt_t + ("pfnAppendHostFunction", c_void_p) ## _zeCommandListAppendHostFunction_t ] ############################################################################### @@ -6474,6 +6950,13 @@ class _ze_command_list_dditable_t(Structure): else: _zeCommandListUpdateMutableCommandKernelsExp_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_ulong, POINTER(c_ulonglong), POINTER(ze_kernel_handle_t) ) +############################################################################### +## @brief Function-pointer for zeCommandListIsMutableExp +if __use_win_types: + _zeCommandListIsMutableExp_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_bool_t) ) +else: + _zeCommandListIsMutableExp_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, POINTER(ze_bool_t) ) + ############################################################################### ## @brief Table of CommandListExp functions pointers @@ -6486,7 +6969,8 @@ class _ze_command_list_exp_dditable_t(Structure): ("pfnUpdateMutableCommandSignalEventExp", c_void_p), ## _zeCommandListUpdateMutableCommandSignalEventExp_t ("pfnUpdateMutableCommandWaitEventsExp", c_void_p), ## _zeCommandListUpdateMutableCommandWaitEventsExp_t ("pfnGetNextCommandIdWithKernelsExp", c_void_p), ## _zeCommandListGetNextCommandIdWithKernelsExp_t - ("pfnUpdateMutableCommandKernelsExp", c_void_p) ## _zeCommandListUpdateMutableCommandKernelsExp_t + ("pfnUpdateMutableCommandKernelsExp", c_void_p), ## _zeCommandListUpdateMutableCommandKernelsExp_t + ("pfnIsMutableExp", c_void_p) ## _zeCommandListIsMutableExp_t ] ############################################################################### @@ -6947,6 +7431,13 @@ class _ze_event_pool_dditable_t(Structure): else: _zeEventCounterBasedGetDeviceAddress_t = CFUNCTYPE( ze_result_t, ze_event_handle_t, POINTER(c_ulonglong), POINTER(c_ulonglong) ) +############################################################################### +## @brief Function-pointer for zeEventGetCounterBasedFlags +if __use_win_types: + _zeEventGetCounterBasedFlags_t = WINFUNCTYPE( ze_result_t, ze_event_handle_t, POINTER(ze_event_counter_based_flags_t) ) +else: + _zeEventGetCounterBasedFlags_t = CFUNCTYPE( ze_result_t, ze_event_handle_t, POINTER(ze_event_counter_based_flags_t) ) + ############################################################################### ## @brief Table of Event functions pointers @@ -6967,7 +7458,8 @@ class _ze_event_dditable_t(Structure): ("pfnCounterBasedGetIpcHandle", c_void_p), ## _zeEventCounterBasedGetIpcHandle_t ("pfnCounterBasedOpenIpcHandle", c_void_p), ## _zeEventCounterBasedOpenIpcHandle_t ("pfnCounterBasedCloseIpcHandle", c_void_p), ## _zeEventCounterBasedCloseIpcHandle_t - ("pfnCounterBasedGetDeviceAddress", c_void_p) ## _zeEventCounterBasedGetDeviceAddress_t + ("pfnCounterBasedGetDeviceAddress", c_void_p), ## _zeEventCounterBasedGetDeviceAddress_t + ("pfnGetCounterBasedFlags", c_void_p) ## _zeEventGetCounterBasedFlags_t ] ############################################################################### @@ -7423,7 +7915,9 @@ class _ze_dditable_t(Structure): ("RTASBuilderExp", _ze_rtas_builder_exp_dditable_t), ("RTASParallelOperation", _ze_rtas_parallel_operation_dditable_t), ("RTASParallelOperationExp", _ze_rtas_parallel_operation_exp_dditable_t), + ("Graph", _ze_graph_dditable_t), ("Global", _ze_global_dditable_t), + ("ExecutableGraph", _ze_executable_graph_dditable_t), ("Driver", _ze_driver_dditable_t), ("DriverExp", _ze_driver_exp_dditable_t), ("Device", _ze_device_dditable_t), @@ -7517,6 +8011,22 @@ def __init__(self, version : ze_api_version_t): self.zeRTASParallelOperationJoinExp = _zeRTASParallelOperationJoinExp_t(self.__dditable.RTASParallelOperationExp.pfnJoinExp) self.zeRTASParallelOperationDestroyExp = _zeRTASParallelOperationDestroyExp_t(self.__dditable.RTASParallelOperationExp.pfnDestroyExp) + # call driver to get function pointers + _Graph = _ze_graph_dditable_t() + r = ze_result_v(self.__dll.zeGetGraphProcAddrTable(version, byref(_Graph))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.Graph = _Graph + + # attach function interface to function address + self.zeGraphCreateExt = _zeGraphCreateExt_t(self.__dditable.Graph.pfnCreateExt) + self.zeGraphGetPrimaryCommandListExt = _zeGraphGetPrimaryCommandListExt_t(self.__dditable.Graph.pfnGetPrimaryCommandListExt) + self.zeGraphSetDestructionCallbackExt = _zeGraphSetDestructionCallbackExt_t(self.__dditable.Graph.pfnSetDestructionCallbackExt) + self.zeGraphInstantiateExt = _zeGraphInstantiateExt_t(self.__dditable.Graph.pfnInstantiateExt) + self.zeGraphIsEmptyExt = _zeGraphIsEmptyExt_t(self.__dditable.Graph.pfnIsEmptyExt) + self.zeGraphDumpContentsExt = _zeGraphDumpContentsExt_t(self.__dditable.Graph.pfnDumpContentsExt) + self.zeGraphDestroyExt = _zeGraphDestroyExt_t(self.__dditable.Graph.pfnDestroyExt) + # call driver to get function pointers _Global = _ze_global_dditable_t() r = ze_result_v(self.__dll.zeGetGlobalProcAddrTable(version, byref(_Global))) @@ -7528,6 +8038,17 @@ def __init__(self, version : ze_api_version_t): self.zeInit = _zeInit_t(self.__dditable.Global.pfnInit) self.zeInitDrivers = _zeInitDrivers_t(self.__dditable.Global.pfnInitDrivers) + # call driver to get function pointers + _ExecutableGraph = _ze_executable_graph_dditable_t() + r = ze_result_v(self.__dll.zeGetExecutableGraphProcAddrTable(version, byref(_ExecutableGraph))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.ExecutableGraph = _ExecutableGraph + + # attach function interface to function address + self.zeExecutableGraphGetSourceGraphExt = _zeExecutableGraphGetSourceGraphExt_t(self.__dditable.ExecutableGraph.pfnGetSourceGraphExt) + self.zeExecutableGraphDestroyExt = _zeExecutableGraphDestroyExt_t(self.__dditable.ExecutableGraph.pfnDestroyExt) + # call driver to get function pointers _Driver = _ze_driver_dditable_t() r = ze_result_v(self.__dll.zeGetDriverProcAddrTable(version, byref(_Driver))) @@ -7591,6 +8112,7 @@ def __init__(self, version : ze_api_version_t): self.zeDeviceGetRuntimeRequirements = _zeDeviceGetRuntimeRequirements_t(self.__dditable.Device.pfnGetRuntimeRequirements) self.zeDeviceGetRuntimeRequirementsKey = _zeDeviceGetRuntimeRequirementsKey_t(self.__dditable.Device.pfnGetRuntimeRequirementsKey) self.zeDeviceValidateRuntimeRequirements = _zeDeviceValidateRuntimeRequirements_t(self.__dditable.Device.pfnValidateRuntimeRequirements) + self.zeDeviceGetCounterBasedEventMaxValue = _zeDeviceGetCounterBasedEventMaxValue_t(self.__dditable.Device.pfnGetCounterBasedEventMaxValue) # call driver to get function pointers _DeviceExp = _ze_device_exp_dditable_t() @@ -7634,6 +8156,9 @@ def __init__(self, version : ze_api_version_t): self.zeCommandQueueSynchronize = _zeCommandQueueSynchronize_t(self.__dditable.CommandQueue.pfnSynchronize) self.zeCommandQueueGetOrdinal = _zeCommandQueueGetOrdinal_t(self.__dditable.CommandQueue.pfnGetOrdinal) self.zeCommandQueueGetIndex = _zeCommandQueueGetIndex_t(self.__dditable.CommandQueue.pfnGetIndex) + self.zeCommandQueueGetFlags = _zeCommandQueueGetFlags_t(self.__dditable.CommandQueue.pfnGetFlags) + self.zeCommandQueueGetMode = _zeCommandQueueGetMode_t(self.__dditable.CommandQueue.pfnGetMode) + self.zeCommandQueueGetPriority = _zeCommandQueueGetPriority_t(self.__dditable.CommandQueue.pfnGetPriority) # call driver to get function pointers _CommandList = _ze_command_list_dditable_t() @@ -7684,6 +8209,17 @@ def __init__(self, version : ze_api_version_t): self.zeCommandListAppendMemoryCopyWithParameters = _zeCommandListAppendMemoryCopyWithParameters_t(self.__dditable.CommandList.pfnAppendMemoryCopyWithParameters) self.zeCommandListAppendMemoryFillWithParameters = _zeCommandListAppendMemoryFillWithParameters_t(self.__dditable.CommandList.pfnAppendMemoryFillWithParameters) self.zeCommandListImmediateAppendCommandListsWithParameters = _zeCommandListImmediateAppendCommandListsWithParameters_t(self.__dditable.CommandList.pfnImmediateAppendCommandListsWithParameters) + self.zeCommandListGetFlags = _zeCommandListGetFlags_t(self.__dditable.CommandList.pfnGetFlags) + self.zeCommandListImmediateGetFlags = _zeCommandListImmediateGetFlags_t(self.__dditable.CommandList.pfnImmediateGetFlags) + self.zeCommandListImmediateGetMode = _zeCommandListImmediateGetMode_t(self.__dditable.CommandList.pfnImmediateGetMode) + self.zeCommandListImmediateGetPriority = _zeCommandListImmediateGetPriority_t(self.__dditable.CommandList.pfnImmediateGetPriority) + self.zeCommandListBeginGraphCaptureExt = _zeCommandListBeginGraphCaptureExt_t(self.__dditable.CommandList.pfnBeginGraphCaptureExt) + self.zeCommandListBeginCaptureIntoGraphExt = _zeCommandListBeginCaptureIntoGraphExt_t(self.__dditable.CommandList.pfnBeginCaptureIntoGraphExt) + self.zeCommandListIsGraphCaptureEnabledExt = _zeCommandListIsGraphCaptureEnabledExt_t(self.__dditable.CommandList.pfnIsGraphCaptureEnabledExt) + self.zeCommandListEndGraphCaptureExt = _zeCommandListEndGraphCaptureExt_t(self.__dditable.CommandList.pfnEndGraphCaptureExt) + self.zeCommandListGetGraphExt = _zeCommandListGetGraphExt_t(self.__dditable.CommandList.pfnGetGraphExt) + self.zeCommandListAppendGraphExt = _zeCommandListAppendGraphExt_t(self.__dditable.CommandList.pfnAppendGraphExt) + self.zeCommandListAppendHostFunction = _zeCommandListAppendHostFunction_t(self.__dditable.CommandList.pfnAppendHostFunction) # call driver to get function pointers _CommandListExp = _ze_command_list_exp_dditable_t() @@ -7701,6 +8237,7 @@ def __init__(self, version : ze_api_version_t): self.zeCommandListUpdateMutableCommandWaitEventsExp = _zeCommandListUpdateMutableCommandWaitEventsExp_t(self.__dditable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp) self.zeCommandListGetNextCommandIdWithKernelsExp = _zeCommandListGetNextCommandIdWithKernelsExp_t(self.__dditable.CommandListExp.pfnGetNextCommandIdWithKernelsExp) self.zeCommandListUpdateMutableCommandKernelsExp = _zeCommandListUpdateMutableCommandKernelsExp_t(self.__dditable.CommandListExp.pfnUpdateMutableCommandKernelsExp) + self.zeCommandListIsMutableExp = _zeCommandListIsMutableExp_t(self.__dditable.CommandListExp.pfnIsMutableExp) # call driver to get function pointers _Image = _ze_image_dditable_t() @@ -7818,6 +8355,7 @@ def __init__(self, version : ze_api_version_t): self.zeEventCounterBasedOpenIpcHandle = _zeEventCounterBasedOpenIpcHandle_t(self.__dditable.Event.pfnCounterBasedOpenIpcHandle) self.zeEventCounterBasedCloseIpcHandle = _zeEventCounterBasedCloseIpcHandle_t(self.__dditable.Event.pfnCounterBasedCloseIpcHandle) self.zeEventCounterBasedGetDeviceAddress = _zeEventCounterBasedGetDeviceAddress_t(self.__dditable.Event.pfnCounterBasedGetDeviceAddress) + self.zeEventGetCounterBasedFlags = _zeEventGetCounterBasedFlags_t(self.__dditable.Event.pfnGetCounterBasedFlags) # call driver to get function pointers _EventExp = _ze_event_exp_dditable_t() diff --git a/include/ze_api.h b/include/ze_api.h index 563680ca..bd57d336 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZE_API_H @@ -54,6 +54,16 @@ extern "C" { #endif // defined(_WIN32) #endif // ZE_APICALL +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CALLBACK_CONV +#if defined(_WIN32) +/// @brief Callback function calling convention +#define ZE_CALLBACK_CONV __stdcall +#else +#define ZE_CALLBACK_CONV +#endif // defined(_WIN32) +#endif // ZE_CALLBACK_CONV + /////////////////////////////////////////////////////////////////////////////// #ifndef ZE_APIEXPORT #if defined(_WIN32) @@ -261,6 +271,18 @@ typedef enum _ze_result_t ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE = 0x7800001f, ///< [Core, Extension] operands of comparison are not compatible ZE_RESULT_ERROR_SURVIVABILITY_MODE_DETECTED = 0x78000020, ///< [Sysman] device is in survivability mode, firmware update needed ZE_RESULT_ERROR_ADDRESS_NOT_FOUND = 0x78000021, ///< [Core] address not found within specified or current context + ZE_RESULT_QUERY_TRUE = 0x78000022, ///< [Core, Extension] query API returned true + ZE_RESULT_QUERY_FALSE = 0x78000023, ///< [Core, Extension] query API returned false + ZE_RESULT_ERROR_INVALID_GRAPH = 0x78000024, ///< [Core, Extension] graph object is invalid + ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED = 0x78000025, ///< [Core, Extension] operation is not supported during graph capture + ZE_RESULT_ERROR_GRAPH_CAPTURE_INVALIDATED = 0x78000026, ///< [Core, Extension] operations failed and invalidated graph capture + ///< session + ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT = 0x78000027, ///< [Core, Extension] operation failed because it would merge two graph + ///< capture sessions + ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING = 0x78000028, ///< [Core, Extension] command list is not in graph capture mode + ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS = 0x78000029, ///< [Core, Extension] graph contains unjoined forks + ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT = 0x7800002a, ///< [Core, Extension] operation failed because it uses a graph-internal + ///< counter-based event outside of the graph ZE_RESULT_ERROR_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error ZE_RESULT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RESULT_* ENUMs @@ -272,7 +294,8 @@ typedef enum _ze_structure_type_t { ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES = 0x1, ///< ::ze_driver_properties_t ZE_STRUCTURE_TYPE_DRIVER_IPC_PROPERTIES = 0x2, ///< ::ze_driver_ipc_properties_t - ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES = 0x3, ///< ::ze_device_properties_t + ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES = 0x3, ///< ::ze_device_properties_t. @deprecated since 1.17: Use + ///< ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 instead. ZE_STRUCTURE_TYPE_DEVICE_COMPUTE_PROPERTIES = 0x4, ///< ::ze_device_compute_properties_t ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES = 0x5, ///< ::ze_device_module_properties_t ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES = 0x6, ///< ::ze_command_queue_group_properties_t @@ -325,6 +348,8 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_EVENT_QUERY_KERNEL_TIMESTAMPS_RESULTS_EXT_PROPERTIES = 0x10012, ///< ::ze_event_query_kernel_timestamps_results_ext_properties_t ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES = 0x10013, ///< ::ze_kernel_max_group_size_ext_properties_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_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 @@ -389,6 +414,8 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_RUNTIME_REQUIREMENTS_MODULE_DESC = 0x00020044, ///< ::ze_runtime_requirements_module_desc_t ZE_STRUCTURE_TYPE_RUNTIME_REQUIREMENTS_GRAPH_DESC = 0x00020045, ///< ::ze_runtime_requirements_graph_desc_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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -792,6 +819,10 @@ typedef struct _ze_physical_mem_properties_t ze_physical_mem_properties_t; /// @brief Forward-declare ze_float_atomic_ext_properties_t typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_relaxed_allocation_limits_ext_desc_t +typedef struct _ze_relaxed_allocation_limits_ext_desc_t ze_relaxed_allocation_limits_ext_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; @@ -920,6 +951,18 @@ typedef struct _ze_image_format_support_ext_properties_t ze_image_format_support /// @brief Forward-declare ze_ipc_mem_handle_type_ext_desc_t typedef struct _ze_ipc_mem_handle_type_ext_desc_t ze_ipc_mem_handle_type_ext_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_record_replay_graph_ext_properties_t +typedef struct _ze_record_replay_graph_ext_properties_t ze_record_replay_graph_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_record_replay_graph_ext_dump_desc_t +typedef struct _ze_record_replay_graph_ext_dump_desc_t ze_record_replay_graph_ext_dump_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @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_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -1425,7 +1468,8 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_14 = ZE_MAKE_VERSION( 1, 14 ), ///< version 1.14 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_CURRENT = ZE_MAKE_VERSION( 1, 16 ), ///< latest known version + 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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_API_VERSION_* ENUMs } ze_api_version_t; @@ -1433,7 +1477,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, 16 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 17 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -1442,6 +1486,9 @@ typedef enum _ze_api_version_t /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. +/// - Starting from API version 1.17, any driver reporting version 1.17 or +/// later is assumed to support the ::ZE_DRIVER_DDI_HANDLES_EXT_NAME +/// extension; see ::ze_driver_ddi_handles_ext_properties_t for details. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -1947,13 +1994,18 @@ typedef struct _ze_device_properties_t uint32_t numEUsPerSubslice; ///< [out] Maximum number of EUs per sub-slice. uint32_t numSubslicesPerSlice; ///< [out] Maximum number of sub-slices per slice. uint32_t numSlices; ///< [out] Maximum number of slices. - uint64_t timerResolution; ///< [out] Returns the resolution of device timer used for profiling, - ///< timestamps, etc. When stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES the - ///< units are in nanoseconds. When - ///< stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 units are in - ///< cycles/sec - uint32_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. - uint32_t kernelTimestampValidBits; ///< [out] Returns the number of valid bits in the kernel timestamp values + uint64_t timerResolution; ///< [out] @deprecated when using ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES + ///< since 1.17: Use ::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 to obtain + ///< timerResolution in cycles/sec for profiling and timestamps. + uint32_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. (i.e + ///< can be used to calculate the max value of the device timestamp in + ///< hardware or get the mask of valid bits in the timestamp value). + ///< timestampValidBits may or may not be same as the + ///< kernelTimestampValidBits as they may be tracked using different + ///< register sizes which are platform specific. + uint32_t kernelTimestampValidBits; ///< [out] Returns the number of valid bits in the kernel timestamp values. + ///< (i.e can beused to calculate the max value of the kernel timestamp in + ///< hardware or get the mask of valid bits in the kernel timestamp value). ze_device_uuid_t uuid; ///< [out] universal unique identifier. Note: Subdevices will have their ///< own uuid. char name[ZE_MAX_DEVICE_NAME]; ///< [out] Device name @@ -2061,7 +2113,7 @@ typedef enum _ze_device_dp_capability_flag_t } ze_device_dp_capability_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device dot product(dp) input data types flags +/// @brief Supported device dot product(dp) input data types flags typedef uint32_t ze_device_input_data_type_flags_t; typedef enum _ze_device_input_data_type_flag_t { @@ -2075,9 +2127,14 @@ typedef enum _ze_device_input_data_type_flag_t ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_FP8_PACK4_PER_SIMD_LANE = ZE_BIT(7), ///< Supports fp8 data type with 4 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_BF8_PACK4_PER_SIMD_LANE = ZE_BIT(8), ///< Supports bf8 data type with 4 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_E2M1_PACK8_PER_SIMD_LANE = ZE_BIT(9), ///< Supports e2m1 data type with 8 packed data elements per SIMD lane. - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(10), ///< Supports 8bit integer data type with 4 packed data elements per SIMD + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_E3M0_PACK8_PER_SIMD_LANE = ZE_BIT(10), ///< Supports e3m0 data type with 8 packed data elements per SIMD lane. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11), ///< Supports 8bit integer data type with 4 packed data elements per SIMD ///< lane.This is exclusively for DP4V dot product support - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(11),///< Supports uint8 data type support for scaling, exclusive to BDPAS dot + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12),///< Supports uint8 data type support for scaling, exclusive to BDPAS dot + ///< product support. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13),///< Supports ue5m3 data type support for scaling, exclusive to BDPAS dot + ///< product support. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14),///< Supports ue4m3 data type support for scaling, exclusive to BDPAS dot ///< product support. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_INPUT_DATA_TYPE_FLAG_* ENUMs @@ -2830,6 +2887,11 @@ zeDeviceGetStatus( /// - The application may call this function from simultaneous threads with /// the same device handle. /// - The implementation of this function must be thread-safe. +/// - The hostTimestamp value needs to return a sample from a +/// RAW_MONOTONIC_CLOCK source that is not affected by system time changes +/// or by software adjustments to the clock. +/// - The hostTimestamp and deviceTimestamp values should be coordinated to +/// be sampled at the same time/close together /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2854,10 +2916,15 @@ zeDeviceGetStatus( ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ); /////////////////////////////////////////////////////////////////////////////// @@ -2955,6 +3022,55 @@ zeDeviceGetAggregatedCopyOffloadIncrementValue( uint32_t* incrementValue ///< [out] increment value that can be used for Event creation ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns maximum value supported by the driver for Counter Based Events +/// created with externally managed counter storage (see +/// ::ze_event_counter_based_external_sync_allocation_desc_t and +/// ::ze_event_counter_based_external_aggregate_storage_desc_t). +/// +/// @details +/// - Value is applicable only to this specific device. +/// - User must query this value before creating a Counter Based Event with +/// externally managed counter storage and ensure that `completionValue` +/// provided in the descriptor does not exceed it. +/// - User must also ensure that any value written by the application to +/// `deviceAddress` or `hostAddress` of an externally managed counter +/// storage (including values aggregated under `deviceAddress` of +/// ::ze_event_counter_based_external_aggregate_storage_desc_t) does not +/// exceed this maximum at any point in time. +/// - Driver does not validate values written by the user to externally +/// managed memory; exceeding this maximum results in undefined behavior. +/// - ::zeEventCounterBasedCreate returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// if the descriptor specifies a value greater than the value returned by +/// this query. +/// +/// @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 == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == maxValue` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Provided invalid hDevice or maxValue pointer +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Describes the module for which runtime requirements are being /// gathered. This structure is accepted as pObjDesc to @@ -3636,6 +3752,99 @@ zeCommandQueueGetIndex( uint32_t* pIndex ///< [out] command queue index within the group ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue creation flags. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue operation mode. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMode` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue priority. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pPriority` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -4147,6 +4356,139 @@ zeCommandListIsImmediate( ///< command list (true) or not (false) ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command list creation flags. +/// +/// @details +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets immediate command list command queue flags. +/// +/// @details +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets immediate command list command queue mode. +/// +/// @details +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMode` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets immediate command list command queue priority. +/// +/// @details +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pPriority` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -4434,6 +4776,7 @@ zeCommandListAppendMemoryCopyWithParameters( /// - The pattern size must be a power-of-two and less than or equal to the /// `maxMemoryFillPatternSize` member of /// ::ze_command_queue_group_properties_t. +/// - The size must be a multiple of pattern size. /// - 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, @@ -4470,6 +4813,7 @@ zeCommandListAppendMemoryCopyWithParameters( /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `size % pattern_size != 0` ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryFill( ze_command_list_handle_t hCommandList, ///< [in] handle of command list @@ -4499,6 +4843,7 @@ zeCommandListAppendMemoryFill( /// - The pattern size must be a power-of-two and less than or equal to the /// `maxMemoryFillPatternSize` member of /// ::ze_command_queue_group_properties_t. +/// - The size must be a multiple of pattern size. /// - 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, @@ -4534,6 +4879,7 @@ zeCommandListAppendMemoryFill( /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `size % pattern_size != 0` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// + an extension passed via pNext is not supported ZE_APIEXPORT ze_result_t ZE_APICALL @@ -5204,6 +5550,9 @@ typedef enum _ze_event_counter_based_flag_t ///< It is recommended to use this flag for most users that want to ///< correlate timestamps from the host and device into a single timeline. ///< For host timestamps see ::zeDeviceGetGlobalTimestamps. + 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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_COUNTER_BASED_FLAG_* ENUMs } ze_event_counter_based_flag_t; @@ -5289,7 +5638,10 @@ typedef struct _ze_event_counter_based_external_sync_allocation_desc_t ///< structure (i.e. contains stype and pNext). uint64_t* deviceAddress; ///< [in] device address for external synchronization allocation uint64_t* hostAddress; ///< [in] host address for external synchronization allocation - uint64_t completionValue; ///< [in] completion value for external synchronization allocation + uint64_t completionValue; ///< [in] completion value for external synchronization allocation. + ///< Must not exceed the value returned by ::zeDeviceGetCounterBasedEventMaxValue. + ///< User is also responsible for ensuring that any value written by the + ///< application to `deviceAddress` or `hostAddress` does not exceed that maximum. } ze_event_counter_based_external_sync_allocation_desc_t; @@ -5305,7 +5657,11 @@ typedef struct _ze_event_counter_based_external_aggregate_storage_desc_t ///< signaling of this event, must be device USM memory 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 + ///< or greater then this value then event is considered as completed. + ///< Must not exceed the value returned by ::zeDeviceGetCounterBasedEventMaxValue. + ///< User is responsible for ensuring that the value aggregated under + ///< `deviceAddress` (initial value plus any number of `incrementValue` + ///< additions) does not exceed that maximum at any point in time. } ze_event_counter_based_external_aggregate_storage_desc_t; @@ -5379,11 +5735,12 @@ zeEventCreate( /// + `nullptr == desc` /// + `nullptr == phEvent` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3f < desc->flags` +/// + `0x7f < 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_APIEXPORT ze_result_t ZE_APICALL zeEventCounterBasedCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -5614,6 +5971,23 @@ zeEventCounterBasedGetIpcHandle( /////////////////////////////////////////////////////////////////////////////// /// @brief Opens an IPC event handle to retrieve from another process. /// +/// @details +/// - 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. +/// - 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. +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -5700,7 +6074,15 @@ zeEventCounterBasedGetDeviceAddress( /// /// @details /// - The application must ensure the events are accessible by the device on -/// which the command list was created. +/// 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. @@ -5747,6 +6129,10 @@ zeCommandListAppendSignalEvent( /// @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 @@ -5976,12 +6362,12 @@ zeEventHostReset( /// @details /// - The timestamp frequency can be queried from the `timerResolution` /// member of ::ze_device_properties_t. -/// - The number of valid bits in the timestamp value can be queried from +/// - The number of valid bits in the timestamp values can be inferred from /// the `kernelTimestampValidBits` member of ::ze_device_properties_t. typedef struct _ze_kernel_timestamp_data_t { - uint64_t kernelStart; ///< [out] device clock at start of kernel execution - uint64_t kernelEnd; ///< [out] device clock at end of kernel execution + uint64_t kernelStart; ///< [out] time sample in tick counts at start of kernel execution + uint64_t kernelEnd; ///< [out] time sample in tick counts at end of kernel execution } ze_kernel_timestamp_data_t; @@ -5989,9 +6375,10 @@ typedef struct _ze_kernel_timestamp_data_t /// @brief Kernel timestamp result typedef struct _ze_kernel_timestamp_result_t { - ze_kernel_timestamp_data_t global; ///< [out] wall-clock data - ze_kernel_timestamp_data_t context; ///< [out] context-active data; only includes clocks while device context - ///< was actively executing. + ze_kernel_timestamp_data_t global; ///< [out] wall-clock data; free running device clock indicating active + ///< device state. + ze_kernel_timestamp_data_t context; ///< [out] context specific active data; only includes clocks while context + ///< was actively executing on the device. } ze_kernel_timestamp_result_t; @@ -6041,7 +6428,8 @@ zeEventQueryKernelTimestamp( /// - The application must ensure the events are accessible by the device on /// which the command list was created. /// - The application must ensure the events were created from an event pool -/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. +/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. /// - The application must ensure the memory pointed to by both dstptr and /// pOffsets is accessible by the device on which the command list was /// created. @@ -6254,21 +6642,56 @@ zeEventPoolGetFlags( ///< valid combination of ::ze_event_pool_flag_t ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs for Fence -#if !defined(__GNUC__) -#pragma region fence -#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported fence creation flags -typedef uint32_t ze_fence_flags_t; -typedef enum _ze_fence_flag_t -{ - ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. - ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FENCE_FLAG_* ENUMs - +/// @brief Gets counter based flags of an event. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// - Returns 0 for regular events created with ::zeEventCreate, and a valid +/// combination of ::ze_event_counter_based_flag_t for counter based +/// events created with ::zeEventCounterBasedCreate. +/// +/// @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 == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Fence +#if !defined(__GNUC__) +#pragma region fence +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported fence creation flags +typedef uint32_t ze_fence_flags_t; +typedef enum _ze_fence_flag_t +{ + ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. + ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FENCE_FLAG_* ENUMs + } ze_fence_flag_t; /////////////////////////////////////////////////////////////////////////////// @@ -7157,9 +7580,13 @@ zeMemGetAddressRange( /// @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 must be base pointer of a device or host memory -/// allocation; i.e. the value returned from ::zeMemAllocDevice or from -/// ::zeMemAllocHost, respectively. +/// - 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. /// @@ -7317,10 +7744,29 @@ typedef enum _ze_ipc_memory_flag_t /// @details /// - Takes an IPC memory handle from a remote process and associates it /// with a device pointer usable in this process. +/// - The 'hDevice' parameter identifies the device into which the +/// allocation is imported. If this device differs from the one where the +/// memory was originally allocated, it must have P2P access to the +/// exporting device. P2P accessibility can be verified using +/// ::zeDeviceGetP2PProperties or ::zeDeviceCanAccessPeer. +/// - The `hContext` parameter has no requirement to match the context used +/// during the original allocation in the exporting process. Any context +/// of the importing process may be used. +/// - After the handle is successfully opened, the returned pointer may be +/// accessed by `hDevice` and by any other device of the importing process +/// that has P2P connectivity to the exporting device. +/// - When the IPC handle was originally created from a physical memory +/// object (directly via a mapped virtual address), opening the handle +/// assigns a new virtual address in the importing process that maps to +/// the underlying physical memory; no prior ::zeVirtualMemReserve or +/// ::zeVirtualMemMap call is required in the importing process. /// - The device pointer in this process should not be freed with /// ::zeMemFree, but rather with ::zeMemCloseIpcHandle. /// - Multiple calls to this function with the same IPC handle will return /// unique pointers. +/// - The driver must not release the underlying physical memory until all +/// IPC handles referencing it have been closed via ::zeMemCloseIpcHandle +/// or returned via ::zeMemPutIpcHandle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -10032,53 +10478,106 @@ zeKernelSetGlobalOffsetExp( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting relaxed allocation limits. +// [DEPRECATED] Intel 'oneAPI' Level-Zero Extension for supporting relaxed allocation limits. Use the standard `ZE_extension_relaxed_allocation_limits` extension instead. #if !defined(__GNUC__) #pragma region relaxedAllocLimits #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME +#ifndef ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME /// @brief Relaxed Allocation Limits Extension Name +#define ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME "ZE_extension_relaxed_allocation_limits" +#endif // ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Relaxed Allocation Limits Extension Version(s) +typedef enum _ze_relaxed_allocation_limits_ext_version_t +{ + ZE_RELAXED_ALLOCATION_LIMITS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RELAXED_ALLOCATION_LIMITS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RELAXED_ALLOCATION_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXT_VERSION_* ENUMs + +} ze_relaxed_allocation_limits_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported relaxed memory allocation flags +typedef uint32_t ze_relaxed_allocation_limits_ext_flags_t; +typedef enum _ze_relaxed_allocation_limits_ext_flag_t +{ + ZE_RELAXED_ALLOCATION_LIMITS_EXT_FLAG_MAX_SIZE = ZE_BIT(0), ///< Allocation size may exceed the `maxMemAllocSize` member of + ///< ::ze_device_properties_t. + ZE_RELAXED_ALLOCATION_LIMITS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXT_FLAG_* ENUMs + +} ze_relaxed_allocation_limits_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Relaxed limits memory allocation descriptor +/// +/// @details +/// - This structure may be passed to ::zeMemAllocShared or +/// ::zeMemAllocDevice, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t. +/// - This structure may also be passed to ::zeMemAllocHost, via the `pNext` +/// member of ::ze_host_mem_alloc_desc_t. +typedef struct _ze_relaxed_allocation_limits_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_relaxed_allocation_limits_ext_flags_t flags; ///< [in] flags specifying allocation limits to relax. + ///< must be 0 (default) or a valid combination of ::ze_relaxed_allocation_limits_ext_flag_t; + +} ze_relaxed_allocation_limits_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME +/// @brief [DEPRECATED] Relaxed Allocation Limits Extension Name. Use +/// ::ZE_RELAXED_ALLOCATION_LIMITS_EXT_NAME instead. #define ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME "ZE_experimental_relaxed_allocation_limits" #endif // ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Relaxed Allocation Limits Extension Version(s) +/// @brief [DEPRECATED] Relaxed Allocation Limits Extension Version(s). Use +/// ::ze_relaxed_allocation_limits_ext_version_t instead. typedef enum _ze_relaxed_allocation_limits_exp_version_t { - ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< [DEPRECATED] version 1.0 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_* ENUMs } ze_relaxed_allocation_limits_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported relaxed memory allocation flags +/// @brief [DEPRECATED] Supported relaxed memory allocation flags. Use +/// ::ze_relaxed_allocation_limits_ext_flags_t instead. typedef uint32_t ze_relaxed_allocation_limits_exp_flags_t; typedef enum _ze_relaxed_allocation_limits_exp_flag_t { - ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE = ZE_BIT(0), ///< Allocation size may exceed the `maxMemAllocSize` member of - ///< ::ze_device_properties_t. + ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE = ZE_BIT(0), ///< [DEPRECATED] Allocation size may exceed the `maxMemAllocSize` member + ///< of ::ze_device_properties_t. Use + ///< ::ze_relaxed_allocation_limits_ext_flags_t MAX_SIZE instead. ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_* ENUMs } ze_relaxed_allocation_limits_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Relaxed limits memory allocation descriptor +/// @brief [DEPRECATED] Relaxed limits memory allocation descriptor. Use +/// ::ze_relaxed_allocation_limits_ext_desc_t instead. /// /// @details -/// - This structure may be passed to ::zeMemAllocShared or +/// - [DEPRECATED] This structure may be passed to ::zeMemAllocShared or /// ::zeMemAllocDevice, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t. -/// - This structure may also be passed to ::zeMemAllocHost, via the `pNext` -/// member of ::ze_host_mem_alloc_desc_t. +/// ::ze_device_mem_alloc_desc_t. Use +/// ::ze_relaxed_allocation_limits_ext_desc_t instead. +/// - [DEPRECATED] This structure may also be passed to ::zeMemAllocHost, +/// via the `pNext` member of ::ze_host_mem_alloc_desc_t. Use +/// ::ze_relaxed_allocation_limits_ext_desc_t instead. typedef struct _ze_relaxed_allocation_limits_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). - ze_relaxed_allocation_limits_exp_flags_t flags; ///< [in] flags specifying allocation limits to relax. - ///< must be 0 (default) or a valid combination of ::ze_relaxed_allocation_limits_exp_flag_t; + ze_relaxed_allocation_limits_exp_flags_t flags; ///< [in] [DEPRECATED] no longer supported, use + ///< ::ze_relaxed_allocation_limits_ext_desc_t instead } ze_relaxed_allocation_limits_exp_desc_t; @@ -10181,6 +10680,20 @@ typedef enum _ze_driver_ddi_handle_ext_flag_t /// @details /// - This structure may be returned from ::zeDriverGetProperties, via the /// `pNext` member of ::ze_driver_properties_t. +/// - Starting from spec version 1.17, support for this extension is assumed +/// for any driver reporting API version 1.17 or later via +/// ::zeDriverGetApiVersion; the loader does NOT need to query the +/// extension property for such drivers. +/// - For drivers reporting API version 1.16 or earlier, the loader must +/// check for this extension before using DDI handles. +/// - This guarantee enables Level Zero extensions introduced in spec v1.17 +/// or later to embed handles directly inside Level Zero structures (e.g., +/// via pNext chains) without requiring the loader to translate or unwrap +/// handles. +/// - Additionally, drivers may assume the loader will dispatch calls +/// exclusively via the DDI tables embedded in their handles; the only +/// exception is the global DDI table used during driver initialization +/// and to read the reported API version. typedef struct _ze_driver_ddi_handles_ext_properties_t { ze_structure_type_t stype; ///< [in] type of this structure @@ -11625,7 +12138,7 @@ zeDeviceGetVectorWidthPropertiesExt( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Mapping External Memory as part of host llocation +// Intel 'oneAPI' Level-Zero Extension APIs for Mapping External Memory as part of host allocation #if !defined(__GNUC__) #pragma region externalMemMap #endif @@ -11652,15 +12165,46 @@ typedef enum _ze_external_memmap_sysmem_ext_version_t /// - This structure may be passed to ::zeMemAllocHost, via the `pNext` /// member of ::ze_host_mem_alloc_desc_t to map system memory for a host /// allocation. -/// - The system memory pointer and size being mapped must be page aligned -/// based on the supported page sizes on the device. +/// - The `pSystemMemory` pointer and `size` being mapped must be aligned to +/// the host page size. The host page size must be queried using +/// operating-system-specific calls, as the mapped memory originates from +/// the system allocator rather than from Level-Zero; there is no +/// Level-Zero query for this value. +/// - On success, the pointer returned from ::zeMemAllocHost is identical to +/// `pSystemMemory`; the mapping preserves the virtual address, so the +/// same address is valid on both the host and the device. +/// - Memory from the application's heap, stack, or statically-allocated +/// (global) storage is supported. Support for memory obtained by other +/// means is platform- and driver-dependent and is not guaranteed. If +/// `pSystemMemory` points to a memory type that cannot be mapped, +/// ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +/// - Host memory that is read-only can only be mapped successfully when the +/// ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in +/// ::ze_host_mem_alloc_desc_t; in that case device access to the mapped +/// memory is read-only. +/// - The system memory referenced by `pSystemMemory` must remain valid for +/// the entire lifetime of the resulting allocation. Freeing or unmapping +/// the underlying system memory before the allocation is released results +/// in undefined behavior. +/// - Mapped memory ranges must not overlap. Releasing a mapping with +/// ::zeMemFree tears down the device page-table entries for its virtual +/// address range. Because these page tables are shared across imports, +/// releasing a mapping that overlaps another import also tears down the +/// overlapping device page-table entries, leaving the other allocation +/// invalid for device access. The host system memory itself is +/// unaffected. +/// - After mapping, ::zeMemGetAllocProperties reports the allocation type +/// as ::ZE_MEMORY_TYPE_HOST_IMPORTED. +/// - The mapping is released by passing the pointer to ::zeMemFree, like +/// any other host allocation. typedef struct _ze_external_memmap_sysmem_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). void* pSystemMemory; ///< [in] system memory pointer to map; must be page-aligned. - uint64_t size; ///< [in] size of the system memory to map; must be page-aligned. + uint64_t size; ///< [in] size of the system memory to map; must be a multiple of the page + ///< size. } ze_external_memmap_sysmem_ext_desc_t; @@ -11894,6 +12438,12 @@ typedef struct _ze_ipc_mem_handle_type_ext_desc_t /// 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. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -11927,70 +12477,98 @@ zeMemGetIpcHandleWithProperties( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Level-Zero Extension for Record and Replay of Graphs. #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region graph #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CACHE_RESERVATION_EXT_NAME -/// @brief Cache_Reservation Extension Name -#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" -#endif // ZE_CACHE_RESERVATION_EXT_NAME +#ifndef ZE_RECORD_REPLAY_GRAPH_EXT_NAME +/// @brief Record and Replay Graph Extension Name +#define ZE_RECORD_REPLAY_GRAPH_EXT_NAME "ZE_extension_record_replay_graph" +#endif // ZE_RECORD_REPLAY_GRAPH_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache_Reservation Extension Version(s) -typedef enum _ze_cache_reservation_ext_version_t +/// @brief Record and Replay Graph Extension Version(s) +typedef enum _ze_record_replay_graph_ext_version_t { - ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_* ENUMs -} ze_cache_reservation_ext_version_t; +} ze_record_replay_graph_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache Reservation Region -typedef enum _ze_cache_ext_region_t +/// @brief Record and Replay Graph capability flags +typedef uint32_t ze_record_replay_graph_ext_flags_t; +typedef enum _ze_record_replay_graph_ext_flag_t { - ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use - ///< ::ZE_CACHE_EXT_REGION_DEFAULT. - ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use - ///< ::ZE_CACHE_EXT_REGION_RESERVED. - ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use - ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. - ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme - ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region - ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region - ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_IMMUTABLE_GRAPH = ZE_BIT(0), ///< Supports graphs that can't mutate + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_MUTABLE_GRAPH = ZE_BIT(1), ///< Supports graphs that can mutate + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS = ZE_BIT(2), ///< Supports appending a subgraph into a graph + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST = ZE_BIT(3), ///< Supports appending a command list into a graph + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC = ZE_BIT(4), ///< Supports waiting/signaling events that were created with both + ///< ZEX_COUNTER_BASED_EVENT_FLAG_IPC and + ///< ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_* ENUMs -} ze_cache_ext_region_t; +} ze_record_replay_graph_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure +/// @brief Supported Record and Replay Graph properties. This structure is +/// accepted as pNext to ::ze_device_properties_t +typedef struct _ze_record_replay_graph_ext_properties_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). + ze_record_replay_graph_ext_flags_t graphFlags; ///< [out] record and replay flags + +} ze_record_replay_graph_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of an executable graph object +typedef struct _ze_executable_graph_handle_t *ze_executable_graph_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Record and Replay Graph dump mode +typedef enum _ze_record_replay_graph_ext_dump_mode_t +{ + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_DETAILED = 0x0, ///< detailed mode (default) + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_SIMPLE = 0x1, ///< simple mode + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_* ENUMs + +} ze_record_replay_graph_ext_dump_mode_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Record and Replay Graph dump descriptor /// /// @details -/// - This structure must be passed to ::zeDeviceGetCacheProperties via the -/// `pNext` member of ::ze_device_cache_properties_t -/// - Used for determining the max cache reservation allowed on device. Size -/// of zero means no reservation available. -typedef struct _ze_cache_reservation_ext_desc_t +/// - Accepted as pNext in ::zeGraphDumpContentsExt. +typedef struct _ze_record_replay_graph_ext_dump_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 maxCacheReservationSize; ///< [out] max cache reservation size + ze_record_replay_graph_ext_dump_mode_t mode; ///< [in] graph dump mode -} ze_cache_reservation_ext_desc_t; +} ze_record_replay_graph_ext_dump_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief Callback function pointer type invoked when a graph is destroyed +typedef void (ZE_CALLBACK_CONV *zex_mem_graph_free_callback_fn_t)( + void* pUserData ///< [in][optional] user data pointer provided at callback registration + ///< time + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a new graph object. /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @remarks -/// _Analogues_ -/// - None +/// - A newly created graph is an empty container for captured operations. +/// - The application may instantiate executable graph objects from a +/// recorded graph using ::zeGraphInstantiateExt. +/// - The application may begin capturing into an empty graph using +/// ::zeCommandListBeginCaptureIntoGraphExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12007,23 +12585,88 @@ typedef struct _ze_cache_reservation_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation +zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Begins recording asynchronous append operations into a new graph +/// associated with an immediate command list. /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - Graph capture is intended for asynchronous append operations only; +/// synchronous operations are not supported while capture is active and +/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - The application must call this function only with an immediate command +/// list. +/// - The application must not call this function with a synchronous +/// immediate command list. +/// - After this call succeeds, append operations issued to the command list +/// are recorded into a graph and are not submitted to the device. Events +/// used by these operations are not signaled until capture ends and the +/// graph is instantiated and executed. +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while +/// capture is active, calling +/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is +/// active, calling ::zeCommandListAppendGraphExt on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - While capture is active, host-side synchronization operations on +/// recorded work, such as ::zeCommandListHostSynchronize or +/// ::zeEventHostSynchronize, return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - While capture is active, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph +/// cannot be used outside the graph; such use returns an error +/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). +/// - The command list on which capture starts is called the primary command +/// list for a given capture session. +/// - If an event signaled by a captured command list is used in the wait +/// list of another immediate command list, that command list also enters +/// graph capture mode. This creates a fork. The command list from which +/// the fork originated is called the parent, and the forked command list +/// is called the child. A child command list may itself be used to create +/// additional forks, resulting in a tree of command lists participating +/// in the same graph capture. +/// - Subsequent signals from the parent command list to a child command +/// list are allowed and do not create additional forks or capture +/// sessions; the child command list remains in the same capture session +/// as the parent command list. +/// - Each fork must be joined by signaling on the child command list and by +/// waiting on the parent command list. +/// - A child command list may signal multiple times back to the parent +/// command list, but only the last signal on the child command list may +/// become part of the join operation. +/// - Child command lists continue recording as long as the primary command +/// list is in capture mode. +/// - Commands that append work (for example, compute kernels or data +/// transfers) to a recording child command list after the intended join +/// operation are treated as unjoined work, and the graph is considered +/// invalid. Commands that do not append work (for example, event signal +/// and wait operations) are allowed after the join operation and do not +/// invalidate the graph. +/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply to recording child command lists as well. +/// - It is invalid to merge two separate graph capture sessions (i.e. with +/// different primary command lists) by waiting on an event associated +/// with a different graph (operation will return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event +/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error +/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append +/// operations. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12040,61 +12683,104 @@ zeDeviceReserveCacheExt( /// - ::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 == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region +zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. -#if !defined(__GNUC__) -#pragma region eventquerytimestamps -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// @brief Event Query Timestamps Extension Name -#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" -#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME - /////////////////////////////////////////////////////////////////////////////// -/// @brief Event Query Timestamps Extension Version(s) -typedef enum _ze_event_query_timestamps_exp_version_t -{ - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs - -} ze_event_query_timestamps_exp_version_t; +/// @brief Begins recording asynchronous append operations into an existing +/// graph. +/// +/// @details +/// - The graph must be created with ::zeGraphCreateExt before calling this +/// function. +/// - The graph must be empty when capture begins. +/// - After this call succeeds, the command list enters graph capture mode +/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply. +/// +/// @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 == hCommandList` +/// + `nullptr == hGraph` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @brief Queries whether a command list is in graph capture mode. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// extension. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is +/// in graph capture mode. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is +/// not in graph capture mode. /// -/// @remarks -/// _Analogues_ -/// - None +/// @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 == hCommandList` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ends graph capture on the primary command list and returns the +/// recorded graph. +/// +/// @details +/// - This function may only be called on the primary command list used with +/// ::zeCommandListBeginGraphCaptureExt or +/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, +/// the returned graph handle is the same graph handle that was provided +/// when capture began. +/// - The returned graph must be instantiated before execution. +/// - This call ends graph capture mode on all command lists participating +/// in the same graph capture (including forks). +/// - After this call succeeds, subsequent append operations submit work to +/// the device normally. +/// - If capture mode is not active on the command list, an error is +/// returned. +/// - After this call succeeds, events signaled by previously captured +/// commands do not create new forks. +/// - After this call succeeds, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the +/// application and don't interfere with recorded state. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12111,29 +12797,723 @@ typedef enum _ze_event_query_timestamps_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// + if graph contains unjoined forks +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ZE_APIEXPORT ze_result_t ZE_APICALL -zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. +zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. -#if !defined(__GNUC__) +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns the graph associated with a command list that is in graph +/// capture mode. +/// +/// @details +/// - This function may only be called while the command list is in graph +/// capture mode. +/// - The returned graph handle cannot be instantiated until capture is +/// ended by ::zeCommandListEndGraphCaptureExt. +/// - This function does not transfer ownership of the graph handle. +/// - If the command list is not in graph capture mode, an error is returned +/// and `*phGraph` is set to null. +/// +/// @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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns the primary command list associated with a graph capture +/// session. +/// +/// @details +/// - The returned command list is the command list that initiated capture +/// for the graph during its recording stage. +/// - This function can be called while the graph is being recorded and +/// after capture has ended. +/// +/// @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 == phCommandList` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Registers a host callback that is invoked when a graph is destroyed. +/// +/// @details +/// - Callbacks may be registered while a graph is being recorded or after +/// executable graph instances have been created from it. +/// - Multiple callbacks may be registered for the same graph. +/// - All registered callbacks are invoked when the graph is destroyed. +/// - The callback must not call Level Zero APIs that use the graph being +/// destroyed. +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates an executable graph object from a recorded graph. +/// +/// @details +/// - Multiple executable graph objects may be created from a single +/// recorded graph. +/// - 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. +/// +/// @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 == phExecutableGraph` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends execution of an executable graph to a command list. +/// +/// @details +/// - The destination command list must match the type and execution +/// characteristics of the command list used to initiate recording, +/// including the queue group ordinal and immediate mode configuration. +/// - Only one execution of the same executable graph object may run at a +/// time; concurrent graph execution requires multiple executable graph +/// instances. +/// - If this function is called while the executable graph is already +/// running, the new execution is scheduled after the current execution +/// completes. +/// - Graph execution obeys the implicit in-order dependency semantics of +/// the destination command list. +/// - If `hSignalEvent` is provided, it is signaled after all recorded +/// append operations on all recorded queues complete. +/// - If wait events are provided, graph execution does not begin until all +/// wait events are satisfied. +/// +/// @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 == hCommandList` +/// + `nullptr == hGraph` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns the recorded graph used to instantiate an executable 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 == phSourceGraph` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Queries whether a graph is empty. +/// +/// @details +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no +/// operations. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains +/// recorded operations. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid. +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Writes a DOT description of a recorded graph to disk. +/// +/// @details +/// - The generated DOT output captures the graph structure and recorded +/// append operations. +/// - Kernel node output includes kernel names, argument lists, and argument +/// types and values. +/// +/// @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 == filePath` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys an executable graph object. +/// +/// @details +/// - The executable graph must not be in use or executing on any command +/// list when it is destroyed. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a recorded graph object. +/// +/// @details +/// - All executable graph instances created from the recorded graph must be +/// destroyed before this function is called. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Append Host Function +#if !defined(__GNUC__) +#pragma region hostFunction +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Host Function callback type +typedef void (ZE_CALLBACK_CONV *ze_host_function_callback_t)( + void* pUserData ///< [in][optional] user data pointer + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends a host function call into a command list. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The host function will be executed on the host when the command list +/// reaches this point during execution. +/// - The host function callback must be of type +/// ::ze_host_function_callback_t. +/// - The host function must **not** call any Level Zero API functions. +/// - The host function may access USM shared and USM host allocations. +/// - The runtime invokes the host function asynchronously to API calls. +/// - Device may wait for preceding commands to finish before invoking the +/// callback (i.e. callbacks may introduce implicit synchronization point +/// on the device). +/// - Device will wait for all phWaitEvents to be signaled before executing +/// the host function. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// +/// @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_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported +ZE_APIEXPORT 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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Virtual Memory Read-Only Properties +#if !defined(__GNUC__) +#pragma region virtualMemReadOnlyProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME +/// @brief Virtual Memory Read-Only Properties Extension Name +#define ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME "ZE_extension_virtual_mem_readonly_properties" +#endif // ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Virtual Memory Read-Only Properties Extension Version(s) +typedef enum _ze_virtual_mem_readonly_properties_ext_version_t +{ + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_virtual_mem_readonly_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read-only memory page capability values +typedef enum _ze_device_readonly_memory_capability_t +{ + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE = 0, ///< Read-only attribute has no effect; the driver does not act on it. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT = 1, ///< Read-only attribute is a performance hint to the OS; writes may still + ///< succeed without fault. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED = 2, ///< Read-only attribute is hardware-enforced; writes to read-only pages + ///< will cause a device fault. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_READONLY_MEMORY_CAPABILITY_* ENUMs + +} ze_device_readonly_memory_capability_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device read-only memory capability properties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_readonly_memory_ext_properties_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). + ze_device_readonly_memory_capability_t readonlyCapability; ///< [out] Indicates device behavior when + ///< ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no + ///< effect; writes succeed normally. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a + ///< performance hint; writes may still succeed. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is + ///< hardware-enforced; writes cause a device fault. + +} ze_device_readonly_memory_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +#if !defined(__GNUC__) +#pragma region cacheReservation +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CACHE_RESERVATION_EXT_NAME +/// @brief Cache_Reservation Extension Name +#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" +#endif // ZE_CACHE_RESERVATION_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Cache_Reservation Extension Version(s) +typedef enum _ze_cache_reservation_ext_version_t +{ + ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs + +} ze_cache_reservation_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Cache Reservation Region +typedef enum _ze_cache_ext_region_t +{ + ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use + ///< ::ZE_CACHE_EXT_REGION_DEFAULT. + ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use + ///< ::ZE_CACHE_EXT_REGION_RESERVED. + ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use + ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. + ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme + ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region + ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region + ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs + +} ze_cache_ext_region_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheReservation structure +/// +/// @details +/// - This structure must be passed to ::zeDeviceGetCacheProperties via the +/// `pNext` member of ::ze_device_cache_properties_t +/// - Used for determining the max cache reservation allowed on device. Size +/// of zero means no reservation available. +typedef struct _ze_cache_reservation_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 maxCacheReservationSize; ///< [out] max cache reservation size + +} ze_cache_reservation_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Reserve Cache on Device +/// +/// @details +/// - The application may call this function but may not be successful as +/// some other application may have reserve prior +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Assign VA section to use reserved section +/// +/// @details +/// - The application may call this function to assign VA to particular +/// reservartion region +/// +/// @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 == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. +#if !defined(__GNUC__) +#pragma region eventquerytimestamps +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// @brief Event Query Timestamps Extension Name +#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" +#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event Query Timestamps Extension Version(s) +typedef enum _ze_event_query_timestamps_exp_version_t +{ + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs + +} ze_event_query_timestamps_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query event timestamps for a device or sub-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_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @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 == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. +#if !defined(__GNUC__) #pragma region imagememoryproperties #endif /////////////////////////////////////////////////////////////////////////////// @@ -13869,6 +15249,8 @@ typedef enum _ze_device_memory_ext_type_t ZE_DEVICE_MEMORY_EXT_TYPE_HBM3 = 23, ///< HBM3 memory ZE_DEVICE_MEMORY_EXT_TYPE_HBM3E = 24, ///< HBM3E memory ZE_DEVICE_MEMORY_EXT_TYPE_HBM4 = 25, ///< HBM4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5X = 26, ///< LPDDR5X memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR6 = 27, ///< LPDDR6 memory ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs } ze_device_memory_ext_type_t; @@ -14110,8 +15492,9 @@ typedef struct _ze_event_query_kernel_timestamps_ext_properties_t /// @brief Kernel timestamp clock data synchronized to the host time domain typedef struct _ze_synchronized_timestamp_data_ext_t { - uint64_t kernelStart; ///< [out] synchronized clock at start of kernel execution - uint64_t kernelEnd; ///< [out] synchronized clock at end of kernel execution + uint64_t kernelStart; ///< [out] start of kernel execution in nanoseconds, on the host time + ///< domain. + uint64_t kernelEnd; ///< [out] end of kernel execution in nanoseconds, on the host time domain. } ze_synchronized_timestamp_data_ext_t; @@ -14119,9 +15502,10 @@ typedef struct _ze_synchronized_timestamp_data_ext_t /// @brief Synchronized kernel timestamp result typedef struct _ze_synchronized_timestamp_result_ext_t { - ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data - ze_synchronized_timestamp_data_ext_t context; ///< [out] context-active data; only includes clocks while device context - ///< was actively executing. + ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data; free running device clock when device was + ///< active,on the host time domain + ze_synchronized_timestamp_data_ext_t context; ///< [out] context specific active data; only includes clocks while context + ///< was actively executing on the device, on the host time domain } ze_synchronized_timestamp_result_ext_t; @@ -15433,6 +16817,7 @@ typedef enum _ze_command_list_clone_exp_version_t /// @brief Creates a command list as the clone of another command list. /// /// @details +/// - @deprecated since 1.17 /// - The source command list must be created with the /// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. /// - The source command list must be closed prior to cloning. @@ -15884,6 +17269,39 @@ zeCommandListUpdateMutableCommandsExp( ///< be chained via `pNext` member ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query whether a command list was created with the mutable command list +/// extension. +/// +/// @details +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pIsMutable` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Updates the signal event for a mutable command in a mutable command /// list. diff --git a/include/ze_ddi.h b/include/ze_ddi.h index f971a97d..a6204a24 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZE_DDI_H @@ -286,6 +286,93 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationExpProcAddrTable_ ze_rtas_parallel_operation_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphCreateExt_t)( + ze_context_handle_t, + const void*, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphGetPrimaryCommandListExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphGetPrimaryCommandListExt_t)( + ze_graph_handle_t, + ze_command_list_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphSetDestructionCallbackExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphSetDestructionCallbackExt_t)( + ze_graph_handle_t, + zex_mem_graph_free_callback_fn_t, + void*, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphInstantiateExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphInstantiateExt_t)( + ze_graph_handle_t, + const void*, + ze_executable_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphIsEmptyExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphIsEmptyExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphDumpContentsExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphDumpContentsExt_t)( + ze_graph_handle_t, + const char*, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphDestroyExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of Graph functions pointers +typedef struct _ze_graph_dditable_t +{ + ze_pfnGraphCreateExt_t pfnCreateExt; + ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt; + ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt; + ze_pfnGraphInstantiateExt_t pfnInstantiateExt; + ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt; + ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt; + ze_pfnGraphDestroyExt_t pfnDestroyExt; +} ze_graph_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetGraphProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetGraphProcAddrTable_t)( + ze_api_version_t, + ze_graph_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeInit typedef ze_result_t (ZE_APICALL *ze_pfnInit_t)( @@ -330,6 +417,49 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetGlobalProcAddrTable_t)( ze_global_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeExecutableGraphGetSourceGraphExt +typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphGetSourceGraphExt_t)( + ze_executable_graph_handle_t, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeExecutableGraphDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphDestroyExt_t)( + ze_executable_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of ExecutableGraph functions pointers +typedef struct _ze_executable_graph_dditable_t +{ + ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt; + ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt; +} ze_executable_graph_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetExecutableGraphProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetExecutableGraphProcAddrTable_t)( + ze_api_version_t, + ze_executable_graph_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeDriverGet typedef ze_result_t (ZE_APICALL *ze_pfnDriverGet_t)( @@ -671,6 +801,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceValidateRuntimeRequirements_t)( ze_validate_runtime_requirements_output_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceGetCounterBasedEventMaxValue +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetCounterBasedEventMaxValue_t)( + ze_device_handle_t, + uint64_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -702,6 +839,7 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceGetRuntimeRequirements_t pfnGetRuntimeRequirements; ze_pfnDeviceGetRuntimeRequirementsKey_t pfnGetRuntimeRequirementsKey; ze_pfnDeviceValidateRuntimeRequirements_t pfnValidateRuntimeRequirements; + ze_pfnDeviceGetCounterBasedEventMaxValue_t pfnGetCounterBasedEventMaxValue; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -915,6 +1053,27 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueGetIndex_t)( uint32_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandQueueGetFlags +typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueGetFlags_t)( + ze_command_queue_handle_t, + ze_command_queue_flags_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandQueueGetMode +typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueGetMode_t)( + ze_command_queue_handle_t, + ze_command_queue_mode_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandQueueGetPriority +typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueGetPriority_t)( + ze_command_queue_handle_t, + ze_command_queue_priority_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandQueue functions pointers typedef struct _ze_command_queue_dditable_t @@ -925,6 +1084,9 @@ typedef struct _ze_command_queue_dditable_t ze_pfnCommandQueueSynchronize_t pfnSynchronize; ze_pfnCommandQueueGetOrdinal_t pfnGetOrdinal; ze_pfnCommandQueueGetIndex_t pfnGetIndex; + ze_pfnCommandQueueGetFlags_t pfnGetFlags; + ze_pfnCommandQueueGetMode_t pfnGetMode; + ze_pfnCommandQueueGetPriority_t pfnGetPriority; } ze_command_queue_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1377,6 +1539,93 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateAppendCommandListsWit ze_event_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListGetFlags +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetFlags_t)( + ze_command_list_handle_t, + ze_command_list_flags_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListImmediateGetFlags +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateGetFlags_t)( + ze_command_list_handle_t, + ze_command_queue_flags_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListImmediateGetMode +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateGetMode_t)( + ze_command_list_handle_t, + ze_command_queue_mode_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListImmediateGetPriority +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateGetPriority_t)( + ze_command_list_handle_t, + ze_command_queue_priority_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListBeginGraphCaptureExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListBeginGraphCaptureExt_t)( + ze_command_list_handle_t, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListBeginCaptureIntoGraphExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListBeginCaptureIntoGraphExt_t)( + ze_command_list_handle_t, + ze_graph_handle_t, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListIsGraphCaptureEnabledExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListIsGraphCaptureEnabledExt_t)( + ze_command_list_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListEndGraphCaptureExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListEndGraphCaptureExt_t)( + ze_command_list_handle_t, + const void*, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListGetGraphExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetGraphExt_t)( + ze_command_list_handle_t, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendGraphExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendGraphExt_t)( + ze_command_list_handle_t, + ze_executable_graph_handle_t, + const void*, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendHostFunction +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendHostFunction_t)( + ze_command_list_handle_t, + ze_host_function_callback_t, + void*, + const void*, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandList functions pointers typedef struct _ze_command_list_dditable_t @@ -1422,6 +1671,17 @@ typedef struct _ze_command_list_dditable_t ze_pfnCommandListAppendMemoryCopyWithParameters_t pfnAppendMemoryCopyWithParameters; ze_pfnCommandListAppendMemoryFillWithParameters_t pfnAppendMemoryFillWithParameters; ze_pfnCommandListImmediateAppendCommandListsWithParameters_t pfnImmediateAppendCommandListsWithParameters; + ze_pfnCommandListGetFlags_t pfnGetFlags; + ze_pfnCommandListImmediateGetFlags_t pfnImmediateGetFlags; + ze_pfnCommandListImmediateGetMode_t pfnImmediateGetMode; + ze_pfnCommandListImmediateGetPriority_t pfnImmediateGetPriority; + ze_pfnCommandListBeginGraphCaptureExt_t pfnBeginGraphCaptureExt; + ze_pfnCommandListBeginCaptureIntoGraphExt_t pfnBeginCaptureIntoGraphExt; + ze_pfnCommandListIsGraphCaptureEnabledExt_t pfnIsGraphCaptureEnabledExt; + ze_pfnCommandListEndGraphCaptureExt_t pfnEndGraphCaptureExt; + ze_pfnCommandListGetGraphExt_t pfnGetGraphExt; + ze_pfnCommandListAppendGraphExt_t pfnAppendGraphExt; + ze_pfnCommandListAppendHostFunction_t pfnAppendHostFunction; } ze_command_list_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1515,6 +1775,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandKernelsExp ze_kernel_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListIsMutableExp +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListIsMutableExp_t)( + ze_command_list_handle_t, + ze_bool_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandListExp functions pointers typedef struct _ze_command_list_exp_dditable_t @@ -1527,6 +1794,7 @@ typedef struct _ze_command_list_exp_dditable_t ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp; ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp; ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp; + ze_pfnCommandListIsMutableExp_t pfnIsMutableExp; } ze_command_list_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2181,6 +2449,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnEventCounterBasedGetDeviceAddress_t)( uint64_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeEventGetCounterBasedFlags +typedef ze_result_t (ZE_APICALL *ze_pfnEventGetCounterBasedFlags_t)( + ze_event_handle_t, + ze_event_counter_based_flags_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Event functions pointers typedef struct _ze_event_dditable_t @@ -2201,6 +2476,7 @@ typedef struct _ze_event_dditable_t ze_pfnEventCounterBasedOpenIpcHandle_t pfnCounterBasedOpenIpcHandle; ze_pfnEventCounterBasedCloseIpcHandle_t pfnCounterBasedCloseIpcHandle; ze_pfnEventCounterBasedGetDeviceAddress_t pfnCounterBasedGetDeviceAddress; + ze_pfnEventGetCounterBasedFlags_t pfnGetCounterBasedFlags; } ze_event_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2940,7 +3216,9 @@ typedef struct _ze_dditable_t ze_rtas_builder_exp_dditable_t RTASBuilderExp; ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; + ze_graph_dditable_t Graph; ze_global_dditable_t Global; + ze_executable_graph_dditable_t ExecutableGraph; ze_driver_dditable_t Driver; ze_driver_exp_dditable_t DriverExp; ze_device_dditable_t Device; @@ -2976,7 +3254,9 @@ typedef struct _ze_dditable_driver_t ze_rtas_builder_exp_dditable_t * RTASBuilderExp; ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; + ze_graph_dditable_t * Graph; ze_global_dditable_t * Global; + ze_executable_graph_dditable_t * ExecutableGraph; ze_driver_dditable_t * Driver; ze_driver_exp_dditable_t * DriverExp; ze_device_dditable_t * Device; diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index 9ad89691..a73ba6db 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zer.py b/include/zer.py index 3ac7396a..b983b735 100644 --- a/include/zer.py +++ b/include/zer.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zer.py - @version v1.16-r1.16.24 + @version v1.17-r1.17.23 """ import platform diff --git a/include/zer_api.h b/include/zer_api.h index 2db3de35..6bacda3e 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZER_API_H diff --git a/include/zer_ddi.h b/include/zer_ddi.h index 094bdb5f..3828f3b7 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZER_DDI_H diff --git a/include/zes.py b/include/zes.py index d46221da..99354236 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.16-r1.16.24 + @version v1.17-r1.17.23 """ import platform @@ -174,6 +174,8 @@ class zes_structure_type_v(IntEnum): PCI_LINK_SPEED_DOWNGRADE_EXT_PROPERTIES = 0x00020014 ## ::zes_pci_link_speed_downgrade_ext_properties_t RAS_STATE_EXP2 = 0x00020015 ## ::zes_ras_state_exp2_t 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 class zes_structure_type_t(c_int): def __str__(self): @@ -307,7 +309,8 @@ def __str__(self): ############################################################################### -## @brief Device state +## @brief Device state. To retrieve the current device state, please use +## ::zes_device_ext_state_t as pNext. class zes_device_state_t(Structure): _fields_ = [ ("stype", zes_structure_type_t), ## [in] type of this structure @@ -365,7 +368,10 @@ def __str__(self): ############################################################################### -## @brief Device properties +## @brief Device properties. To get OEM Serial ID, pNext member of this +## structure should point to an instance of +## ${s}_oem_serial_id_ext_properties_t with its stype set to +## ::ZES_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. class zes_device_properties_t(Structure): _fields_ = [ ("stype", zes_structure_type_t), ## [in] type of this structure @@ -1553,6 +1559,13 @@ class zes_mem_type_v(IntEnum): GDDR6X = 18 ## GDDR6X memory GDDR7 = 19 ## GDDR7 memory LPDDR5X = 20 ## LPDDR5X memory + HBM2 = 21 ## HBM2 memory + DDR2 = 22 ## DDR2 memory + HBM2E = 23 ## HBM2E memory + HBM3 = 24 ## HBM3 memory + HBM3E = 25 ## HBM3E memory + HBM4 = 26 ## HBM4 memory + LPDDR6 = 27 ## LPDDR6 memory class zes_mem_type_t(c_int): def __str__(self): @@ -2228,6 +2241,86 @@ class zes_pci_link_speed_downgrade_ext_properties_t(Structure): ## indicates the information is not available ] +############################################################################### +## @brief Device State Extension Name +ZES_DEVICE_EXT_STATE_NAME = "ZES_extension_device_state" + +############################################################################### +## @brief Device State Extension Version(s) +class zes_device_ext_state_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_ext_state_version_t(c_int): + def __str__(self): + return str(zes_device_ext_state_version_v(self.value)) + + +############################################################################### +## @brief Device state flags +class zes_device_state_ext_flags_v(IntEnum): + NORMAL = ZE_BIT(0) ## The device is operating normally + 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 + +class zes_device_state_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief 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 +class zes_device_ext_state_t(Structure): + _fields_ = [ + ("stype", zes_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). + ("flags", zes_device_state_ext_flags_t) ## [out] Device state flags. Returns 0 (if state cannot be determined) or + ## a combination of ::zes_device_state_ext_flags_t + ] + +############################################################################### +## @brief OEM Serial ID Extension Name +ZES_OEM_SERIAL_ID_EXT_NAME = "ZES_extension_oem_serial_id" + +############################################################################### +## @brief OEM Serial ID Extension Version(s) +class zes_oem_serial_id_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_oem_serial_id_ext_version_t(c_int): + def __str__(self): + return str(zes_oem_serial_id_ext_version_v(self.value)) + + +############################################################################### +## @brief Maximum OEM serial ID string size +ZES_OEM_SERIAL_ID_SIZE = 1024 + +############################################################################### +## @brief OEM Serial ID Properties structure +## +## @details +## - This structure can be passed as an extension structure to +## ::zesDeviceGetProperties via pNext member +## - Returns the OEM serial ID of the device +class zes_oem_serial_id_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). + ("length", c_ushort), ## [out] OEM serial ID length + ("oemSerialId", c_char * ZES_OEM_SERIAL_ID_SIZE) ## [out] OEM serial ID for the device. + ] + ############################################################################### ## @brief Power Limits Extension Name ZES_POWER_LIMITS_EXT_NAME = "ZES_extension_power_limits" diff --git a/include/zes_api.h b/include/zes_api.h index 414e37cb..e93a359b 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZES_API_H @@ -167,6 +167,8 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_PCI_LINK_SPEED_DOWNGRADE_EXT_PROPERTIES = 0x00020014,///< ::zes_pci_link_speed_downgrade_ext_properties_t ZES_STRUCTURE_TYPE_RAS_STATE_EXP2 = 0x00020015, ///< ::zes_ras_state_exp2_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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -525,6 +527,14 @@ typedef struct _zes_pci_link_speed_downgrade_ext_state_t zes_pci_link_speed_down /// @brief Forward-declare zes_pci_link_speed_downgrade_ext_properties_t typedef struct _zes_pci_link_speed_downgrade_ext_properties_t zes_pci_link_speed_downgrade_ext_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_device_ext_state_t +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_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -898,7 +908,8 @@ typedef enum _zes_reset_type_t } zes_reset_type_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device state +/// @brief Device state. To retrieve the current device state, please use +/// ::zes_device_ext_state_t as pNext. typedef struct _zes_device_state_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -958,7 +969,10 @@ typedef enum _zes_device_property_flag_t } zes_device_property_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device properties +/// @brief Device properties. To get OEM Serial ID, pNext member of this +/// structure should point to an instance of +/// ${s}_oem_serial_id_ext_properties_t with its stype set to +/// ::ZES_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. typedef struct _zes_device_properties_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -5203,6 +5217,13 @@ typedef enum _zes_mem_type_t ZES_MEM_TYPE_GDDR6X = 18, ///< GDDR6X memory ZES_MEM_TYPE_GDDR7 = 19, ///< GDDR7 memory ZES_MEM_TYPE_LPDDR5X = 20, ///< LPDDR5X memory + ZES_MEM_TYPE_HBM2 = 21, ///< HBM2 memory + ZES_MEM_TYPE_DDR2 = 22, ///< DDR2 memory + ZES_MEM_TYPE_HBM2E = 23, ///< HBM2E memory + ZES_MEM_TYPE_HBM3 = 24, ///< HBM3 memory + ZES_MEM_TYPE_HBM3E = 25, ///< HBM3E memory + ZES_MEM_TYPE_HBM4 = 26, ///< HBM4 memory + ZES_MEM_TYPE_LPDDR6 = 27, ///< LPDDR6 memory ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_MEM_TYPE_* ENUMs } zes_mem_type_t; @@ -7568,6 +7589,106 @@ zesDevicePciLinkSpeedUpdateExt( zes_device_action_t* pendingAction ///< [out] Pending action ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Device State +#if !defined(__GNUC__) +#pragma region deviceState +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_EXT_STATE_NAME +/// @brief Device State Extension Name +#define ZES_DEVICE_EXT_STATE_NAME "ZES_extension_device_state" +#endif // ZES_DEVICE_EXT_STATE_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device State Extension Version(s) +typedef enum _zes_device_ext_state_version_t +{ + ZES_DEVICE_EXT_STATE_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_DEVICE_EXT_STATE_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_DEVICE_EXT_STATE_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_EXT_STATE_VERSION_* ENUMs + +} zes_device_ext_state_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device state flags +typedef uint32_t zes_device_state_ext_flags_t; +typedef enum _zes_device_state_ext_flag_t +{ + ZES_DEVICE_STATE_EXT_FLAG_NORMAL = ZE_BIT(0), ///< The device is operating normally + 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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_STATE_EXT_FLAG_* ENUMs + +} zes_device_state_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 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 +typedef struct _zes_device_ext_state_t +{ + zes_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). + zes_device_state_ext_flags_t flags; ///< [out] Device state flags. Returns 0 (if state cannot be determined) or + ///< a combination of ::zes_device_state_ext_flags_t + +} zes_device_ext_state_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for OEM Serial ID +#if !defined(__GNUC__) +#pragma region oemSerialId +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_OEM_SERIAL_ID_EXT_NAME +/// @brief OEM Serial ID Extension Name +#define ZES_OEM_SERIAL_ID_EXT_NAME "ZES_extension_oem_serial_id" +#endif // ZES_OEM_SERIAL_ID_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief OEM Serial ID Extension Version(s) +typedef enum _zes_oem_serial_id_ext_version_t +{ + ZES_OEM_SERIAL_ID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_OEM_SERIAL_ID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_OEM_SERIAL_ID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_OEM_SERIAL_ID_EXT_VERSION_* ENUMs + +} zes_oem_serial_id_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_OEM_SERIAL_ID_SIZE +/// @brief Maximum OEM serial ID string size +#define ZES_OEM_SERIAL_ID_SIZE 1024 +#endif // ZES_OEM_SERIAL_ID_SIZE + +/////////////////////////////////////////////////////////////////////////////// +/// @brief OEM Serial ID Properties structure +/// +/// @details +/// - This structure can be passed as an extension structure to +/// ::zesDeviceGetProperties via pNext member +/// - Returns the OEM serial ID of the device +typedef struct _zes_oem_serial_id_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). + uint16_t length; ///< [out] OEM serial ID length + char oemSerialId[ZES_OEM_SERIAL_ID_SIZE]; ///< [out] OEM serial ID for the device. + +} zes_oem_serial_id_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/zes_ddi.h b/include/zes_ddi.h index e39829b4..70ce6894 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZES_DDI_H diff --git a/include/zet.py b/include/zet.py index baeba825..c68a9e2d 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.16-r1.16.24 + @version v1.17-r1.17.23 """ import platform @@ -810,7 +810,10 @@ class zet_metric_global_timestamps_resolution_exp_t(Structure): ## structure (i.e. contains stype and pNext). ("timerResolution", c_ulonglong), ## [out] Returns the resolution of metrics timer (used for timestamps) in ## cycles/sec. - ("timestampValidBits", c_ulonglong) ## [out] Returns the number of valid bits in the timestamp value. + ("timestampValidBits", c_ulonglong) ## [out] Returns the number of valid bits in the timestamp value. (i.e + ## can be used to calculate the max value of the hardware timestamp + ## register or can be use to generate the mask of valid bits in the + ## timestamp value) ] ############################################################################### diff --git a/include/zet_api.h b/include/zet_api.h index f46d0c64..983b7117 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZET_API_H @@ -3037,18 +3037,19 @@ typedef struct _zet_metric_global_timestamps_resolution_exp_t ///< structure (i.e. contains stype and pNext). uint64_t timerResolution; ///< [out] Returns the resolution of metrics timer (used for timestamps) in ///< cycles/sec. - uint64_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. + uint64_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. (i.e + ///< can be used to calculate the max value of the hardware timestamp + ///< register or can be use to generate the mask of valid bits in the + ///< timestamp value) } zet_metric_global_timestamps_resolution_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns metric timestamps synchronized with global device timestamps, -/// optionally synchronized with host +/// @brief Returns metric timestamps synchronized with either host or device +/// timestamps at the time of invoking the function /// /// @details /// - The application may call this function from simultaneous threads. -/// - By default, the global and metrics timestamps are synchronized to the -/// device. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3072,9 +3073,11 @@ typedef struct _zet_metric_global_timestamps_resolution_exp_t ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ); #if !defined(__GNUC__) diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 79e50df1..05be52d4 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.16-r1.16.24 + * @version v1.17-r1.17.23 * */ #ifndef _ZET_DDI_H diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index 4bcca4e6..d3691b75 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -803,10 +803,15 @@ namespace driver __zedlllocal ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -881,6 +886,35 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCounterBasedEventMaxValue + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based 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 pfnGetCounterBasedEventMaxValue = context.zeDdiTable.Device.pfnGetCounterBasedEventMaxValue; + if( nullptr != pfnGetCounterBasedEventMaxValue ) + { + result = pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeDeviceGetCounterBasedEventMaxValue", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceGetRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL @@ -1266,6 +1300,87 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + 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 pfnGetFlags = context.zeDdiTable.CommandQueue.pfnGetFlags; + if( nullptr != pfnGetFlags ) + { + result = pfnGetFlags( hCmdQueue, pFlags ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandQueueGetFlags", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + 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 pfnGetMode = context.zeDdiTable.CommandQueue.pfnGetMode; + if( nullptr != pfnGetMode ) + { + result = pfnGetMode( hCmdQueue, pMode ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandQueueGetMode", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + 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 pfnGetPriority = context.zeDdiTable.CommandQueue.pfnGetPriority; + if( nullptr != pfnGetPriority ) + { + result = pfnGetPriority( hCmdQueue, pPriority ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandQueueGetPriority", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListCreate __zedlllocal ze_result_t ZE_APICALL @@ -1614,6 +1729,114 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + 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 pfnGetFlags = context.zeDdiTable.CommandList.pfnGetFlags; + if( nullptr != pfnGetFlags ) + { + result = pfnGetFlags( hCommandList, pFlags ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListGetFlags", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + 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 pfnImmediateGetFlags = context.zeDdiTable.CommandList.pfnImmediateGetFlags; + if( nullptr != pfnImmediateGetFlags ) + { + result = pfnImmediateGetFlags( hCommandList, pFlags ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateGetFlags", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + 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 pfnImmediateGetMode = context.zeDdiTable.CommandList.pfnImmediateGetMode; + if( nullptr != pfnImmediateGetMode ) + { + result = pfnImmediateGetMode( hCommandList, pMode ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateGetMode", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + 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 pfnImmediateGetPriority = context.zeDdiTable.CommandList.pfnImmediateGetPriority; + if( nullptr != pfnImmediateGetPriority ) + { + result = pfnImmediateGetPriority( hCommandList, pPriority ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateGetPriority", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendBarrier __zedlllocal ze_result_t ZE_APICALL @@ -2898,6 +3121,34 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetCounterBasedFlags + __zedlllocal ze_result_t ZE_APICALL + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + 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 pfnGetCounterBasedFlags = context.zeDdiTable.Event.pfnGetCounterBasedFlags; + if( nullptr != pfnGetCounterBasedFlags ) + { + result = pfnGetCounterBasedFlags( hEvent, pFlags ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeEventGetCounterBasedFlags", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeFenceCreate __zedlllocal ze_result_t ZE_APICALL @@ -5448,203 +5699,676 @@ namespace driver } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { 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 pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; - if( nullptr != pfnReserveCacheExt ) + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; + if( nullptr != pfnCreateExt ) { - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnCreateExt( hContext, pNext, phGraph ); } else { // generic implementation + *phGraph = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeDeviceReserveCacheExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphCreateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; - if( nullptr != pfnSetCacheAdviceExt ) + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; + if( nullptr != pfnBeginGraphCaptureExt ) { - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDeviceSetCacheAdviceExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginGraphCaptureExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; - if( nullptr != pfnQueryTimestampsExp ) + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr != pfnBeginCaptureIntoGraphExt ) { - result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeEventQueryTimestampsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginCaptureIntoGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { 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 pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr != pfnGetMemoryPropertiesExp ) + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr != pfnIsGraphCaptureEnabledExt ) { - result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + result = pfnIsGraphCaptureEnabledExt( hCommandList ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeImageGetMemoryPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListIsGraphCaptureEnabledExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { 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 pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; - if( nullptr != pfnViewCreateExt ) + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; + if( nullptr != pfnEndGraphCaptureExt ) { - result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); } else { // generic implementation - *phImageView = reinterpret_cast( context.get() ); + *phGraph = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListEndGraphCaptureExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { 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 pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; - if( nullptr != pfnViewCreateExp ) + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; + if( nullptr != pfnGetGraphExt ) { - result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + result = pfnGetGraphExt( hCommandList, phGraph ); } else { // generic implementation - *phImageView = reinterpret_cast( context.get() ); + *phGraph = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListGetGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { 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 pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; + if( nullptr != pfnGetPrimaryCommandListExt ) + { + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + } + else + { + // generic implementation + *phCommandList = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphGetPrimaryCommandListExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphSetDestructionCallbackExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + 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 pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; + if( nullptr != pfnSetDestructionCallbackExt ) + { + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphSetDestructionCallbackExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphInstantiateExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + 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 pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; + if( nullptr != pfnInstantiateExt ) + { + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + } + else + { + // generic implementation + *phExecutableGraph = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphInstantiateExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + 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 pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; + if( nullptr != pfnAppendGraphExt ) + { + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendGraphExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + 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 pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr != pfnGetSourceGraphExt ) + { + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + } + else + { + // generic implementation + *phSourceGraph = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphGetSourceGraphExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphIsEmptyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + 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 pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; + if( nullptr != pfnIsEmptyExt ) + { + result = pfnIsEmptyExt( hGraph ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphIsEmptyExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDumpContentsExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + 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 pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; + if( nullptr != pfnDumpContentsExt ) + { + result = pfnDumpContentsExt( hGraph, filePath, pNext ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphDumpContentsExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + 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 pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hGraph ); + } + else + { + // generic implementation + + } + + char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphDestroyExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + 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 pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hGraph ); + } + else + { + // generic implementation + + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphDestroyExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendHostFunction + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + 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 pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; + if( nullptr != pfnAppendHostFunction ) + { + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendHostFunction", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceReserveCacheExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ) + { + 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 pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + if( nullptr != pfnReserveCacheExt ) + { + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeDeviceReserveCacheExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceSetCacheAdviceExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ) + { + 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 pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + if( nullptr != pfnSetCacheAdviceExt ) + { + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeDeviceSetCacheAdviceExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventQueryTimestampsExp + __zedlllocal ze_result_t ZE_APICALL + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. + ) + { + 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 pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; + if( nullptr != pfnQueryTimestampsExp ) + { + result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeEventQueryTimestampsExp", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetMemoryPropertiesExp + __zedlllocal ze_result_t ZE_APICALL + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ) + { + 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 pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr != pfnGetMemoryPropertiesExp ) + { + result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeImageGetMemoryPropertiesExp", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageViewCreateExt + __zedlllocal ze_result_t ZE_APICALL + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ) + { + 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 pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; + if( nullptr != pfnViewCreateExt ) + { + result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + } + else + { + // generic implementation + *phImageView = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageViewCreateExp + __zedlllocal ze_result_t ZE_APICALL + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ) + { + 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 pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; + if( nullptr != pfnViewCreateExp ) + { + result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + } + else + { + // generic implementation + *phImageView = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExp", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSchedulingHintExp + __zedlllocal ze_result_t ZE_APICALL + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ) + { + 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 pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; if( nullptr != pfnSchedulingHintExp ) { result = pfnSchedulingHintExp( hKernel, pHint ); @@ -6663,6 +7387,34 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsMutableExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + 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 pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + if( nullptr != pfnIsMutableExp ) + { + result = pfnIsMutableExp( hCommandList, pIsMutable ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListIsMutableExp", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL @@ -6794,6 +7546,92 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetSourceGraphExt = driver::zeExecutableGraphGetSourceGraphExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = driver::zeExecutableGraphDestroyExt; + } + + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnCreateExt = driver::zeGraphCreateExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPrimaryCommandListExt = driver::zeGraphGetPrimaryCommandListExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnSetDestructionCallbackExt = driver::zeGraphSetDestructionCallbackExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnInstantiateExt = driver::zeGraphInstantiateExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsEmptyExt = driver::zeGraphIsEmptyExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDumpContentsExt = driver::zeGraphDumpContentsExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = driver::zeGraphDestroyExt; + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -7166,6 +8004,10 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnValidateRuntimeRequirements = driver::zeDeviceValidateRuntimeRequirements; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetCounterBasedEventMaxValue = driver::zeDeviceGetCounterBasedEventMaxValue; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; } @@ -7313,6 +8155,18 @@ zeGetCommandQueueProcAddrTable( pDdiTable->pfnSynchronize = driver::zeCommandQueueSynchronize; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetFlags = driver::zeCommandQueueGetFlags; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetMode = driver::zeCommandQueueGetMode; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPriority = driver::zeCommandQueueGetPriority; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = driver::zeCommandQueueGetOrdinal; } @@ -7478,6 +8332,50 @@ zeGetCommandListProcAddrTable( pDdiTable->pfnImmediateAppendCommandListsWithParameters = driver::zeCommandListImmediateAppendCommandListsWithParameters; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetFlags = driver::zeCommandListGetFlags; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetFlags = driver::zeCommandListImmediateGetFlags; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetMode = driver::zeCommandListImmediateGetMode; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetPriority = driver::zeCommandListImmediateGetPriority; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnBeginGraphCaptureExt = driver::zeCommandListBeginGraphCaptureExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnBeginCaptureIntoGraphExt = driver::zeCommandListBeginCaptureIntoGraphExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsGraphCaptureEnabledExt = driver::zeCommandListIsGraphCaptureEnabledExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnEndGraphCaptureExt = driver::zeCommandListEndGraphCaptureExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetGraphExt = driver::zeCommandListGetGraphExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnAppendGraphExt = driver::zeCommandListAppendGraphExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnAppendHostFunction = driver::zeCommandListAppendHostFunction; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyToMemoryExt = driver::zeCommandListAppendImageCopyToMemoryExt; } @@ -7543,6 +8441,10 @@ zeGetCommandListExpProcAddrTable( pDdiTable->pfnUpdateMutableCommandKernelsExp = driver::zeCommandListUpdateMutableCommandKernelsExp; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsMutableExp = driver::zeCommandListIsMutableExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCreateCloneExp = driver::zeCommandListCreateCloneExp; } @@ -7640,6 +8542,10 @@ zeGetEventProcAddrTable( pDdiTable->pfnCounterBasedGetDeviceAddress = driver::zeEventCounterBasedGetDeviceAddress; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetCounterBasedFlags = driver::zeEventGetCounterBasedFlags; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnQueryKernelTimestampsExt = driver::zeEventQueryKernelTimestampsExt; } diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index 210d9ef2..c42b5a16 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -1687,9 +1687,11 @@ namespace driver __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index f2ad8d91..85ea3f4c 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -26,6 +26,27 @@ typedef struct _zel_ze_global_callbacks_t ze_pfnInitDriversCb_t pfnInitDriversCb; } zel_ze_global_callbacks_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of ExecutableGraph callback functions pointers +typedef struct _zel_ze_executable_graph_callbacks_t +{ + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb; + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb; +} zel_ze_executable_graph_callbacks_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of Graph callback functions pointers +typedef struct _zel_ze_graph_callbacks_t +{ + ze_pfnGraphCreateExtCb_t pfnCreateExtCb; + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb; + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb; + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb; + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb; + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb; + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb; +} zel_ze_graph_callbacks_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of RTASBuilder callback functions pointers typedef struct _zel_ze_rtas_builder_callbacks_t @@ -98,6 +119,7 @@ typedef struct _zel_ze_device_callbacks_t ze_pfnDeviceGetRuntimeRequirementsCb_t pfnGetRuntimeRequirementsCb; ze_pfnDeviceGetRuntimeRequirementsKeyCb_t pfnGetRuntimeRequirementsKeyCb; ze_pfnDeviceValidateRuntimeRequirementsCb_t pfnValidateRuntimeRequirementsCb; + ze_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb; ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb; ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb; ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb; @@ -128,6 +150,9 @@ typedef struct _zel_ze_command_queue_callbacks_t ze_pfnCommandQueueDestroyCb_t pfnDestroyCb; ze_pfnCommandQueueExecuteCommandListsCb_t pfnExecuteCommandListsCb; ze_pfnCommandQueueSynchronizeCb_t pfnSynchronizeCb; + ze_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb; + ze_pfnCommandQueueGetModeCb_t pfnGetModeCb; + ze_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb; ze_pfnCommandQueueGetOrdinalCb_t pfnGetOrdinalCb; ze_pfnCommandQueueGetIndexCb_t pfnGetIndexCb; } zel_ze_command_queue_callbacks_t; @@ -171,6 +196,18 @@ typedef struct _zel_ze_command_list_callbacks_t ze_pfnCommandListAppendMemoryCopyWithParametersCb_t pfnAppendMemoryCopyWithParametersCb; ze_pfnCommandListAppendMemoryFillWithParametersCb_t pfnAppendMemoryFillWithParametersCb; ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb; + ze_pfnCommandListGetFlagsCb_t pfnGetFlagsCb; + ze_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb; + ze_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb; + ze_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb; + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb; + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb; + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb; + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb; + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb; + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb; + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb; + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb; ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb; ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb; ze_pfnCommandListHostSynchronizeCb_t pfnHostSynchronizeCb; @@ -203,6 +240,7 @@ typedef struct _zel_ze_event_callbacks_t ze_pfnEventCounterBasedOpenIpcHandleCb_t pfnCounterBasedOpenIpcHandleCb; ze_pfnEventCounterBasedCloseIpcHandleCb_t pfnCounterBasedCloseIpcHandleCb; ze_pfnEventCounterBasedGetDeviceAddressCb_t pfnCounterBasedGetDeviceAddressCb; + ze_pfnEventGetCounterBasedFlagsCb_t pfnGetCounterBasedFlagsCb; ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb; ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb; ze_pfnEventGetEventPoolCb_t pfnGetEventPoolCb; @@ -371,6 +409,8 @@ typedef struct _zel_ze_fabric_vertex_callbacks_t typedef struct _zel_ze_all_callbacks_t { zel_ze_global_callbacks_t Global; + zel_ze_executable_graph_callbacks_t ExecutableGraph; + zel_ze_graph_callbacks_t Graph; zel_ze_rtas_builder_callbacks_t RTASBuilder; zel_ze_rtas_parallel_operation_callbacks_t RTASParallelOperation; zel_ze_driver_callbacks_t Driver; diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index b39cadfb..80c4c402 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -467,6 +467,22 @@ zelTracerDeviceGetAggregatedCopyOffloadIncrementValueRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCounterBasedEventMaxValueRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Device.pfnGetCounterBasedEventMaxValueCb = pfnGetCounterBasedEventMaxValueCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerDeviceGetRuntimeRequirementsRegisterCallback( zel_tracer_handle_t hTracer, @@ -675,6 +691,54 @@ zelTracerCommandQueueGetIndexRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandQueue.pfnGetFlagsCb = pfnGetFlagsCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetModeCb_t pfnGetModeCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandQueue.pfnGetModeCb = pfnGetModeCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandQueue.pfnGetPriorityCb = pfnGetPriorityCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -867,6 +931,70 @@ zelTracerCommandListIsImmediateRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetFlagsCb_t pfnGetFlagsCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnGetFlagsCb = pfnGetFlagsCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnImmediateGetFlagsCb = pfnImmediateGetFlagsCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnImmediateGetModeCb = pfnImmediateGetModeCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnImmediateGetPriorityCb = pfnImmediateGetPriorityCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendBarrierRegisterCallback( zel_tracer_handle_t hTracer, @@ -1539,6 +1667,22 @@ zelTracerEventPoolGetFlagsRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerEventGetCounterBasedFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnEventGetCounterBasedFlagsCb_t pfnGetCounterBasedFlagsCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Event.pfnGetCounterBasedFlagsCb = pfnGetCounterBasedFlagsCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerFenceCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -2899,6 +3043,262 @@ zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnCreateExtCb = pfnCreateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnBeginGraphCaptureExtCb = pfnBeginGraphCaptureExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnBeginCaptureIntoGraphExtCb = pfnBeginCaptureIntoGraphExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnIsGraphCaptureEnabledExtCb = pfnIsGraphCaptureEnabledExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListEndGraphCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnEndGraphCaptureExtCb = pfnEndGraphCaptureExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnGetGraphExtCb = pfnGetGraphExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnGetPrimaryCommandListExtCb = pfnGetPrimaryCommandListExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphSetDestructionCallbackExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnSetDestructionCallbackExtCb = pfnSetDestructionCallbackExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphInstantiateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnInstantiateExtCb = pfnInstantiateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnAppendGraphExtCb = pfnAppendGraphExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.ExecutableGraph.pfnGetSourceGraphExtCb = pfnGetSourceGraphExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphIsEmptyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnIsEmptyExtCb = pfnIsEmptyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphDumpContentsExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnDumpContentsExtCb = pfnDumpContentsExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerExecutableGraphDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.ExecutableGraph.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendHostFunctionRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnAppendHostFunctionCb = pfnAppendHostFunctionCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, @@ -3523,6 +3923,22 @@ zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListIsMutableExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnIsMutableExpCb = pfnIsMutableExpCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index e0e60ae6..e145e560 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -977,10 +977,15 @@ namespace tracing_layer __zedlllocal ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { auto pfnGetGlobalTimestamps = context.zeDdiTable.Device.pfnGetGlobalTimestamps; @@ -1079,6 +1084,43 @@ namespace tracing_layer *tracerParams.pincrementValue); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCounterBasedEventMaxValue + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ) + { + auto pfnGetCounterBasedEventMaxValue = context.zeDdiTable.Device.pfnGetCounterBasedEventMaxValue; + + if( nullptr == pfnGetCounterBasedEventMaxValue) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetCounterBasedEventMaxValue, hDevice, maxValue); + + // capture parameters + ze_device_get_counter_based_event_max_value_params_t tracerParams = { + &hDevice, + &maxValue + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetCounterBasedEventMaxValueCb_t, Device, pfnGetCounterBasedEventMaxValueCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetCounterBasedEventMaxValue, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.pmaxValue); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceGetRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL @@ -1576,6 +1618,111 @@ namespace tracing_layer *tracerParams.ppIndex); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + auto pfnGetFlags = context.zeDdiTable.CommandQueue.pfnGetFlags; + + if( nullptr == pfnGetFlags) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandQueue.pfnGetFlags, hCmdQueue, pFlags); + + // capture parameters + ze_command_queue_get_flags_params_t tracerParams = { + &hCmdQueue, + &pFlags + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandQueueGetFlagsCb_t, CommandQueue, pfnGetFlagsCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandQueue.pfnGetFlags, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCmdQueue, + *tracerParams.ppFlags); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + auto pfnGetMode = context.zeDdiTable.CommandQueue.pfnGetMode; + + if( nullptr == pfnGetMode) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandQueue.pfnGetMode, hCmdQueue, pMode); + + // capture parameters + ze_command_queue_get_mode_params_t tracerParams = { + &hCmdQueue, + &pMode + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandQueueGetModeCb_t, CommandQueue, pfnGetModeCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandQueue.pfnGetMode, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCmdQueue, + *tracerParams.ppMode); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + auto pfnGetPriority = context.zeDdiTable.CommandQueue.pfnGetPriority; + + if( nullptr == pfnGetPriority) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandQueue.pfnGetPriority, hCmdQueue, pPriority); + + // capture parameters + ze_command_queue_get_priority_params_t tracerParams = { + &hCmdQueue, + &pPriority + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandQueueGetPriorityCb_t, CommandQueue, pfnGetPriorityCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandQueue.pfnGetPriority, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCmdQueue, + *tracerParams.ppPriority); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListCreate __zedlllocal ze_result_t ZE_APICALL @@ -2019,6 +2166,146 @@ namespace tracing_layer *tracerParams.ppIsImmediate); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + auto pfnGetFlags = context.zeDdiTable.CommandList.pfnGetFlags; + + if( nullptr == pfnGetFlags) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnGetFlags, hCommandList, pFlags); + + // capture parameters + ze_command_list_get_flags_params_t tracerParams = { + &hCommandList, + &pFlags + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetFlagsCb_t, CommandList, pfnGetFlagsCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnGetFlags, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppFlags); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + auto pfnImmediateGetFlags = context.zeDdiTable.CommandList.pfnImmediateGetFlags; + + if( nullptr == pfnImmediateGetFlags) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnImmediateGetFlags, hCommandList, pFlags); + + // capture parameters + ze_command_list_immediate_get_flags_params_t tracerParams = { + &hCommandList, + &pFlags + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateGetFlagsCb_t, CommandList, pfnImmediateGetFlagsCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnImmediateGetFlags, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppFlags); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + auto pfnImmediateGetMode = context.zeDdiTable.CommandList.pfnImmediateGetMode; + + if( nullptr == pfnImmediateGetMode) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnImmediateGetMode, hCommandList, pMode); + + // capture parameters + ze_command_list_immediate_get_mode_params_t tracerParams = { + &hCommandList, + &pMode + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateGetModeCb_t, CommandList, pfnImmediateGetModeCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnImmediateGetMode, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppMode); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + auto pfnImmediateGetPriority = context.zeDdiTable.CommandList.pfnImmediateGetPriority; + + if( nullptr == pfnImmediateGetPriority) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnImmediateGetPriority, hCommandList, pPriority); + + // capture parameters + ze_command_list_immediate_get_priority_params_t tracerParams = { + &hCommandList, + &pPriority + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateGetPriorityCb_t, CommandList, pfnImmediateGetPriorityCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnImmediateGetPriority, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppPriority); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendBarrier __zedlllocal ze_result_t ZE_APICALL @@ -3781,6 +4068,42 @@ namespace tracing_layer *tracerParams.ppFlags); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetCounterBasedFlags + __zedlllocal ze_result_t ZE_APICALL + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + auto pfnGetCounterBasedFlags = context.zeDdiTable.Event.pfnGetCounterBasedFlags; + + if( nullptr == pfnGetCounterBasedFlags) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Event.pfnGetCounterBasedFlags, hEvent, pFlags); + + // capture parameters + ze_event_get_counter_based_flags_params_t tracerParams = { + &hEvent, + &pFlags + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnEventGetCounterBasedFlagsCb_t, Event, pfnGetCounterBasedFlagsCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Event.pfnGetCounterBasedFlags, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phEvent, + *tracerParams.ppFlags); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeFenceCreate __zedlllocal ze_result_t ZE_APICALL @@ -7242,85 +7565,696 @@ namespace tracing_layer } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; - if( nullptr == pfnReserveCacheExt) + if( nullptr == pfnCreateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReserveCacheExt, hDevice, cacheLevel, cacheReservationSize); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnCreateExt, hContext, pNext, phGraph); // capture parameters - ze_device_reserve_cache_ext_params_t tracerParams = { - &hDevice, - &cacheLevel, - &cacheReservationSize + ze_graph_create_ext_params_t tracerParams = { + &hContext, + &pNext, + &phGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReserveCacheExtCb_t, Device, pfnReserveCacheExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphCreateExtCb_t, Graph, pfnCreateExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReserveCacheExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnCreateExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.pcacheLevel, - *tracerParams.pcacheReservationSize); + *tracerParams.phContext, + *tracerParams.ppNext, + *tracerParams.pphGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnSetCacheAdviceExt) + if( nullptr == pfnBeginGraphCaptureExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnSetCacheAdviceExt, hDevice, ptr, regionSize, cacheRegion); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, hCommandList, pNext); // capture parameters - ze_device_set_cache_advice_ext_params_t tracerParams = { - &hDevice, - &ptr, - ®ionSize, - &cacheRegion + ze_command_list_begin_graph_capture_ext_params_t tracerParams = { + &hCommandList, + &pNext }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceSetCacheAdviceExtCb_t, Device, pfnSetCacheAdviceExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginGraphCaptureExtCb_t, CommandList, pfnBeginGraphCaptureExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnSetCacheAdviceExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.pptr, - *tracerParams.pregionSize, - *tracerParams.pcacheRegion); + *tracerParams.phCommandList, + *tracerParams.ppNext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; + + if( nullptr == pfnBeginCaptureIntoGraphExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, hCommandList, hGraph, pNext); + + // capture parameters + ze_command_list_begin_capture_into_graph_ext_params_t tracerParams = { + &hCommandList, + &hGraph, + &pNext + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginCaptureIntoGraphExtCb_t, CommandList, pfnBeginCaptureIntoGraphExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.phGraph, + *tracerParams.ppNext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ) + { + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; + + if( nullptr == pfnIsGraphCaptureEnabledExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, hCommandList); + + // capture parameters + ze_command_list_is_graph_capture_enabled_ext_params_t tracerParams = { + &hCommandList + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsGraphCaptureEnabledExtCb_t, CommandList, pfnIsGraphCaptureEnabledExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListEndGraphCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ) + { + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; + + if( nullptr == pfnEndGraphCaptureExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, hCommandList, pNext, phGraph); + + // capture parameters + ze_command_list_end_graph_capture_ext_params_t tracerParams = { + &hCommandList, + &pNext, + &phGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListEndGraphCaptureExtCb_t, CommandList, pfnEndGraphCaptureExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppNext, + *tracerParams.pphGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ) + { + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; + + if( nullptr == pfnGetGraphExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnGetGraphExt, hCommandList, phGraph); + + // capture parameters + ze_command_list_get_graph_ext_params_t tracerParams = { + &hCommandList, + &phGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetGraphExtCb_t, CommandList, pfnGetGraphExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnGetGraphExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.pphGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ) + { + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; + + if( nullptr == pfnGetPrimaryCommandListExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, hGraph, phCommandList); + + // capture parameters + ze_graph_get_primary_command_list_ext_params_t tracerParams = { + &hGraph, + &phCommandList + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphGetPrimaryCommandListExtCb_t, Graph, pfnGetPrimaryCommandListExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.pphCommandList); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphSetDestructionCallbackExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; + + if( nullptr == pfnSetDestructionCallbackExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, hGraph, pfnCallback, pUserData, pNext); + + // capture parameters + ze_graph_set_destruction_callback_ext_params_t tracerParams = { + &hGraph, + &pfnCallback, + &pUserData, + &pNext + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphSetDestructionCallbackExtCb_t, Graph, pfnSetDestructionCallbackExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.ppfnCallback, + *tracerParams.ppUserData, + *tracerParams.ppNext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphInstantiateExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; + + if( nullptr == pfnInstantiateExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnInstantiateExt, hGraph, pNext, phExecutableGraph); + + // capture parameters + ze_graph_instantiate_ext_params_t tracerParams = { + &hGraph, + &pNext, + &phExecutableGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphInstantiateExtCb_t, Graph, pfnInstantiateExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnInstantiateExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.ppNext, + *tracerParams.pphExecutableGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; + + if( nullptr == pfnAppendGraphExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendGraphExt, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + + // capture parameters + ze_command_list_append_graph_ext_params_t tracerParams = { + &hCommandList, + &hGraph, + &pNext, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendGraphExtCb_t, CommandList, pfnAppendGraphExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendGraphExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.phGraph, + *tracerParams.ppNext, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; + + if( nullptr == pfnGetSourceGraphExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, hGraph, phSourceGraph); + + // capture parameters + ze_executable_graph_get_source_graph_ext_params_t tracerParams = { + &hGraph, + &phSourceGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphGetSourceGraphExtCb_t, ExecutableGraph, pfnGetSourceGraphExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.pphSourceGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphIsEmptyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; + + if( nullptr == pfnIsEmptyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnIsEmptyExt, hGraph); + + // capture parameters + ze_graph_is_empty_ext_params_t tracerParams = { + &hGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphIsEmptyExtCb_t, Graph, pfnIsEmptyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnIsEmptyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDumpContentsExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; + + if( nullptr == pfnDumpContentsExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDumpContentsExt, hGraph, filePath, pNext); + + // capture parameters + ze_graph_dump_contents_ext_params_t tracerParams = { + &hGraph, + &filePath, + &pNext + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDumpContentsExtCb_t, Graph, pfnDumpContentsExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDumpContentsExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.pfilePath, + *tracerParams.ppNext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, hGraph); + + // capture parameters + ze_executable_graph_destroy_ext_params_t tracerParams = { + &hGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphDestroyExtCb_t, ExecutableGraph, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDestroyExt, hGraph); + + // capture parameters + ze_graph_destroy_ext_params_t tracerParams = { + &hGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDestroyExtCb_t, Graph, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendHostFunction + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; + + if( nullptr == pfnAppendHostFunction) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendHostFunction, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + + // capture parameters + ze_command_list_append_host_function_params_t tracerParams = { + &hCommandList, + &pfnHostFunction, + &pUserData, + &pNext, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendHostFunctionCb_t, CommandList, pfnAppendHostFunctionCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendHostFunction, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppfnHostFunction, + *tracerParams.ppUserData, + *tracerParams.ppNext, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceReserveCacheExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ) + { + auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + + if( nullptr == pfnReserveCacheExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReserveCacheExt, hDevice, cacheLevel, cacheReservationSize); + + // capture parameters + ze_device_reserve_cache_ext_params_t tracerParams = { + &hDevice, + &cacheLevel, + &cacheReservationSize + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReserveCacheExtCb_t, Device, pfnReserveCacheExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReserveCacheExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.pcacheLevel, + *tracerParams.pcacheReservationSize); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceSetCacheAdviceExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ) + { + auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + + if( nullptr == pfnSetCacheAdviceExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnSetCacheAdviceExt, hDevice, ptr, regionSize, cacheRegion); + + // capture parameters + ze_device_set_cache_advice_ext_params_t tracerParams = { + &hDevice, + &ptr, + ®ionSize, + &cacheRegion + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceSetCacheAdviceExtCb_t, Device, pfnSetCacheAdviceExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnSetCacheAdviceExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.pptr, + *tracerParams.pregionSize, + *tracerParams.pcacheRegion); } /////////////////////////////////////////////////////////////////////////////// @@ -8860,6 +9794,42 @@ namespace tracing_layer *tracerParams.pdesc); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsMutableExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + + if( nullptr == pfnIsMutableExp) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnIsMutableExp, hCommandList, pIsMutable); + + // capture parameters + ze_command_list_is_mutable_exp_params_t tracerParams = { + &hCommandList, + &pIsMutable + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsMutableExpCb_t, CommandList, pfnIsMutableExpCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnIsMutableExp, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppIsMutable); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL @@ -9023,6 +9993,96 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.ExecutableGraph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (tracing_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; + pDdiTable->pfnGetSourceGraphExt = tracing_layer::zeExecutableGraphGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeExecutableGraphDestroyExt; + } + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.Graph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (tracing_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeGraphCreateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; + pDdiTable->pfnGetPrimaryCommandListExt = tracing_layer::zeGraphGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; + pDdiTable->pfnSetDestructionCallbackExt = tracing_layer::zeGraphSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; + pDdiTable->pfnInstantiateExt = tracing_layer::zeGraphInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; + pDdiTable->pfnIsEmptyExt = tracing_layer::zeGraphIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; + pDdiTable->pfnDumpContentsExt = tracing_layer::zeGraphDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeGraphDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -9409,6 +10469,10 @@ zeGetDeviceProcAddrTable( dditable.pfnValidateRuntimeRequirements = pDdiTable->pfnValidateRuntimeRequirements; pDdiTable->pfnValidateRuntimeRequirements = tracing_layer::zeDeviceValidateRuntimeRequirements; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetCounterBasedEventMaxValue = pDdiTable->pfnGetCounterBasedEventMaxValue; + pDdiTable->pfnGetCounterBasedEventMaxValue = tracing_layer::zeDeviceGetCounterBasedEventMaxValue; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; @@ -9562,6 +10626,18 @@ zeGetCommandQueueProcAddrTable( dditable.pfnSynchronize = pDdiTable->pfnSynchronize; pDdiTable->pfnSynchronize = tracing_layer::zeCommandQueueSynchronize; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = tracing_layer::zeCommandQueueGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetMode = pDdiTable->pfnGetMode; + pDdiTable->pfnGetMode = tracing_layer::zeCommandQueueGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPriority = pDdiTable->pfnGetPriority; + pDdiTable->pfnGetPriority = tracing_layer::zeCommandQueueGetPriority; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; @@ -9729,6 +10805,50 @@ zeGetCommandListProcAddrTable( dditable.pfnImmediateAppendCommandListsWithParameters = pDdiTable->pfnImmediateAppendCommandListsWithParameters; pDdiTable->pfnImmediateAppendCommandListsWithParameters = tracing_layer::zeCommandListImmediateAppendCommandListsWithParameters; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = tracing_layer::zeCommandListGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetFlags = pDdiTable->pfnImmediateGetFlags; + pDdiTable->pfnImmediateGetFlags = tracing_layer::zeCommandListImmediateGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetMode = pDdiTable->pfnImmediateGetMode; + pDdiTable->pfnImmediateGetMode = tracing_layer::zeCommandListImmediateGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetPriority = pDdiTable->pfnImmediateGetPriority; + pDdiTable->pfnImmediateGetPriority = tracing_layer::zeCommandListImmediateGetPriority; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnBeginGraphCaptureExt = pDdiTable->pfnBeginGraphCaptureExt; + pDdiTable->pfnBeginGraphCaptureExt = tracing_layer::zeCommandListBeginGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnBeginCaptureIntoGraphExt = pDdiTable->pfnBeginCaptureIntoGraphExt; + pDdiTable->pfnBeginCaptureIntoGraphExt = tracing_layer::zeCommandListBeginCaptureIntoGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsGraphCaptureEnabledExt = pDdiTable->pfnIsGraphCaptureEnabledExt; + pDdiTable->pfnIsGraphCaptureEnabledExt = tracing_layer::zeCommandListIsGraphCaptureEnabledExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnEndGraphCaptureExt = pDdiTable->pfnEndGraphCaptureExt; + pDdiTable->pfnEndGraphCaptureExt = tracing_layer::zeCommandListEndGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetGraphExt = pDdiTable->pfnGetGraphExt; + pDdiTable->pfnGetGraphExt = tracing_layer::zeCommandListGetGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnAppendGraphExt = pDdiTable->pfnAppendGraphExt; + pDdiTable->pfnAppendGraphExt = tracing_layer::zeCommandListAppendGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnAppendHostFunction = pDdiTable->pfnAppendHostFunction; + pDdiTable->pfnAppendHostFunction = tracing_layer::zeCommandListAppendHostFunction; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; @@ -9796,6 +10916,10 @@ zeGetCommandListExpProcAddrTable( dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; pDdiTable->pfnUpdateMutableCommandKernelsExp = tracing_layer::zeCommandListUpdateMutableCommandKernelsExp; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsMutableExp = pDdiTable->pfnIsMutableExp; + pDdiTable->pfnIsMutableExp = tracing_layer::zeCommandListIsMutableExp; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; pDdiTable->pfnCreateCloneExp = tracing_layer::zeCommandListCreateCloneExp; @@ -9895,6 +11019,10 @@ zeGetEventProcAddrTable( dditable.pfnCounterBasedGetDeviceAddress = pDdiTable->pfnCounterBasedGetDeviceAddress; pDdiTable->pfnCounterBasedGetDeviceAddress = tracing_layer::zeEventCounterBasedGetDeviceAddress; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetCounterBasedFlags = pDdiTable->pfnGetCounterBasedFlags; + pDdiTable->pfnGetCounterBasedFlags = tracing_layer::zeEventGetCounterBasedFlags; + } if (version >= ZE_API_VERSION_1_6) { dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; pDdiTable->pfnQueryKernelTimestampsExt = tracing_layer::zeEventQueryKernelTimestampsExt; diff --git a/source/layers/validation/checkers/certification/generated/ze_certification.h b/source/layers/validation/checkers/certification/generated/ze_certification.h index ba3a69ff..dfb4e197 100644 --- a/source/layers/validation/checkers/certification/generated/ze_certification.h +++ b/source/layers/validation/checkers/certification/generated/ze_certification.h @@ -183,6 +183,12 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeDeviceGetCounterBasedEventMaxValuePrologue( ze_device_handle_t hDevice, uint64_t* maxValue ) 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 zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const void* pObjDesc, size_t* pSize, char* pRequirements ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_16) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -261,6 +267,24 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandQueueGetFlagsPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_flags_t* pFlags ) 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 zeCommandQueueGetModePrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_mode_t* pMode ) 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 zeCommandQueueGetPriorityPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_priority_t* pPriority ) 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 zeCommandListCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t* desc, ze_command_list_handle_t* phCommandList ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -333,6 +357,30 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandListGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_list_flags_t* pFlags ) 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 zeCommandListImmediateGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_flags_t* pFlags ) 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 zeCommandListImmediateGetModePrologue( ze_command_list_handle_t hCommandList, ze_command_queue_mode_t* pMode ) 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 zeCommandListImmediateGetPriorityPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_priority_t* pPriority ) 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 zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, 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; @@ -585,6 +633,12 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeEventGetCounterBasedFlagsPrologue( ze_event_handle_t hEvent, ze_event_counter_based_flags_t* pFlags ) 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 zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t* desc, ze_fence_handle_t* phFence ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -1095,6 +1149,102 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) 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 zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) 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 zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) 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 zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) 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 zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) 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 zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) 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 zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) 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 zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) 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 zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) 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 zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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 zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) 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 zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) 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 zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) 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 zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) 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 zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -1329,6 +1479,12 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) 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 zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; 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 4642c90f..0f03e9ec 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -510,10 +510,15 @@ namespace validation_layer ze_result_t ZEParameterValidation::zeDeviceGetGlobalTimestampsPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { if( nullptr == hDevice ) @@ -557,6 +562,24 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeDeviceGetCounterBasedEventMaxValuePrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == maxValue ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device @@ -818,6 +841,54 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeCommandQueueGetFlagsPrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + if( nullptr == hCmdQueue ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pFlags ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandQueueGetModePrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + if( nullptr == hCmdQueue ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pMode ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandQueueGetPriorityPrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + if( nullptr == hCmdQueue ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pPriority ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListCreatePrologue( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -1040,6 +1111,70 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeCommandListGetFlagsPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pFlags ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListImmediateGetFlagsPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pFlags ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListImmediateGetModePrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pMode ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListImmediateGetPriorityPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pPriority ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -1190,6 +1325,9 @@ namespace validation_layer if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) return ZE_RESULT_ERROR_INVALID_SIZE; + if( size % pattern_size != 0 ) + return ZE_RESULT_ERROR_INVALID_SIZE; + return ZE_RESULT_SUCCESS; } @@ -1221,6 +1359,9 @@ namespace validation_layer if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) return ZE_RESULT_ERROR_INVALID_SIZE; + if( size % pattern_size != 0 ) + return ZE_RESULT_ERROR_INVALID_SIZE; + return ZE_RESULT_SUCCESS; } @@ -1553,7 +1694,7 @@ namespace validation_layer if( nullptr == phEvent ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x3f < desc->flags ) + if( 0x7f < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( 0x7 < desc->signal ) @@ -1943,6 +2084,23 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeEventGetCounterBasedFlagsPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + if( nullptr == hEvent ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pFlags ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue @@ -3806,6 +3964,271 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeGraphCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ) + { + if( nullptr == hContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListBeginGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListEndGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListGetGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphGetPrimaryCommandListExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphSetDestructionCallbackExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphInstantiateExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phExecutableGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeCommandListAppendGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeExecutableGraphGetSourceGraphExtPrologue( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phSourceGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphIsEmptyExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphDumpContentsExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == filePath ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeExecutableGraphDestroyExtPrologue( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphDestroyExtPrologue( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -4678,6 +5101,23 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeCommandListIsMutableExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pIsMutable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 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 d1b04df8..47a64901 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -48,6 +48,7 @@ namespace validation_layer ze_result_t zeDeviceGetGlobalTimestampsPrologue( ze_device_handle_t hDevice, uint64_t* hostTimestamp, uint64_t* deviceTimestamp ) override; ze_result_t zeDeviceSynchronizePrologue( ze_device_handle_t hDevice ) override; ze_result_t zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( ze_device_handle_t hDevice, uint32_t* incrementValue ) override; + ze_result_t zeDeviceGetCounterBasedEventMaxValuePrologue( ze_device_handle_t hDevice, uint64_t* maxValue ) override; ze_result_t zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const void* pObjDesc, size_t* pSize, char* pRequirements ) override; ze_result_t zeDeviceGetRuntimeRequirementsKeyPrologue( ze_device_handle_t hDevice, const char** pKey ) override; ze_result_t zeDeviceValidateRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const char* pRequirements, ze_validate_runtime_requirements_output_t* pOut ) override; @@ -61,6 +62,9 @@ namespace validation_layer ze_result_t zeCommandQueueSynchronizePrologue( ze_command_queue_handle_t hCommandQueue, uint64_t timeout ) override; ze_result_t zeCommandQueueGetOrdinalPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pOrdinal ) override; ze_result_t zeCommandQueueGetIndexPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pIndex ) override; + ze_result_t zeCommandQueueGetFlagsPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_flags_t* pFlags ) override; + ze_result_t zeCommandQueueGetModePrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_mode_t* pMode ) override; + ze_result_t zeCommandQueueGetPriorityPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_priority_t* pPriority ) override; ze_result_t zeCommandListCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t* desc, ze_command_list_handle_t* phCommandList ) override; ze_result_t zeCommandListCreateImmediatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t* altdesc, ze_command_list_handle_t* phCommandList ) override; ze_result_t zeCommandListDestroyPrologue( ze_command_list_handle_t hCommandList ) override; @@ -73,6 +77,10 @@ namespace validation_layer ze_result_t zeCommandListGetOrdinalPrologue( ze_command_list_handle_t hCommandList, uint32_t* pOrdinal ) override; ze_result_t zeCommandListImmediateGetIndexPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t* pIndex ) override; ze_result_t zeCommandListIsImmediatePrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsImmediate ) override; + ze_result_t zeCommandListGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_list_flags_t* pFlags ) override; + ze_result_t zeCommandListImmediateGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_flags_t* pFlags ) override; + ze_result_t zeCommandListImmediateGetModePrologue( ze_command_list_handle_t hCommandList, ze_command_queue_mode_t* pMode ) override; + ze_result_t zeCommandListImmediateGetPriorityPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_priority_t* pPriority ) override; ze_result_t zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendMemoryRangesBarrierPrologue( ze_command_list_handle_t hCommandList, uint32_t numRanges, const size_t* pRangeSizes, const void** pRanges, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeContextSystemBarrierPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice ) override; @@ -115,6 +123,7 @@ namespace validation_layer ze_result_t zeEventGetWaitScopePrologue( ze_event_handle_t hEvent, ze_event_scope_flags_t* pWaitScope ) override; ze_result_t zeEventPoolGetContextHandlePrologue( ze_event_pool_handle_t hEventPool, ze_context_handle_t* phContext ) override; ze_result_t zeEventPoolGetFlagsPrologue( ze_event_pool_handle_t hEventPool, ze_event_pool_flags_t* pFlags ) override; + ze_result_t zeEventGetCounterBasedFlagsPrologue( ze_event_handle_t hEvent, ze_event_counter_based_flags_t* pFlags ) override; ze_result_t zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t* desc, ze_fence_handle_t* phFence ) override; ze_result_t zeFenceDestroyPrologue( ze_fence_handle_t hFence ) override; ze_result_t zeFenceHostSynchronizePrologue( ze_fence_handle_t hFence, uint64_t timeout ) override; @@ -200,6 +209,22 @@ namespace validation_layer ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; + ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; + ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; + ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; + ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; + ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; + ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; + ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; + ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; + ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; + 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override; ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override; ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override; @@ -239,6 +264,7 @@ namespace validation_layer ze_result_t zeCommandListGetNextCommandIdExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint64_t* pCommandId ) override; ze_result_t zeCommandListGetNextCommandIdWithKernelsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint32_t numKernels, ze_kernel_handle_t* phKernels, uint64_t* pCommandId ) override; ze_result_t zeCommandListUpdateMutableCommandsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc ) override; + ze_result_t zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) override; ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override; ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override; diff --git a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp index fba97c92..c811c026 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -1107,9 +1107,11 @@ namespace validation_layer ze_result_t ZETParameterValidation::zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { if( nullptr == hMetricGroup ) diff --git a/source/layers/validation/common/ze_entry_points.h b/source/layers/validation/common/ze_entry_points.h index 6f33350a..24a103fb 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -73,6 +73,8 @@ class ZEValidationEntryPoints { virtual ze_result_t zeDeviceSynchronizeEpilogue( ze_device_handle_t hDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( ze_device_handle_t hDevice, uint32_t* incrementValue ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceGetAggregatedCopyOffloadIncrementValueEpilogue( ze_device_handle_t hDevice, uint32_t* incrementValue , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetCounterBasedEventMaxValuePrologue( ze_device_handle_t hDevice, uint64_t* maxValue ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetCounterBasedEventMaxValueEpilogue( ze_device_handle_t hDevice, uint64_t* maxValue , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const void* pObjDesc, size_t* pSize, char* pRequirements ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceGetRuntimeRequirementsEpilogue( ze_device_handle_t hDevice, const void* pObjDesc, size_t* pSize, char* pRequirements , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceGetRuntimeRequirementsKeyPrologue( ze_device_handle_t hDevice, const char** pKey ) {return ZE_RESULT_SUCCESS;} @@ -99,6 +101,12 @@ class ZEValidationEntryPoints { virtual ze_result_t zeCommandQueueGetOrdinalEpilogue( ze_command_queue_handle_t hCommandQueue, uint32_t* pOrdinal , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandQueueGetIndexPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pIndex ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandQueueGetIndexEpilogue( ze_command_queue_handle_t hCommandQueue, uint32_t* pIndex , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetFlagsPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_flags_t* pFlags ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetFlagsEpilogue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_flags_t* pFlags , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetModePrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_mode_t* pMode ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetModeEpilogue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_mode_t* pMode , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetPriorityPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_priority_t* pPriority ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueGetPriorityEpilogue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_priority_t* pPriority , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t* desc, ze_command_list_handle_t* phCommandList ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListCreateEpilogue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t* desc, ze_command_list_handle_t* phCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListCreateImmediatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t* altdesc, ze_command_list_handle_t* phCommandList ) {return ZE_RESULT_SUCCESS;} @@ -123,6 +131,14 @@ class ZEValidationEntryPoints { virtual ze_result_t zeCommandListImmediateGetIndexEpilogue( ze_command_list_handle_t hCommandListImmediate, uint32_t* pIndex , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListIsImmediatePrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsImmediate ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListIsImmediateEpilogue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsImmediate , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_list_flags_t* pFlags ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetFlagsEpilogue( ze_command_list_handle_t hCommandList, ze_command_list_flags_t* pFlags , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_flags_t* pFlags ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetFlagsEpilogue( ze_command_list_handle_t hCommandList, ze_command_queue_flags_t* pFlags , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetModePrologue( ze_command_list_handle_t hCommandList, ze_command_queue_mode_t* pMode ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetModeEpilogue( ze_command_list_handle_t hCommandList, ze_command_queue_mode_t* pMode , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetPriorityPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_priority_t* pPriority ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListImmediateGetPriorityEpilogue( ze_command_list_handle_t hCommandList, ze_command_queue_priority_t* pPriority , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendBarrierEpilogue( ze_command_list_handle_t hCommandList, 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 zeCommandListAppendMemoryRangesBarrierPrologue( ze_command_list_handle_t hCommandList, uint32_t numRanges, const size_t* pRangeSizes, const void** pRanges, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} @@ -207,6 +223,8 @@ class ZEValidationEntryPoints { virtual ze_result_t zeEventPoolGetContextHandleEpilogue( ze_event_pool_handle_t hEventPool, ze_context_handle_t* phContext , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeEventPoolGetFlagsPrologue( ze_event_pool_handle_t hEventPool, ze_event_pool_flags_t* pFlags ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeEventPoolGetFlagsEpilogue( ze_event_pool_handle_t hEventPool, ze_event_pool_flags_t* pFlags , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeEventGetCounterBasedFlagsPrologue( ze_event_handle_t hEvent, ze_event_counter_based_flags_t* pFlags ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeEventGetCounterBasedFlagsEpilogue( ze_event_handle_t hEvent, ze_event_counter_based_flags_t* pFlags , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t* desc, ze_fence_handle_t* phFence ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeFenceCreateEpilogue( ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t* desc, ze_fence_handle_t* phFence , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeFenceDestroyPrologue( ze_fence_handle_t hFence ) {return ZE_RESULT_SUCCESS;} @@ -377,6 +395,38 @@ class ZEValidationEntryPoints { virtual ze_result_t zeKernelGetAllocationPropertiesExpEpilogue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeMemGetIpcHandleWithPropertiesEpilogue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphCreateExtEpilogue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtEpilogue( ze_command_list_handle_t hCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListEndGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetPrimaryCommandListExtEpilogue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphSetDestructionCallbackExtEpilogue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphInstantiateExtEpilogue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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 zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeExecutableGraphGetSourceGraphExtEpilogue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphIsEmptyExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphDumpContentsExtEpilogue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceReserveCacheExtEpilogue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) {return ZE_RESULT_SUCCESS;} @@ -455,6 +505,8 @@ class ZEValidationEntryPoints { virtual ze_result_t zeCommandListGetNextCommandIdWithKernelsExpEpilogue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint32_t numKernels, ze_kernel_handle_t* phKernels, uint64_t* pCommandId , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandsExpEpilogue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsMutableExpEpilogue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandSignalEventExpEpilogue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} 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 38dc72d1..f2eefa11 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -343,10 +343,15 @@ namespace validation_layer ze_result_t ZEHandleLifetimeValidation::zeDeviceGetGlobalTimestampsPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { @@ -379,6 +384,20 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeDeviceGetCounterBasedEventMaxValuePrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device const void* pObjDesc, ///< [in] describes the object for which the requirements are to be @@ -594,6 +613,42 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeCommandQueueGetFlagsPrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCmdQueue )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandQueueGetModePrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCmdQueue )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandQueueGetPriorityPrologue( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCmdQueue )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListCreatePrologue( ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -778,6 +833,54 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeCommandListGetFlagsPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListImmediateGetFlagsPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListImmediateGetModePrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListImmediateGetPriorityPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion @@ -1635,6 +1738,19 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeEventGetCounterBasedFlagsPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + + if ( !context.handleLifetime->isHandleValid( hEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor @@ -3115,6 +3231,253 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeGraphCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ) + { + + if ( !context.handleLifetime->isHandleValid( hContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListBeginGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListEndGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListGetGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphGetPrimaryCommandListExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphSetDestructionCallbackExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphInstantiateExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListAppendGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + + 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( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeExecutableGraphGetSourceGraphExtPrologue( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphIsEmptyExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphDumpContentsExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeExecutableGraphDestroyExtPrologue( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphDestroyExtPrologue( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + + 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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device object size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the @@ -3806,6 +4169,19 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeCommandListIsMutableExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list uint64_t commandId, ///< [in] command identifier 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 e1c3fecb..12ba8478 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -44,6 +44,7 @@ namespace validation_layer ze_result_t zeDeviceGetGlobalTimestampsPrologue( ze_device_handle_t hDevice, uint64_t* hostTimestamp, uint64_t* deviceTimestamp ) override; ze_result_t zeDeviceSynchronizePrologue( ze_device_handle_t hDevice ) override; ze_result_t zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( ze_device_handle_t hDevice, uint32_t* incrementValue ) override; + ze_result_t zeDeviceGetCounterBasedEventMaxValuePrologue( ze_device_handle_t hDevice, uint64_t* maxValue ) override; ze_result_t zeDeviceGetRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const void* pObjDesc, size_t* pSize, char* pRequirements ) override; ze_result_t zeDeviceGetRuntimeRequirementsKeyPrologue( ze_device_handle_t hDevice, const char** pKey ) override; ze_result_t zeDeviceValidateRuntimeRequirementsPrologue( ze_device_handle_t hDevice, const char* pRequirements, ze_validate_runtime_requirements_output_t* pOut ) override; @@ -57,6 +58,9 @@ namespace validation_layer ze_result_t zeCommandQueueSynchronizePrologue( ze_command_queue_handle_t hCommandQueue, uint64_t timeout ) override; ze_result_t zeCommandQueueGetOrdinalPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pOrdinal ) override; ze_result_t zeCommandQueueGetIndexPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pIndex ) override; + ze_result_t zeCommandQueueGetFlagsPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_flags_t* pFlags ) override; + ze_result_t zeCommandQueueGetModePrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_mode_t* pMode ) override; + ze_result_t zeCommandQueueGetPriorityPrologue( ze_command_queue_handle_t hCmdQueue, ze_command_queue_priority_t* pPriority ) override; ze_result_t zeCommandListCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_list_desc_t* desc, ze_command_list_handle_t* phCommandList ) override; ze_result_t zeCommandListCreateImmediatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t* altdesc, ze_command_list_handle_t* phCommandList ) override; ze_result_t zeCommandListDestroyPrologue( ze_command_list_handle_t hCommandList ) override; @@ -69,6 +73,10 @@ namespace validation_layer ze_result_t zeCommandListGetOrdinalPrologue( ze_command_list_handle_t hCommandList, uint32_t* pOrdinal ) override; ze_result_t zeCommandListImmediateGetIndexPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t* pIndex ) override; ze_result_t zeCommandListIsImmediatePrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsImmediate ) override; + ze_result_t zeCommandListGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_list_flags_t* pFlags ) override; + ze_result_t zeCommandListImmediateGetFlagsPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_flags_t* pFlags ) override; + ze_result_t zeCommandListImmediateGetModePrologue( ze_command_list_handle_t hCommandList, ze_command_queue_mode_t* pMode ) override; + ze_result_t zeCommandListImmediateGetPriorityPrologue( ze_command_list_handle_t hCommandList, ze_command_queue_priority_t* pPriority ) override; ze_result_t zeCommandListAppendBarrierPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendMemoryRangesBarrierPrologue( ze_command_list_handle_t hCommandList, uint32_t numRanges, const size_t* pRangeSizes, const void** pRanges, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeContextSystemBarrierPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice ) override; @@ -111,6 +119,7 @@ namespace validation_layer ze_result_t zeEventGetWaitScopePrologue( ze_event_handle_t hEvent, ze_event_scope_flags_t* pWaitScope ) override; ze_result_t zeEventPoolGetContextHandlePrologue( ze_event_pool_handle_t hEventPool, ze_context_handle_t* phContext ) override; ze_result_t zeEventPoolGetFlagsPrologue( ze_event_pool_handle_t hEventPool, ze_event_pool_flags_t* pFlags ) override; + ze_result_t zeEventGetCounterBasedFlagsPrologue( ze_event_handle_t hEvent, ze_event_counter_based_flags_t* pFlags ) override; ze_result_t zeFenceCreatePrologue( ze_command_queue_handle_t hCommandQueue, const ze_fence_desc_t* desc, ze_fence_handle_t* phFence ) override; ze_result_t zeFenceDestroyPrologue( ze_fence_handle_t hFence ) override; ze_result_t zeFenceHostSynchronizePrologue( ze_fence_handle_t hFence, uint64_t timeout ) override; @@ -196,6 +205,22 @@ namespace validation_layer ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; + ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; + ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; + ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; + ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; + ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; + ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; + ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; + ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; + ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; + 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override; ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override; ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override; @@ -235,6 +260,7 @@ namespace validation_layer ze_result_t zeCommandListGetNextCommandIdExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint64_t* pCommandId ) override; ze_result_t zeCommandListGetNextCommandIdWithKernelsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint32_t numKernels, ze_kernel_handle_t* phKernels, uint64_t* pCommandId ) override; ze_result_t zeCommandListUpdateMutableCommandsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc ) override; + ze_result_t zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) override; ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override; ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override; diff --git a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp index 7943d057..8175d712 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -951,9 +951,11 @@ namespace validation_layer ze_result_t ZETHandleLifetimeValidation::zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index fad2b732..6f5eab85 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -751,10 +751,15 @@ namespace validation_layer VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetGlobalTimestamps( ze_result_t result, ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -836,6 +841,37 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue( + ze_result_t result, + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based 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 zeDeviceGetCounterBasedEventMaxValue("; + + + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "maxValue="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && maxValue != nullptr) { + oss << loader::to_string(*maxValue); + } else { + oss << loader::to_string(maxValue); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetRuntimeRequirements( ze_result_t result, @@ -1241,6 +1277,93 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandQueueGetFlags( + ze_result_t result, + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation +) { + // 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 zeCommandQueueGetFlags("; + + + oss << "hCmdQueue="; + oss << loader::to_string(hCmdQueue); + + oss << ", "; + oss << "pFlags="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pFlags != nullptr) { + oss << loader::to_string(*pFlags); + } else { + oss << loader::to_string(pFlags); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandQueueGetMode( + ze_result_t result, + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation +) { + // 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 zeCommandQueueGetMode("; + + + oss << "hCmdQueue="; + oss << loader::to_string(hCmdQueue); + + oss << ", "; + oss << "pMode="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pMode != nullptr) { + oss << loader::to_string(*pMode); + } else { + oss << loader::to_string(pMode); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandQueueGetPriority( + ze_result_t result, + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation +) { + // 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 zeCommandQueueGetPriority("; + + + oss << "hCmdQueue="; + oss << loader::to_string(hCmdQueue); + + oss << ", "; + oss << "pPriority="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pPriority != nullptr) { + oss << loader::to_string(*pPriority); + } else { + oss << loader::to_string(pPriority); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListCreate( ze_result_t result, @@ -1595,6 +1718,122 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetFlags( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation +) { + // 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 zeCommandListGetFlags("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pFlags="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pFlags != nullptr) { + oss << loader::to_string(*pFlags); + } else { + oss << loader::to_string(pFlags); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateGetFlags( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation +) { + // 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 zeCommandListImmediateGetFlags("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pFlags="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pFlags != nullptr) { + oss << loader::to_string(*pFlags); + } else { + oss << loader::to_string(pFlags); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateGetMode( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation +) { + // 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 zeCommandListImmediateGetMode("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pMode="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pMode != nullptr) { + oss << loader::to_string(*pMode); + } else { + oss << loader::to_string(pMode); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateGetPriority( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation +) { + // 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 zeCommandListImmediateGetPriority("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pPriority="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pPriority != nullptr) { + oss << loader::to_string(*pPriority); + } else { + oss << loader::to_string(pPriority); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendBarrier( ze_result_t result, @@ -3114,6 +3353,36 @@ namespace validation_layer oss << "hEventPool="; oss << loader::to_string(hEventPool); + oss << ", "; + oss << "pFlags="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pFlags != nullptr) { + oss << loader::to_string(*pFlags); + } else { + oss << loader::to_string(pFlags); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventGetCounterBasedFlags( + ze_result_t result, + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t +) { + // 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 zeEventGetCounterBasedFlags("; + + + oss << "hEvent="; + oss << loader::to_string(hEvent); + oss << ", "; oss << "pFlags="; // Dereference output parameter if not null and result is success @@ -6080,14 +6349,12 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReserveCacheExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphCreateExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6095,29 +6362,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceReserveCacheExt("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphCreateExt("; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "cacheLevel="; - oss << loader::to_string(cacheLevel); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "cacheReservationSize="; - oss << loader::to_string(cacheReservationSize); + oss << "phGraph="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); + } else { + oss << loader::to_string(phGraph); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceSetCacheAdviceExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginGraphCaptureExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6125,39 +6396,25 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceSetCacheAdviceExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginGraphCaptureExt("; - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "ptr="; - oss << loader::to_string(ptr); - - oss << ", "; - oss << "regionSize="; - oss << loader::to_string(regionSize); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "cacheRegion="; - oss << loader::to_string(cacheRegion); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryTimestampsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt( ze_result_t result, - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6165,31 +6422,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeEventQueryTimestampsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginCaptureIntoGraphExt("; - oss << "hEvent="; - oss << loader::to_string(hEvent); - - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pTimestamps="; - oss << loader::to_string(pTimestamps); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetMemoryPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt( ze_result_t result, - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6197,26 +6449,21 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetMemoryPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListIsGraphCaptureEnabledExt("; - oss << "hImage="; - oss << loader::to_string(hImage); - - oss << ", "; - oss << "pMemoryProperties="; - oss << loader::to_string(pMemoryProperties); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListEndGraphCaptureExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6224,43 +6471,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExt("; - - - oss << "hContext="; - oss << loader::to_string(hContext); + oss << status << " (" << loader::to_string(result) << ") in zeCommandListEndGraphCaptureExt("; - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); - oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "phImageView="; + oss << "phGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { - oss << loader::to_string(*phImageView); + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); } else { - oss << loader::to_string(phImageView); + oss << loader::to_string(phGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetGraphExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6268,40 +6504,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetGraphExt("; - oss << "hContext="; - oss << loader::to_string(hContext); - - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); - - oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "phImageView="; + oss << "phGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { - oss << loader::to_string(*phImageView); + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); } else { - oss << loader::to_string(phImageView); + oss << loader::to_string(phGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelSchedulingHintExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphGetPrimaryCommandListExt( ze_result_t result, - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6309,23 +6534,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeKernelSchedulingHintExp("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphGetPrimaryCommandListExt("; - oss << "hKernel="; - oss << loader::to_string(hKernel); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pHint="; - oss << loader::to_string(pHint); + oss << "phCommandList="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phCommandList != nullptr) { + oss << loader::to_string(*phCommandList); + } else { + oss << loader::to_string(phCommandList); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDevicePciGetPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphSetDestructionCallbackExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6333,34 +6566,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDevicePciGetPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphSetDestructionCallbackExt("; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pPciProperties="; - oss << loader::to_string(pPciProperties); + oss << "pfnCallback="; + oss << loader::to_string(pfnCallback); + + oss << ", "; + oss << "pUserData="; + oss << loader::to_string(pUserData); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphInstantiateExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6368,57 +6600,34 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyToMemoryExt("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphInstantiateExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - - oss << ", "; - oss << "dstptr="; - oss << loader::to_string(dstptr); - - oss << ", "; - oss << "hSrcImage="; - oss << loader::to_string(hSrcImage); - - oss << ", "; - oss << "pSrcRegion="; - oss << loader::to_string(pSrcRegion); - - oss << ", "; - oss << "destRowPitch="; - oss << loader::to_string(destRowPitch); - - oss << ", "; - oss << "destSlicePitch="; - oss << loader::to_string(destSlicePitch); - - oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "phExecutableGraph="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phExecutableGraph != nullptr) { + oss << loader::to_string(*phExecutableGraph); + } else { + oss << loader::to_string(phExecutableGraph); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendGraphExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -6431,31 +6640,19 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyFromMemoryExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendGraphExt("; oss << "hCommandList="; oss << loader::to_string(hCommandList); oss << ", "; - oss << "hDstImage="; - oss << loader::to_string(hDstImage); - - oss << ", "; - oss << "srcptr="; - oss << loader::to_string(srcptr); - - oss << ", "; - oss << "pDstRegion="; - oss << loader::to_string(pDstRegion); - - oss << ", "; - oss << "srcRowPitch="; - oss << loader::to_string(srcRowPitch); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "srcSlicePitch="; - oss << loader::to_string(srcSlicePitch); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; oss << "hSignalEvent="; @@ -6472,11 +6669,10 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetAllocPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphGetSourceGraphExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6484,31 +6680,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetAllocPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphGetSourceGraphExt("; - oss << "hContext="; - oss << loader::to_string(hContext); - - oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pImageAllocProperties="; - oss << loader::to_string(pImageAllocProperties); + oss << "phSourceGraph="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phSourceGraph != nullptr) { + oss << loader::to_string(*phSourceGraph); + } else { + oss << loader::to_string(phSourceGraph); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeModuleInspectLinkageExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphIsEmptyExt( ze_result_t result, - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6516,37 +6708,21 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeModuleInspectLinkageExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeGraphIsEmptyExt("; - oss << "pInspectDesc="; - oss << loader::to_string(pInspectDesc); - - oss << ", "; - oss << "numModules="; - oss << loader::to_string(numModules); - - oss << ", "; - oss << "phModules="; - oss << loader::to_string(phModules); - oss << ", "; - oss << "phLog="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phLog != nullptr) { - oss << loader::to_string(*phLog); - } else { - oss << loader::to_string(phLog); - } + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemFreeExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDumpContentsExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6554,35 +6730,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeMemFreeExt("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphDumpContentsExt("; - oss << "hContext="; - oss << loader::to_string(hContext); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pMemFreeDesc="; - oss << loader::to_string(pMemFreeDesc); + oss << "filePath="; + oss << loader::to_string(filePath); oss << ", "; - oss << "ptr="; - oss << loader::to_string(ptr); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphDestroyExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6590,35 +6757,18 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphDestroyExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); - - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); - oss << ", "; - oss << "phVertices="; - oss << loader::to_string(phVertices); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetSubVerticesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDestroyExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6626,27 +6776,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetSubVerticesExp("; - - - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << status << " (" << loader::to_string(result) << ") in zeGraphDestroyExt("; - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); - oss << ", "; - oss << "phSubvertices="; - oss << loader::to_string(phSubvertices); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendHostFunction( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + 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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6654,23 +6805,47 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendHostFunction("; - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pVertexProperties="; - oss << loader::to_string(pVertexProperties); + oss << "pfnHostFunction="; + oss << loader::to_string(pfnHostFunction); + + oss << ", "; + oss << "pUserData="; + oss << loader::to_string(pUserData); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetDeviceExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReserveCacheExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6678,28 +6853,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetDeviceExp("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceReserveCacheExt("; - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << "hDevice="; + oss << loader::to_string(hDevice); 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 << "cacheLevel="; + oss << loader::to_string(cacheLevel); + + oss << ", "; + oss << "cacheReservationSize="; + oss << loader::to_string(cacheReservationSize); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetFabricVertexExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceSetCacheAdviceExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6707,37 +6883,39 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetFabricVertexExp("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceSetCacheAdviceExt("; oss << "hDevice="; oss << loader::to_string(hDevice); oss << ", "; - oss << "phVertex="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertex != nullptr) { - oss << loader::to_string(*phVertex); - } else { - oss << loader::to_string(phVertex); - } + oss << "ptr="; + oss << loader::to_string(ptr); + + oss << ", "; + oss << "regionSize="; + oss << loader::to_string(regionSize); + + oss << ", "; + oss << "cacheRegion="; + oss << loader::to_string(cacheRegion); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryTimestampsExp( ze_result_t result, - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6745,32 +6923,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetExp("; + oss << status << " (" << loader::to_string(result) << ") in zeEventQueryTimestampsExp("; - oss << "hVertexA="; - oss << loader::to_string(hVertexA); + oss << "hEvent="; + oss << loader::to_string(hEvent); oss << ", "; - oss << "hVertexB="; - oss << loader::to_string(hVertexB); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; oss << "pCount="; oss << loader::to_string(pCount); oss << ", "; - oss << "phEdges="; - oss << loader::to_string(phEdges); + oss << "pTimestamps="; + oss << loader::to_string(pTimestamps); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetVerticesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetMemoryPropertiesExp( ze_result_t result, - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6778,37 +6955,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetVerticesExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeImageGetMemoryPropertiesExp("; - oss << "hEdge="; - oss << loader::to_string(hEdge); - oss << ", "; - oss << "phVertexA="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertexA != nullptr) { - oss << loader::to_string(*phVertexA); - } else { - oss << loader::to_string(phVertexA); - } + oss << "hImage="; + oss << loader::to_string(hImage); oss << ", "; - oss << "phVertexB="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertexB != nullptr) { - oss << loader::to_string(*phVertexB); - } else { - oss << loader::to_string(phVertexB); - } + oss << "pMemoryProperties="; + oss << loader::to_string(pMemoryProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExt( ze_result_t result, - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6816,38 +6982,43 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExt("; - oss << "hEdge="; - oss << loader::to_string(hEdge); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pEdgeProperties="; - oss << loader::to_string(pEdgeProperties); + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "desc="; + oss << loader::to_string(desc); + + oss << ", "; + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "phImageView="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { + oss << loader::to_string(*phImageView); + } else { + oss << loader::to_string(phImageView); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryKernelTimestampsExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExp( ze_result_t result, - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6855,32 +7026,40 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeEventQueryKernelTimestampsExt("; + oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExp("; - oss << "hEvent="; - oss << loader::to_string(hEvent); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; oss << "hDevice="; oss << loader::to_string(hDevice); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "desc="; + oss << loader::to_string(desc); oss << ", "; - oss << "pResults="; - oss << loader::to_string(pResults); + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "phImageView="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { + oss << loader::to_string(*phImageView); + } else { + oss << loader::to_string(phImageView); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelSchedulingHintExp( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6888,33 +7067,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeKernelSchedulingHintExp("; - oss << "hDriver="; - oss << loader::to_string(hDriver); - oss << ", "; - oss << "pDescriptor="; - oss << loader::to_string(pDescriptor); + oss << "hKernel="; + oss << loader::to_string(hKernel); oss << ", "; - oss << "phBuilder="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { - oss << loader::to_string(*phBuilder); - } else { - oss << loader::to_string(phBuilder); - } + oss << "pHint="; + oss << loader::to_string(pHint); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDevicePciGetPropertiesExt( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6922,28 +7091,34 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeDevicePciGetPropertiesExt("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "pPciProperties="; + oss << loader::to_string(pPciProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6951,38 +7126,62 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDriverRTASFormatCompatibilityCheckExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyToMemoryExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "rtasFormatA="; - oss << loader::to_string(rtasFormatA); + oss << "dstptr="; + oss << loader::to_string(dstptr); oss << ", "; - oss << "rtasFormatB="; - oss << loader::to_string(rtasFormatB); + oss << "hSrcImage="; + oss << loader::to_string(hSrcImage); + + oss << ", "; + oss << "pSrcRegion="; + oss << loader::to_string(pSrcRegion); + + oss << ", "; + oss << "destRowPitch="; + oss << loader::to_string(destRowPitch); + + oss << ", "; + oss << "destSlicePitch="; + oss << loader::to_string(destSlicePitch); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6990,59 +7189,52 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderBuildExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyFromMemoryExt("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pScratchBuffer="; - oss << loader::to_string(pScratchBuffer); + oss << "hDstImage="; + oss << loader::to_string(hDstImage); oss << ", "; - oss << "scratchBufferSizeBytes="; - oss << loader::to_string(scratchBufferSizeBytes); + oss << "srcptr="; + oss << loader::to_string(srcptr); oss << ", "; - oss << "pRtasBuffer="; - oss << loader::to_string(pRtasBuffer); + oss << "pDstRegion="; + oss << loader::to_string(pDstRegion); oss << ", "; - oss << "rtasBufferSizeBytes="; - oss << loader::to_string(rtasBufferSizeBytes); + oss << "srcRowPitch="; + oss << loader::to_string(srcRowPitch); oss << ", "; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "srcSlicePitch="; + oss << loader::to_string(srcSlicePitch); oss << ", "; - oss << "pBuildUserPtr="; - oss << loader::to_string(pBuildUserPtr); + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); oss << ", "; - oss << "pBounds="; - oss << loader::to_string(pBounds); + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); oss << ", "; - oss << "pRtasBufferSizeBytes="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { - oss << loader::to_string(*pRtasBufferSizeBytes); - } else { - oss << loader::to_string(pRtasBufferSizeBytes); - } + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetAllocPropertiesExt( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7050,19 +7242,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zeImageGetAllocPropertiesExt("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); + oss << "hContext="; + oss << loader::to_string(hContext); + + oss << ", "; + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "pImageAllocProperties="; + oss << loader::to_string(pImageAllocProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeModuleInspectLinkageExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7070,28 +7274,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationCreateExp("; + oss << status << " (" << loader::to_string(result) << ") in zeModuleInspectLinkageExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "pInspectDesc="; + oss << loader::to_string(pInspectDesc); oss << ", "; - oss << "phParallelOperation="; + oss << "numModules="; + oss << loader::to_string(numModules); + + oss << ", "; + oss << "phModules="; + oss << loader::to_string(phModules); + + oss << ", "; + oss << "phLog="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { - oss << loader::to_string(*phParallelOperation); + if (result == ZE_RESULT_SUCCESS && phLog != nullptr) { + oss << loader::to_string(*phLog); } else { - oss << loader::to_string(phParallelOperation); + oss << loader::to_string(phLog); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemFreeExt( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7099,22 +7312,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeMemFreeExt("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "pMemFreeDesc="; + oss << loader::to_string(pMemFreeDesc); + + oss << ", "; + oss << "ptr="; + oss << loader::to_string(ptr); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetExp( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7122,18 +7348,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationJoinExp("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetExp("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phVertices="; + oss << loader::to_string(phVertices); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetSubVerticesExp( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7141,23 +7384,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetSubVerticesExp("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hVertex="; + oss << loader::to_string(hVertex); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phSubvertices="; + oss << loader::to_string(phSubvertices); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemGetPitchFor2dImage( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetPropertiesExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7165,44 +7412,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeMemGetPitchFor2dImage("; - - - oss << "hContext="; - oss << loader::to_string(hContext); - - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "imageWidth="; - oss << loader::to_string(imageWidth); + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetPropertiesExp("; - oss << ", "; - oss << "imageHeight="; - oss << loader::to_string(imageHeight); - oss << ", "; - oss << "elementSizeInBytes="; - oss << loader::to_string(elementSizeInBytes); + oss << "hVertex="; + oss << loader::to_string(hVertex); oss << ", "; - oss << "rowPitch="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && rowPitch != nullptr) { - oss << loader::to_string(*rowPitch); - } else { - oss << loader::to_string(rowPitch); - } + oss << "pVertexProperties="; + oss << loader::to_string(pVertexProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetDeviceOffsetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetDeviceExp( ze_result_t result, - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7210,28 +7436,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetDeviceOffsetExp("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetDeviceExp("; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "hVertex="; + oss << loader::to_string(hVertex); oss << ", "; - oss << "pDeviceOffset="; + oss << "phDevice="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pDeviceOffset != nullptr) { - oss << loader::to_string(*pDeviceOffset); + if (result == ZE_RESULT_SUCCESS && phDevice != nullptr) { + oss << loader::to_string(*phDevice); } else { - oss << loader::to_string(pDeviceOffset); + oss << loader::to_string(phDevice); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListCreateCloneExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetFabricVertexExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7239,38 +7465,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListCreateCloneExp("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetFabricVertexExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "phClonedCommandList="; + oss << "phVertex="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phClonedCommandList != nullptr) { - oss << loader::to_string(*phClonedCommandList); + if (result == ZE_RESULT_SUCCESS && phVertex != nullptr) { + oss << loader::to_string(*phVertex); } else { - oss << loader::to_string(phClonedCommandList); + oss << loader::to_string(phVertex); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetExp( ze_result_t result, - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7278,50 +7503,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsExp("; - - - oss << "hCommandListImmediate="; - oss << loader::to_string(hCommandListImmediate); + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetExp("; - oss << ", "; - oss << "numCommandLists="; - oss << loader::to_string(numCommandLists); - oss << ", "; - oss << "phCommandLists="; - oss << loader::to_string(phCommandLists); + oss << "hVertexA="; + oss << loader::to_string(hVertexA); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "hVertexB="; + oss << loader::to_string(hVertexB); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "pCount="; + oss << loader::to_string(pCount); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "phEdges="; + oss << loader::to_string(phEdges); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetVerticesExp( ze_result_t result, - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7329,44 +7536,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsWithParameters("; - - - oss << "hCommandListImmediate="; - oss << loader::to_string(hCommandListImmediate); - - oss << ", "; - oss << "numCommandLists="; - oss << loader::to_string(numCommandLists); - - oss << ", "; - oss << "phCommandLists="; - oss << loader::to_string(phCommandLists); + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetVerticesExp("; - oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); - oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "hEdge="; + oss << loader::to_string(hEdge); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "phVertexA="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phVertexA != nullptr) { + oss << loader::to_string(*phVertexA); + } else { + oss << loader::to_string(phVertexA); + } oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "phVertexB="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phVertexB != nullptr) { + oss << loader::to_string(*phVertexB); + } else { + oss << loader::to_string(phVertexB); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetPropertiesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7374,37 +7574,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetPropertiesExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "hEdge="; + oss << loader::to_string(hEdge); oss << ", "; - oss << "pCommandId="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { - oss << loader::to_string(*pCommandId); - } else { - oss << loader::to_string(pCommandId); - } + oss << "pEdgeProperties="; + oss << loader::to_string(pEdgeProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryKernelTimestampsExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7412,46 +7613,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdWithKernelsExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeEventQueryKernelTimestampsExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "desc="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && desc != nullptr) { - oss << loader::to_string(*desc); - } else { - oss << loader::to_string(desc); - } + oss << "hEvent="; + oss << loader::to_string(hEvent); oss << ", "; - oss << "numKernels="; - oss << loader::to_string(numKernels); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "phKernels="; - oss << loader::to_string(phKernels); + oss << "pCount="; + oss << loader::to_string(pCount); oss << ", "; - oss << "pCommandId="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { - oss << loader::to_string(*pCommandId); - } else { - oss << loader::to_string(pCommandId); - } + oss << "pResults="; + oss << loader::to_string(pResults); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7459,24 +7646,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "pDescriptor="; + oss << loader::to_string(pDescriptor); + + oss << ", "; + oss << "phBuilder="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { + oss << loader::to_string(*phBuilder); + } else { + oss << loader::to_string(phBuilder); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7484,30 +7680,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandSignalEventExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ", "; - oss << "commandId="; - oss << loader::to_string(commandId); + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "pProperties="; + oss << loader::to_string(pProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7515,34 +7709,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandWaitEventsExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeDriverRTASFormatCompatibilityCheckExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "commandId="; - oss << loader::to_string(commandId); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "rtasFormatA="; + oss << loader::to_string(rtasFormatA); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "rtasFormatB="; + oss << loader::to_string(rtasFormatB); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7550,76 +7748,1666 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandKernelsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderBuildExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ", "; - oss << "numKernels="; - oss << loader::to_string(numKernels); + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); oss << ", "; - oss << "pCommandId="; - oss << loader::to_string(pCommandId); + oss << "pScratchBuffer="; + oss << loader::to_string(pScratchBuffer); oss << ", "; - oss << "phKernels="; - oss << loader::to_string(phKernels); + oss << "scratchBufferSizeBytes="; + oss << loader::to_string(scratchBufferSizeBytes); + + oss << ", "; + oss << "pRtasBuffer="; + oss << loader::to_string(pRtasBuffer); + + oss << ", "; + oss << "rtasBufferSizeBytes="; + oss << loader::to_string(rtasBufferSizeBytes); + + oss << ", "; + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); + + oss << ", "; + oss << "pBuildUserPtr="; + oss << loader::to_string(pBuildUserPtr); + + oss << ", "; + oss << "pBounds="; + oss << loader::to_string(pBounds); + + oss << ", "; + oss << "pRtasBufferSizeBytes="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { + oss << loader::to_string(*pRtasBufferSizeBytes); + } else { + oss << loader::to_string(pRtasBufferSizeBytes); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - // Special function for zexCounterBasedEventCreate2 - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zexCounterBasedEventCreate2( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExp( ze_result_t result, - ze_context_handle_t hContext, - ze_device_handle_t hDevice, - const void* desc, - ze_event_handle_t* phEvent - ) { + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy +) { // 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 zexCounterBasedEventCreate2(" - << "hContext=" << static_cast(hContext) << ", " - << "hDevice=" << static_cast(hDevice) << ", " - << "desc=" << desc << ", " - << "phEvent="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phEvent != nullptr) { - oss << loader::to_string(*phEvent); - } else { - oss << static_cast(phEvent); - } + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExp("; + + + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ")"; context.logger->log_trace(oss.str()); return result; } - - /////////////////////////////////////////////////////////////////////////////// + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExp( + ze_result_t result, + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object +) { + // 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 zeRTASParallelOperationCreateExp("; + + + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "phParallelOperation="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { + oss << loader::to_string(*phParallelOperation); + } else { + oss << loader::to_string(phParallelOperation); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp( + ze_result_t result, + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties +) { + // 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 zeRTASParallelOperationGetPropertiesExp("; + + + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); + + oss << ", "; + oss << "pProperties="; + oss << loader::to_string(pProperties); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExp( + ze_result_t result, + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object +) { + // 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 zeRTASParallelOperationJoinExp("; + + + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExp( + ze_result_t result, + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +) { + // 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 zeRTASParallelOperationDestroyExp("; + + + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemGetPitchFor2dImage( + ze_result_t result, + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch +) { + // 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 zeMemGetPitchFor2dImage("; + + + oss << "hContext="; + oss << loader::to_string(hContext); + + oss << ", "; + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "imageWidth="; + oss << loader::to_string(imageWidth); + + oss << ", "; + oss << "imageHeight="; + oss << loader::to_string(imageHeight); + + oss << ", "; + oss << "elementSizeInBytes="; + oss << loader::to_string(elementSizeInBytes); + + oss << ", "; + oss << "rowPitch="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && rowPitch != nullptr) { + oss << loader::to_string(*rowPitch); + } else { + oss << loader::to_string(rowPitch); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetDeviceOffsetExp( + ze_result_t result, + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image +) { + // 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 zeImageGetDeviceOffsetExp("; + + + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "pDeviceOffset="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pDeviceOffset != nullptr) { + oss << loader::to_string(*pDeviceOffset); + } else { + oss << loader::to_string(pDeviceOffset); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListCreateCloneExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list +) { + // 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 zeCommandListCreateCloneExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "phClonedCommandList="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phClonedCommandList != nullptr) { + oss << loader::to_string(*phClonedCommandList); + } else { + oss << loader::to_string(phClonedCommandList); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp( + ze_result_t result, + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) +) { + // 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 zeCommandListImmediateAppendCommandListsExp("; + + + oss << "hCommandListImmediate="; + oss << loader::to_string(hCommandListImmediate); + + oss << ", "; + oss << "numCommandLists="; + oss << loader::to_string(numCommandLists); + + oss << ", "; + oss << "phCommandLists="; + oss << loader::to_string(phCommandLists); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters( + ze_result_t result, + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) +) { + // 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 zeCommandListImmediateAppendCommandListsWithParameters("; + + + oss << "hCommandListImmediate="; + oss << loader::to_string(hCommandListImmediate); + + oss << ", "; + oss << "numCommandLists="; + oss << loader::to_string(numCommandLists); + + oss << ", "; + oss << "phCommandLists="; + oss << loader::to_string(phCommandLists); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to 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 zeCommandListGetNextCommandIdExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "desc="; + oss << loader::to_string(desc); + + oss << ", "; + oss << "pCommandId="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { + oss << loader::to_string(*pCommandId); + } else { + oss << loader::to_string(pCommandId); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to 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 zeCommandListGetNextCommandIdWithKernelsExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "desc="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && desc != nullptr) { + oss << loader::to_string(*desc); + } else { + oss << loader::to_string(desc); + } + + oss << ", "; + oss << "numKernels="; + oss << loader::to_string(numKernels); + + oss << ", "; + oss << "phKernels="; + oss << loader::to_string(phKernels); + + oss << ", "; + oss << "pCommandId="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { + oss << loader::to_string(*pCommandId); + } else { + oss << loader::to_string(pCommandId); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandsExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member +) { + // 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 zeCommandListUpdateMutableCommandsExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "desc="; + oss << loader::to_string(desc); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsMutableExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension +) { + // 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 zeCommandListIsMutableExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pIsMutable="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pIsMutable != nullptr) { + oss << loader::to_string(*pIsMutable); + } else { + oss << loader::to_string(pIsMutable); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion +) { + // 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 zeCommandListUpdateMutableCommandSignalEventExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "commandId="; + oss << loader::to_string(commandId); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching +) { + // 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 zeCommandListUpdateMutableCommandWaitEventsExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "commandId="; + oss << loader::to_string(commandId); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to +) { + // 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 zeCommandListUpdateMutableCommandKernelsExp("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "numKernels="; + oss << loader::to_string(numKernels); + + oss << ", "; + oss << "pCommandId="; + oss << loader::to_string(pCommandId); + + oss << ", "; + oss << "phKernels="; + oss << loader::to_string(phKernels); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + // Special function for zexCounterBasedEventCreate2 + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zexCounterBasedEventCreate2( + ze_result_t result, + ze_context_handle_t hContext, + ze_device_handle_t hDevice, + const void* desc, + ze_event_handle_t* phEvent + ) { + // 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 zexCounterBasedEventCreate2(" + << "hContext=" << static_cast(hContext) << ", " + << "hDevice=" << static_cast(hDevice) << ", " + << "desc=" << desc << ", " + << "phEvent="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phEvent != nullptr) { + oss << loader::to_string(*phEvent); + } else { + oss << static_cast(phEvent); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeInit __zedlllocal ze_result_t ZE_APICALL - zeInit( - ze_init_flags_t flags ///< [in] initialization flags. - ///< must be 0 (default) or a combination of ::ze_init_flag_t. + zeInit( + ze_init_flags_t flags ///< [in] initialization flags. + ///< must be 0 (default) or a combination of ::ze_init_flag_t. + ) + { + context.logger->log_trace("zeInit(flags)"); + + auto pfnInit = context.zeDdiTable.Global.pfnInit; + + if( nullptr == pfnInit ) + return logAndPropagateResult_zeInit(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, flags); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeInitPrologue( flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeInitPrologue( flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + } + + auto driver_result = pfnInit( flags ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeInitEpilogue( flags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + } + + return logAndPropagateResult_zeInit(driver_result, flags); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGet + __zedlllocal ze_result_t ZE_APICALL + zeDriverGet( + uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. + ///< if count is zero, then the loader shall update the value with the + ///< total number of drivers available. + ///< if count is greater than the number of drivers available, then the + ///< loader shall update the value with the correct number of drivers available. + ze_driver_handle_t* phDrivers ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. + ///< if count is less than the number of drivers available, then the loader + ///< shall only retrieve that number of drivers. + ) + { + context.logger->log_trace("zeDriverGet(pCount, phDrivers)"); + + auto pfnGet = context.zeDdiTable.Driver.pfnGet; + + if( nullptr == pfnGet ) + return logAndPropagateResult_zeDriverGet(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pCount, phDrivers); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPrologue( pCount, phDrivers ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetPrologue( pCount, phDrivers ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + } + + auto driver_result = pfnGet( pCount, phDrivers ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetEpilogue( pCount, phDrivers ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phDrivers) && (i < *pCount); ++i){ + if (phDrivers[i]){ + context.handleLifetime->addHandle( phDrivers[i] ); + context.handleLifetime->addDependent( pCount, phDrivers[i] ); + } + } + } + return logAndPropagateResult_zeDriverGet(driver_result, pCount, phDrivers); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeInitDrivers + __zedlllocal ze_result_t ZE_APICALL + zeInitDrivers( + uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. + ///< if count is zero, then the loader shall update the value with the + ///< total number of drivers available. + ///< if count is greater than the number of drivers available, then the + ///< loader shall update the value with the correct number of drivers available. + ze_driver_handle_t* phDrivers, ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. + ///< if count is less than the number of drivers available, then the loader + ///< shall only retrieve that number of drivers. + ze_init_driver_type_desc_t* desc ///< [in] descriptor containing the driver type initialization details + ///< including ::ze_init_driver_type_flag_t combinations. + ) + { + context.logger->log_trace("zeInitDrivers(pCount, phDrivers, desc)"); + + auto pfnInitDrivers = context.zeDdiTable.Global.pfnInitDrivers; + + if( nullptr == pfnInitDrivers ) + return logAndPropagateResult_zeInitDrivers(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pCount, phDrivers, desc); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeInitDriversPrologue( pCount, phDrivers, desc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeInitDriversPrologue( pCount, phDrivers, desc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + } + + auto driver_result = pfnInitDrivers( pCount, phDrivers, desc ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeInitDriversEpilogue( pCount, phDrivers, desc ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phDrivers) && (i < *pCount); ++i){ + if (phDrivers[i]){ + context.handleLifetime->addHandle( phDrivers[i] ); + context.handleLifetime->addDependent( pCount, phDrivers[i] ); + } + } + } + return logAndPropagateResult_zeInitDrivers(driver_result, pCount, phDrivers, desc); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetApiVersion + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetApiVersion( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + ze_api_version_t* version ///< [out] api version + ) + { + context.logger->log_trace("zeDriverGetApiVersion(hDriver, version)"); + + auto pfnGetApiVersion = context.zeDdiTable.Driver.pfnGetApiVersion; + + if( nullptr == pfnGetApiVersion ) + return logAndPropagateResult_zeDriverGetApiVersion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, version); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetApiVersionPrologue( hDriver, version ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetApiVersionPrologue( hDriver, version ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + } + + auto driver_result = pfnGetApiVersion( hDriver, version ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetApiVersionEpilogue( hDriver, version ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + } + + return logAndPropagateResult_zeDriverGetApiVersion(driver_result, hDriver, version); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetProperties + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetProperties( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + ze_driver_properties_t* pDriverProperties ///< [in,out] query result for driver properties + ) + { + context.logger->log_trace("zeDriverGetProperties(hDriver, pDriverProperties)"); + + auto pfnGetProperties = context.zeDdiTable.Driver.pfnGetProperties; + + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zeDriverGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDriverProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPropertiesPrologue( hDriver, pDriverProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetPropertiesPrologue( hDriver, pDriverProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + } + + auto driver_result = pfnGetProperties( hDriver, pDriverProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPropertiesEpilogue( hDriver, pDriverProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + } + + return logAndPropagateResult_zeDriverGetProperties(driver_result, hDriver, pDriverProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetIpcProperties + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetIpcProperties( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + ze_driver_ipc_properties_t* pIpcProperties ///< [in,out] query result for IPC properties + ) + { + context.logger->log_trace("zeDriverGetIpcProperties(hDriver, pIpcProperties)"); + + auto pfnGetIpcProperties = context.zeDdiTable.Driver.pfnGetIpcProperties; + + if( nullptr == pfnGetIpcProperties ) + return logAndPropagateResult_zeDriverGetIpcProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pIpcProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetIpcPropertiesPrologue( hDriver, pIpcProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetIpcPropertiesPrologue( hDriver, pIpcProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + } + + auto driver_result = pfnGetIpcProperties( hDriver, pIpcProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetIpcPropertiesEpilogue( hDriver, pIpcProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + } + + return logAndPropagateResult_zeDriverGetIpcProperties(driver_result, hDriver, pIpcProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetExtensionProperties + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetExtensionProperties( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of extension properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of extension properties available. + ///< if count is greater than the number of extension properties available, + ///< then the driver shall update the value with the correct number of + ///< extension properties available. + ze_driver_extension_properties_t* pExtensionProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< extension properties. + ///< if count is less than the number of extension properties available, + ///< then driver shall only retrieve that number of extension properties. + ) + { + context.logger->log_trace("zeDriverGetExtensionProperties(hDriver, pCount, pExtensionProperties)"); + + auto pfnGetExtensionProperties = context.zeDdiTable.Driver.pfnGetExtensionProperties; + + if( nullptr == pfnGetExtensionProperties ) + return logAndPropagateResult_zeDriverGetExtensionProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, pExtensionProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionPropertiesPrologue( hDriver, pCount, pExtensionProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetExtensionPropertiesPrologue( hDriver, pCount, pExtensionProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + } + + auto driver_result = pfnGetExtensionProperties( hDriver, pCount, pExtensionProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionPropertiesEpilogue( hDriver, pCount, pExtensionProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + } + + return logAndPropagateResult_zeDriverGetExtensionProperties(driver_result, hDriver, pCount, pExtensionProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetExtensionFunctionAddress + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetExtensionFunctionAddress( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + const char* name, ///< [in] extension function name + void** ppFunctionAddress ///< [out] pointer to function pointer + ) + { + context.logger->log_trace("zeDriverGetExtensionFunctionAddress(hDriver, name, ppFunctionAddress)"); + + auto pfnGetExtensionFunctionAddress = context.zeDdiTable.Driver.pfnGetExtensionFunctionAddress; + + if( nullptr == pfnGetExtensionFunctionAddress ) + return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, name, ppFunctionAddress); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionFunctionAddressPrologue( hDriver, name, ppFunctionAddress ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetExtensionFunctionAddressPrologue( hDriver, name, ppFunctionAddress ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + } + + auto driver_result = pfnGetExtensionFunctionAddress( hDriver, name, ppFunctionAddress ); + + // For Intel experimental extensions, we need to return our validation layer function + // instead of the raw driver function so that validation/leak tracking works + if (driver_result == ZE_RESULT_SUCCESS && ppFunctionAddress && name) { + if (strcmp(name, "zexCounterBasedEventCreate2") == 0) { + // Return our validation layer intercept function instead of the raw driver function + *ppFunctionAddress = (void*)zexCounterBasedEventCreate2; + } + } + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionFunctionAddressEpilogue( hDriver, name, ppFunctionAddress ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + } + + return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(driver_result, hDriver, name, ppFunctionAddress); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetLastErrorDescription + __zedlllocal ze_result_t ZE_APICALL + zeDriverGetLastErrorDescription( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + const char** ppString ///< [in,out] pointer to a null-terminated array of characters describing + ///< cause of error. + ) + { + context.logger->log_trace("zeDriverGetLastErrorDescription(hDriver, ppString)"); + + auto pfnGetLastErrorDescription = context.zeDdiTable.Driver.pfnGetLastErrorDescription; + + if( nullptr == pfnGetLastErrorDescription ) + return logAndPropagateResult_zeDriverGetLastErrorDescription(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, ppString); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetLastErrorDescriptionPrologue( hDriver, ppString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetLastErrorDescriptionPrologue( hDriver, ppString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + } + + auto driver_result = pfnGetLastErrorDescription( hDriver, ppString ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetLastErrorDescriptionEpilogue( hDriver, ppString ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + } + + return logAndPropagateResult_zeDriverGetLastErrorDescription(driver_result, hDriver, ppString); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverGetDefaultContext + __zedlllocal ze_context_handle_t ZE_APICALL + zeDriverGetDefaultContext( + ze_driver_handle_t hDriver ///< [in] handle of the driver instance + ) + { + context.logger->log_trace("zeDriverGetDefaultContext(hDriver)"); + + auto pfnGetDefaultContext = context.zeDdiTable.Driver.pfnGetDefaultContext; + + if( nullptr == pfnGetDefaultContext ) + return nullptr; + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetDefaultContextPrologue( hDriver ); + if(result!=ZE_RESULT_SUCCESS) return nullptr; + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetDefaultContextPrologue( hDriver ); + if(result!=ZE_RESULT_SUCCESS) return nullptr; + } + + auto driver_result = pfnGetDefaultContext( hDriver ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDriverGetDefaultContextEpilogue( hDriver ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return nullptr; + } + + return driver_result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGet + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGet( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of devices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of devices available. + ///< if count is greater than the number of devices available, then the + ///< driver shall update the value with the correct number of devices available. + ze_device_handle_t* phDevices ///< [in,out][optional][range(0, *pCount)] array of handle of devices. + ///< if count is less than the number of devices available, then driver + ///< shall only retrieve that number of devices. + ) + { + context.logger->log_trace("zeDeviceGet(hDriver, pCount, phDevices)"); + + auto pfnGet = context.zeDdiTable.Device.pfnGet; + + if( nullptr == pfnGet ) + return logAndPropagateResult_zeDeviceGet(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, phDevices); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPrologue( hDriver, pCount, phDevices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetPrologue( hDriver, pCount, phDevices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + } + + auto driver_result = pfnGet( hDriver, pCount, phDevices ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetEpilogue( hDriver, pCount, phDevices ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phDevices) && (i < *pCount); ++i){ + if (phDevices[i]){ + context.handleLifetime->addHandle( phDevices[i] ); + context.handleLifetime->addDependent( hDriver, phDevices[i] ); + } + } + } + return logAndPropagateResult_zeDeviceGet(driver_result, hDriver, pCount, phDevices); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetRootDevice + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetRootDevice( + ze_device_handle_t hDevice, ///< [in] handle of the device object + ze_device_handle_t* phRootDevice ///< [in,out] parent root device. + ) + { + context.logger->log_trace("zeDeviceGetRootDevice(hDevice, phRootDevice)"); + + auto pfnGetRootDevice = context.zeDdiTable.Device.pfnGetRootDevice; + + if( nullptr == pfnGetRootDevice ) + return logAndPropagateResult_zeDeviceGetRootDevice(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, phRootDevice); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRootDevicePrologue( hDevice, phRootDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRootDevicePrologue( hDevice, phRootDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + } + + auto driver_result = pfnGetRootDevice( hDevice, phRootDevice ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRootDeviceEpilogue( hDevice, phRootDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + } + + return logAndPropagateResult_zeDeviceGetRootDevice(driver_result, hDevice, phRootDevice); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetSubDevices + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetSubDevices( + ze_device_handle_t hDevice, ///< [in] handle of the device object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-devices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-devices available. + ///< if count is greater than the number of sub-devices available, then the + ///< driver shall update the value with the correct number of sub-devices available. + ze_device_handle_t* phSubdevices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-devices. + ///< if count is less than the number of sub-devices available, then driver + ///< shall only retrieve that number of sub-devices. + ) + { + context.logger->log_trace("zeDeviceGetSubDevices(hDevice, pCount, phSubdevices)"); + + auto pfnGetSubDevices = context.zeDdiTable.Device.pfnGetSubDevices; + + if( nullptr == pfnGetSubDevices ) + return logAndPropagateResult_zeDeviceGetSubDevices(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, phSubdevices); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetSubDevicesPrologue( hDevice, pCount, phSubdevices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetSubDevicesPrologue( hDevice, pCount, phSubdevices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + } + + auto driver_result = pfnGetSubDevices( hDevice, pCount, phSubdevices ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetSubDevicesEpilogue( hDevice, pCount, phSubdevices ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phSubdevices) && (i < *pCount); ++i){ + if (phSubdevices[i]){ + context.handleLifetime->addHandle( phSubdevices[i] ); + context.handleLifetime->addDependent( hDevice, phSubdevices[i] ); + } + } + } + return logAndPropagateResult_zeDeviceGetSubDevices(driver_result, hDevice, pCount, phSubdevices); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_properties_t* pDeviceProperties ///< [in,out] query result for device properties + ) + { + context.logger->log_trace("zeDeviceGetProperties(hDevice, pDeviceProperties)"); + + auto pfnGetProperties = context.zeDdiTable.Device.pfnGetProperties; + + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zeDeviceGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pDeviceProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPropertiesPrologue( hDevice, pDeviceProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetPropertiesPrologue( hDevice, pDeviceProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + } + + auto driver_result = pfnGetProperties( hDevice, pDeviceProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPropertiesEpilogue( hDevice, pDeviceProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + } + + return logAndPropagateResult_zeDeviceGetProperties(driver_result, hDevice, pDeviceProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetComputeProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetComputeProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compute_properties_t* pComputeProperties ///< [in,out] query result for compute properties + ) + { + context.logger->log_trace("zeDeviceGetComputeProperties(hDevice, pComputeProperties)"); + + auto pfnGetComputeProperties = context.zeDdiTable.Device.pfnGetComputeProperties; + + if( nullptr == pfnGetComputeProperties ) + return logAndPropagateResult_zeDeviceGetComputeProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pComputeProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetComputePropertiesPrologue( hDevice, pComputeProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetComputePropertiesPrologue( hDevice, pComputeProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + } + + auto driver_result = pfnGetComputeProperties( hDevice, pComputeProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetComputePropertiesEpilogue( hDevice, pComputeProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + } + + return logAndPropagateResult_zeDeviceGetComputeProperties(driver_result, hDevice, pComputeProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetModuleProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetModuleProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_module_properties_t* pModuleProperties///< [in,out] query result for module properties + ) + { + context.logger->log_trace("zeDeviceGetModuleProperties(hDevice, pModuleProperties)"); + + auto pfnGetModuleProperties = context.zeDdiTable.Device.pfnGetModuleProperties; + + if( nullptr == pfnGetModuleProperties ) + return logAndPropagateResult_zeDeviceGetModuleProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pModuleProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetModulePropertiesPrologue( hDevice, pModuleProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetModulePropertiesPrologue( hDevice, pModuleProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + } + + auto driver_result = pfnGetModuleProperties( hDevice, pModuleProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetModulePropertiesEpilogue( hDevice, pModuleProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + } + + return logAndPropagateResult_zeDeviceGetModuleProperties(driver_result, hDevice, pModuleProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCommandQueueGroupProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCommandQueueGroupProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of available command queue groups. + ///< If count is zero, then the driver shall update the value with the + ///< total number of command queue groups available. + ///< If count is less than the number of command queue groups available, + ///< then the driver shall only retrieve command queue group properties for + ///< the given number of command queue groups. + ///< If count is greater than or equal to the number of command queue + ///< groups available, then the driver shall retrieve command queue group + ///< properties for all available command queue groups. + ze_command_queue_group_properties_t* pCommandQueueGroupProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< command queue group properties. + ///< If count is less than the number of command queue groups available, + ///< then the driver shall only retrieve that number of command queue group properties. + ///< The order of properties in the array corresponds to the command queue + ///< group ordinal. + ) + { + context.logger->log_trace("zeDeviceGetCommandQueueGroupProperties(hDevice, pCount, pCommandQueueGroupProperties)"); + + auto pfnGetCommandQueueGroupProperties = context.zeDdiTable.Device.pfnGetCommandQueueGroupProperties; + + if( nullptr == pfnGetCommandQueueGroupProperties ) + return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pCommandQueueGroupProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCommandQueueGroupPropertiesPrologue( hDevice, pCount, pCommandQueueGroupProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCommandQueueGroupPropertiesPrologue( hDevice, pCount, pCommandQueueGroupProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + } + + auto driver_result = pfnGetCommandQueueGroupProperties( hDevice, pCount, pCommandQueueGroupProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCommandQueueGroupPropertiesEpilogue( hDevice, pCount, pCommandQueueGroupProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + } + + return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(driver_result, hDevice, pCount, pCommandQueueGroupProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetMemoryProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetMemoryProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of memory properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of memory properties available. + ///< if 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. + ze_device_memory_properties_t* pMemProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< memory properties. + ///< if count is less than the number of memory properties available, then + ///< driver shall only retrieve that number of memory properties. + ) + { + context.logger->log_trace("zeDeviceGetMemoryProperties(hDevice, pCount, pMemProperties)"); + + auto pfnGetMemoryProperties = context.zeDdiTable.Device.pfnGetMemoryProperties; + + if( nullptr == pfnGetMemoryProperties ) + return logAndPropagateResult_zeDeviceGetMemoryProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pMemProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryPropertiesPrologue( hDevice, pCount, pMemProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetMemoryPropertiesPrologue( hDevice, pCount, pMemProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + } + + auto driver_result = pfnGetMemoryProperties( hDevice, pCount, pMemProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryPropertiesEpilogue( hDevice, pCount, pMemProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + } + + return logAndPropagateResult_zeDeviceGetMemoryProperties(driver_result, hDevice, pCount, pMemProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetMemoryAccessProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetMemoryAccessProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_memory_access_properties_t* pMemAccessProperties ///< [in,out] query result for memory access properties + ) + { + context.logger->log_trace("zeDeviceGetMemoryAccessProperties(hDevice, pMemAccessProperties)"); + + auto pfnGetMemoryAccessProperties = context.zeDdiTable.Device.pfnGetMemoryAccessProperties; + + if( nullptr == pfnGetMemoryAccessProperties ) + return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pMemAccessProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryAccessPropertiesPrologue( hDevice, pMemAccessProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetMemoryAccessPropertiesPrologue( hDevice, pMemAccessProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + } + + auto driver_result = pfnGetMemoryAccessProperties( hDevice, pMemAccessProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryAccessPropertiesEpilogue( hDevice, pMemAccessProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + } + + return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(driver_result, hDevice, pMemAccessProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCacheProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCacheProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of cache properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of cache properties available. + ///< if count is greater than the number of cache properties available, + ///< then the driver shall update the value with the correct number of + ///< cache properties available. + ze_device_cache_properties_t* pCacheProperties ///< [in,out][optional][range(0, *pCount)] array of query results for cache properties. + ///< if count is less than the number of cache properties available, then + ///< driver shall only retrieve that number of cache properties. + ) + { + context.logger->log_trace("zeDeviceGetCacheProperties(hDevice, pCount, pCacheProperties)"); + + auto pfnGetCacheProperties = context.zeDdiTable.Device.pfnGetCacheProperties; + + if( nullptr == pfnGetCacheProperties ) + return logAndPropagateResult_zeDeviceGetCacheProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pCacheProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCachePropertiesPrologue( hDevice, pCount, pCacheProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCachePropertiesPrologue( hDevice, pCount, pCacheProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + } + + auto driver_result = pfnGetCacheProperties( hDevice, pCount, pCacheProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCachePropertiesEpilogue( hDevice, pCount, pCacheProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + } + + return logAndPropagateResult_zeDeviceGetCacheProperties(driver_result, hDevice, pCount, pCacheProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetImageProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetImageProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_image_properties_t* pImageProperties ///< [in,out] query result for image properties + ) + { + context.logger->log_trace("zeDeviceGetImageProperties(hDevice, pImageProperties)"); + + auto pfnGetImageProperties = context.zeDdiTable.Device.pfnGetImageProperties; + + if( nullptr == pfnGetImageProperties ) + return logAndPropagateResult_zeDeviceGetImageProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pImageProperties); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetImagePropertiesPrologue( hDevice, pImageProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetImagePropertiesPrologue( hDevice, pImageProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + } + + auto driver_result = pfnGetImageProperties( hDevice, pImageProperties ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetImagePropertiesEpilogue( hDevice, pImageProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + } + + return logAndPropagateResult_zeDeviceGetImageProperties(driver_result, hDevice, pImageProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetExternalMemoryProperties + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetExternalMemoryProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_external_memory_properties_t* pExternalMemoryProperties ///< [in,out] query result for external memory properties ) { - context.logger->log_trace("zeInit(flags)"); + context.logger->log_trace("zeDeviceGetExternalMemoryProperties(hDevice, pExternalMemoryProperties)"); - auto pfnInit = context.zeDdiTable.Global.pfnInit; + auto pfnGetExternalMemoryProperties = context.zeDdiTable.Device.pfnGetExternalMemoryProperties; - if( nullptr == pfnInit ) - return logAndPropagateResult_zeInit(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, flags); + if( nullptr == pfnGetExternalMemoryProperties ) + return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pExternalMemoryProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeInitPrologue( flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetExternalMemoryPropertiesPrologue( hDevice, pExternalMemoryProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); } @@ -7629,45 +9417,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeInitPrologue( flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetExternalMemoryPropertiesPrologue( hDevice, pExternalMemoryProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); } - auto driver_result = pfnInit( flags ); + auto driver_result = pfnGetExternalMemoryProperties( hDevice, pExternalMemoryProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeInitEpilogue( flags ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInit(result, flags); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetExternalMemoryPropertiesEpilogue( hDevice, pExternalMemoryProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); } - return logAndPropagateResult_zeInit(driver_result, flags); + return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(driver_result, hDevice, pExternalMemoryProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGet + /// @brief Intercept function for zeDeviceGetP2PProperties __zedlllocal ze_result_t ZE_APICALL - zeDriverGet( - uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. - ///< if count is zero, then the loader shall update the value with the - ///< total number of drivers available. - ///< if count is greater than the number of drivers available, then the - ///< loader shall update the value with the correct number of drivers available. - ze_driver_handle_t* phDrivers ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. - ///< if count is less than the number of drivers available, then the loader - ///< shall only retrieve that number of drivers. + zeDeviceGetP2PProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device performing the access + ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation + ze_device_p2p_properties_t* pP2PProperties ///< [in,out] Peer-to-Peer properties between source and peer device ) { - context.logger->log_trace("zeDriverGet(pCount, phDrivers)"); + context.logger->log_trace("zeDeviceGetP2PProperties(hDevice, hPeerDevice, pP2PProperties)"); - auto pfnGet = context.zeDdiTable.Driver.pfnGet; + auto pfnGetP2PProperties = context.zeDdiTable.Device.pfnGetP2PProperties; - if( nullptr == pfnGet ) - return logAndPropagateResult_zeDriverGet(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pCount, phDrivers); + if( nullptr == pfnGetP2PProperties ) + return logAndPropagateResult_zeDeviceGetP2PProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hPeerDevice, pP2PProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPrologue( pCount, phDrivers ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetP2PPropertiesPrologue( hDevice, hPeerDevice, pP2PProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); } @@ -7677,57 +9460,214 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetPrologue( pCount, phDrivers ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetP2PPropertiesPrologue( hDevice, hPeerDevice, pP2PProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); } - auto driver_result = pfnGet( pCount, phDrivers ); + auto driver_result = pfnGetP2PProperties( hDevice, hPeerDevice, pP2PProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetEpilogue( pCount, phDrivers ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGet(result, pCount, phDrivers); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetP2PPropertiesEpilogue( hDevice, hPeerDevice, pP2PProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); } + return logAndPropagateResult_zeDeviceGetP2PProperties(driver_result, hDevice, hPeerDevice, pP2PProperties); + } - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phDrivers) && (i < *pCount); ++i){ - if (phDrivers[i]){ - context.handleLifetime->addHandle( phDrivers[i] ); - context.handleLifetime->addDependent( pCount, phDrivers[i] ); - } - } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceCanAccessPeer + __zedlllocal ze_result_t ZE_APICALL + zeDeviceCanAccessPeer( + ze_device_handle_t hDevice, ///< [in] handle of the device performing the access + ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation + ze_bool_t* value ///< [out] returned access capability + ) + { + context.logger->log_trace("zeDeviceCanAccessPeer(hDevice, hPeerDevice, value)"); + + auto pfnCanAccessPeer = context.zeDdiTable.Device.pfnCanAccessPeer; + + if( nullptr == pfnCanAccessPeer ) + return logAndPropagateResult_zeDeviceCanAccessPeer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hPeerDevice, value); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceCanAccessPeerPrologue( hDevice, hPeerDevice, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); } - return logAndPropagateResult_zeDriverGet(driver_result, pCount, phDrivers); + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceCanAccessPeerPrologue( hDevice, hPeerDevice, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); + } + + auto driver_result = pfnCanAccessPeer( hDevice, hPeerDevice, value ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceCanAccessPeerEpilogue( hDevice, hPeerDevice, value ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); + } + + return logAndPropagateResult_zeDeviceCanAccessPeer(driver_result, hDevice, hPeerDevice, value); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeInitDrivers + /// @brief Intercept function for zeDeviceGetStatus __zedlllocal ze_result_t ZE_APICALL - zeInitDrivers( - uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. - ///< if count is zero, then the loader shall update the value with the - ///< total number of drivers available. - ///< if count is greater than the number of drivers available, then the - ///< loader shall update the value with the correct number of drivers available. - ze_driver_handle_t* phDrivers, ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. - ///< if count is less than the number of drivers available, then the loader - ///< shall only retrieve that number of drivers. - ze_init_driver_type_desc_t* desc ///< [in] descriptor containing the driver type initialization details - ///< including ::ze_init_driver_type_flag_t combinations. + zeDeviceGetStatus( + ze_device_handle_t hDevice ///< [in] handle of the device + ) + { + context.logger->log_trace("zeDeviceGetStatus(hDevice)"); + + auto pfnGetStatus = context.zeDdiTable.Device.pfnGetStatus; + + if( nullptr == pfnGetStatus ) + return logAndPropagateResult_zeDeviceGetStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetStatusPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetStatusPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + } + + auto driver_result = pfnGetStatus( hDevice ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetStatusEpilogue( hDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + } + + return logAndPropagateResult_zeDeviceGetStatus(driver_result, hDevice); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetGlobalTimestamps + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetGlobalTimestamps( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) + ) + { + context.logger->log_trace("zeDeviceGetGlobalTimestamps(hDevice, hostTimestamp, deviceTimestamp)"); + + auto pfnGetGlobalTimestamps = context.zeDdiTable.Device.pfnGetGlobalTimestamps; + + if( nullptr == pfnGetGlobalTimestamps ) + return logAndPropagateResult_zeDeviceGetGlobalTimestamps(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hostTimestamp, deviceTimestamp); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetGlobalTimestampsPrologue( hDevice, hostTimestamp, deviceTimestamp ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetGlobalTimestampsPrologue( hDevice, hostTimestamp, deviceTimestamp ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + } + + auto driver_result = pfnGetGlobalTimestamps( hDevice, hostTimestamp, deviceTimestamp ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetGlobalTimestampsEpilogue( hDevice, hostTimestamp, deviceTimestamp ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + } + + return logAndPropagateResult_zeDeviceGetGlobalTimestamps(driver_result, hDevice, hostTimestamp, deviceTimestamp); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceSynchronize + __zedlllocal ze_result_t ZE_APICALL + zeDeviceSynchronize( + ze_device_handle_t hDevice ///< [in] handle of the device + ) + { + context.logger->log_trace("zeDeviceSynchronize(hDevice)"); + + auto pfnSynchronize = context.zeDdiTable.Device.pfnSynchronize; + + if( nullptr == pfnSynchronize ) + return logAndPropagateResult_zeDeviceSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceSynchronizePrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceSynchronizePrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + } + + auto driver_result = pfnSynchronize( hDevice ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceSynchronizeEpilogue( hDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + } + + return logAndPropagateResult_zeDeviceSynchronize(driver_result, hDevice); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetAggregatedCopyOffloadIncrementValue + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetAggregatedCopyOffloadIncrementValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* incrementValue ///< [out] increment value that can be used for Event creation ) { - context.logger->log_trace("zeInitDrivers(pCount, phDrivers, desc)"); + context.logger->log_trace("zeDeviceGetAggregatedCopyOffloadIncrementValue(hDevice, incrementValue)"); - auto pfnInitDrivers = context.zeDdiTable.Global.pfnInitDrivers; + auto pfnGetAggregatedCopyOffloadIncrementValue = context.zeDdiTable.Device.pfnGetAggregatedCopyOffloadIncrementValue; - if( nullptr == pfnInitDrivers ) - return logAndPropagateResult_zeInitDrivers(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pCount, phDrivers, desc); + if( nullptr == pfnGetAggregatedCopyOffloadIncrementValue ) + return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, incrementValue); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeInitDriversPrologue( pCount, phDrivers, desc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( hDevice, incrementValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); } @@ -7737,48 +9677,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeInitDriversPrologue( pCount, phDrivers, desc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( hDevice, incrementValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); } - auto driver_result = pfnInitDrivers( pCount, phDrivers, desc ); + auto driver_result = pfnGetAggregatedCopyOffloadIncrementValue( hDevice, incrementValue ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeInitDriversEpilogue( pCount, phDrivers, desc ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeInitDrivers(result, pCount, phDrivers, desc); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetAggregatedCopyOffloadIncrementValueEpilogue( hDevice, incrementValue ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - for (size_t i = 0; ( nullptr != phDrivers) && (i < *pCount); ++i){ - if (phDrivers[i]){ - context.handleLifetime->addHandle( phDrivers[i] ); - context.handleLifetime->addDependent( pCount, phDrivers[i] ); - } - } - } - return logAndPropagateResult_zeInitDrivers(driver_result, pCount, phDrivers, desc); + return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(driver_result, hDevice, incrementValue); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetApiVersion + /// @brief Intercept function for zeDeviceGetCounterBasedEventMaxValue __zedlllocal ze_result_t ZE_APICALL - zeDriverGetApiVersion( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - ze_api_version_t* version ///< [out] api version + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event ) { - context.logger->log_trace("zeDriverGetApiVersion(hDriver, version)"); + context.logger->log_trace("zeDeviceGetCounterBasedEventMaxValue(hDevice, maxValue)"); - auto pfnGetApiVersion = context.zeDdiTable.Driver.pfnGetApiVersion; + auto pfnGetCounterBasedEventMaxValue = context.zeDdiTable.Device.pfnGetCounterBasedEventMaxValue; - if( nullptr == pfnGetApiVersion ) - return logAndPropagateResult_zeDriverGetApiVersion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, version); + if( nullptr == pfnGetCounterBasedEventMaxValue ) + return logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, maxValue); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetApiVersionPrologue( hDriver, version ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCounterBasedEventMaxValuePrologue( hDevice, maxValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue(result, hDevice, maxValue); } @@ -7788,39 +9721,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetApiVersionPrologue( hDriver, version ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCounterBasedEventMaxValuePrologue( hDevice, maxValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue(result, hDevice, maxValue); } - auto driver_result = pfnGetApiVersion( hDriver, version ); + auto driver_result = pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetApiVersionEpilogue( hDriver, version ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetApiVersion(result, hDriver, version); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCounterBasedEventMaxValueEpilogue( hDevice, maxValue ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue(result, hDevice, maxValue); } - return logAndPropagateResult_zeDriverGetApiVersion(driver_result, hDriver, version); + return logAndPropagateResult_zeDeviceGetCounterBasedEventMaxValue(driver_result, hDevice, maxValue); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetProperties + /// @brief Intercept function for zeDeviceGetRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL - zeDriverGetProperties( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - ze_driver_properties_t* pDriverProperties ///< [in,out] query result for driver properties + zeDeviceGetRuntimeRequirements( + ze_device_handle_t hDevice, ///< [in] handle of the device + const void* pObjDesc, ///< [in] describes the object for which the requirements are to be + ///< gathered + size_t* pSize, ///< [in,out] size of requirements string in bytes. + char* pRequirements ///< [in,out][optional] holds results of the query. ) { - context.logger->log_trace("zeDriverGetProperties(hDriver, pDriverProperties)"); + context.logger->log_trace("zeDeviceGetRuntimeRequirements(hDevice, pObjDesc, pSize, pRequirements)"); - auto pfnGetProperties = context.zeDdiTable.Driver.pfnGetProperties; + auto pfnGetRuntimeRequirements = context.zeDdiTable.Device.pfnGetRuntimeRequirements; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zeDriverGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDriverProperties); + if( nullptr == pfnGetRuntimeRequirements ) + return logAndPropagateResult_zeDeviceGetRuntimeRequirements(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pObjDesc, pSize, pRequirements); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPropertiesPrologue( hDriver, pDriverProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsPrologue( hDevice, pObjDesc, pSize, pRequirements ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); } @@ -7830,39 +9766,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetPropertiesPrologue( hDriver, pDriverProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRuntimeRequirementsPrologue( hDevice, pObjDesc, pSize, pRequirements ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); } - auto driver_result = pfnGetProperties( hDriver, pDriverProperties ); + auto driver_result = pfnGetRuntimeRequirements( hDevice, pObjDesc, pSize, pRequirements ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetPropertiesEpilogue( hDriver, pDriverProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetProperties(result, hDriver, pDriverProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsEpilogue( hDevice, pObjDesc, pSize, pRequirements ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); } - return logAndPropagateResult_zeDriverGetProperties(driver_result, hDriver, pDriverProperties); + return logAndPropagateResult_zeDeviceGetRuntimeRequirements(driver_result, hDevice, pObjDesc, pSize, pRequirements); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetIpcProperties + /// @brief Intercept function for zeDeviceGetRuntimeRequirementsKey __zedlllocal ze_result_t ZE_APICALL - zeDriverGetIpcProperties( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - ze_driver_ipc_properties_t* pIpcProperties ///< [in,out] query result for IPC properties + zeDeviceGetRuntimeRequirementsKey( + ze_device_handle_t hDevice, ///< [in] handle of the device + const char** pKey ///< [out] returned key ) { - context.logger->log_trace("zeDriverGetIpcProperties(hDriver, pIpcProperties)"); + context.logger->log_trace("zeDeviceGetRuntimeRequirementsKey(hDevice, pKey)"); - auto pfnGetIpcProperties = context.zeDdiTable.Driver.pfnGetIpcProperties; + auto pfnGetRuntimeRequirementsKey = context.zeDdiTable.Device.pfnGetRuntimeRequirementsKey; - if( nullptr == pfnGetIpcProperties ) - return logAndPropagateResult_zeDriverGetIpcProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pIpcProperties); + if( nullptr == pfnGetRuntimeRequirementsKey ) + return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pKey); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetIpcPropertiesPrologue( hDriver, pIpcProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsKeyPrologue( hDevice, pKey ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); } @@ -7872,48 +9808,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetIpcPropertiesPrologue( hDriver, pIpcProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRuntimeRequirementsKeyPrologue( hDevice, pKey ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); } - auto driver_result = pfnGetIpcProperties( hDriver, pIpcProperties ); + auto driver_result = pfnGetRuntimeRequirementsKey( hDevice, pKey ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetIpcPropertiesEpilogue( hDriver, pIpcProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetIpcProperties(result, hDriver, pIpcProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsKeyEpilogue( hDevice, pKey ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); } - return logAndPropagateResult_zeDriverGetIpcProperties(driver_result, hDriver, pIpcProperties); + return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(driver_result, hDevice, pKey); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetExtensionProperties + /// @brief Intercept function for zeDeviceValidateRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL - zeDriverGetExtensionProperties( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of extension properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of extension properties available. - ///< if count is greater than the number of extension properties available, - ///< then the driver shall update the value with the correct number of - ///< extension properties available. - ze_driver_extension_properties_t* pExtensionProperties ///< [in,out][optional][range(0, *pCount)] array of query results for - ///< extension properties. - ///< if count is less than the number of extension properties available, - ///< then driver shall only retrieve that number of extension properties. + zeDeviceValidateRuntimeRequirements( + ze_device_handle_t hDevice, ///< [in] handle of the device + const char* pRequirements, ///< [in] requirements to be validated. Requirements should be + ///< null-terminated plain text representation of runtime requirements + ///< previously retrieved from the device. + ze_validate_runtime_requirements_output_t* pOut ///< [in][out] Output of the validation call. ) { - context.logger->log_trace("zeDriverGetExtensionProperties(hDriver, pCount, pExtensionProperties)"); + context.logger->log_trace("zeDeviceValidateRuntimeRequirements(hDevice, pRequirements, pOut)"); - auto pfnGetExtensionProperties = context.zeDdiTable.Driver.pfnGetExtensionProperties; + auto pfnValidateRuntimeRequirements = context.zeDdiTable.Device.pfnValidateRuntimeRequirements; - if( nullptr == pfnGetExtensionProperties ) - return logAndPropagateResult_zeDriverGetExtensionProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, pExtensionProperties); + if( nullptr == pfnValidateRuntimeRequirements ) + return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pRequirements, pOut); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionPropertiesPrologue( hDriver, pCount, pExtensionProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceValidateRuntimeRequirementsPrologue( hDevice, pRequirements, pOut ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); } @@ -7923,40 +9853,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetExtensionPropertiesPrologue( hDriver, pCount, pExtensionProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceValidateRuntimeRequirementsPrologue( hDevice, pRequirements, pOut ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); } - auto driver_result = pfnGetExtensionProperties( hDriver, pCount, pExtensionProperties ); + auto driver_result = pfnValidateRuntimeRequirements( hDevice, pRequirements, pOut ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionPropertiesEpilogue( hDriver, pCount, pExtensionProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionProperties(result, hDriver, pCount, pExtensionProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceValidateRuntimeRequirementsEpilogue( hDevice, pRequirements, pOut ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); } - return logAndPropagateResult_zeDriverGetExtensionProperties(driver_result, hDriver, pCount, pExtensionProperties); + return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(driver_result, hDevice, pRequirements, pOut); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetExtensionFunctionAddress + /// @brief Intercept function for zeContextCreate __zedlllocal ze_result_t ZE_APICALL - zeDriverGetExtensionFunctionAddress( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - const char* name, ///< [in] extension function name - void** ppFunctionAddress ///< [out] pointer to function pointer + zeContextCreate( + ze_driver_handle_t hDriver, ///< [in] handle of the driver object + const ze_context_desc_t* desc, ///< [in] pointer to context descriptor + ze_context_handle_t* phContext ///< [out] pointer to handle of context object created ) { - context.logger->log_trace("zeDriverGetExtensionFunctionAddress(hDriver, name, ppFunctionAddress)"); + context.logger->log_trace("zeContextCreate(hDriver, desc, phContext)"); - auto pfnGetExtensionFunctionAddress = context.zeDdiTable.Driver.pfnGetExtensionFunctionAddress; + auto pfnCreate = context.zeDdiTable.Context.pfnCreate; - if( nullptr == pfnGetExtensionFunctionAddress ) - return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, name, ppFunctionAddress); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeContextCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, desc, phContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionFunctionAddressPrologue( hDriver, name, ppFunctionAddress ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + auto result = context.validationHandlers[i]->zeValidation->zeContextCreatePrologue( hDriver, desc, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); } @@ -7966,49 +9896,59 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetExtensionFunctionAddressPrologue( hDriver, name, ppFunctionAddress ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + auto result = context.handleLifetime->zeHandleLifetime.zeContextCreatePrologue( hDriver, desc, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); } - auto driver_result = pfnGetExtensionFunctionAddress( hDriver, name, ppFunctionAddress ); - - // For Intel experimental extensions, we need to return our validation layer function - // instead of the raw driver function so that validation/leak tracking works - if (driver_result == ZE_RESULT_SUCCESS && ppFunctionAddress && name) { - if (strcmp(name, "zexCounterBasedEventCreate2") == 0) { - // Return our validation layer intercept function instead of the raw driver function - *ppFunctionAddress = (void*)zexCounterBasedEventCreate2; - } - } + auto driver_result = pfnCreate( hDriver, desc, phContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetExtensionFunctionAddressEpilogue( hDriver, name, ppFunctionAddress ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(result, hDriver, name, ppFunctionAddress); + auto result = context.validationHandlers[i]->zeValidation->zeContextCreateEpilogue( hDriver, desc, phContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); } - return logAndPropagateResult_zeDriverGetExtensionFunctionAddress(driver_result, hDriver, name, ppFunctionAddress); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phContext){ + context.handleLifetime->addHandle( *phContext ); + context.handleLifetime->addDependent( hDriver, *phContext ); + + } + } + return logAndPropagateResult_zeContextCreate(driver_result, hDriver, desc, phContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetLastErrorDescription + /// @brief Intercept function for zeContextCreateEx __zedlllocal ze_result_t ZE_APICALL - zeDriverGetLastErrorDescription( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - const char** ppString ///< [in,out] pointer to a null-terminated array of characters describing - ///< cause of error. + zeContextCreateEx( + ze_driver_handle_t hDriver, ///< [in] handle of the driver object + const ze_context_desc_t* desc, ///< [in] pointer to context descriptor + uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == + ///< phDevices` + ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which + ///< context has visibility. + ///< if nullptr, then all devices and any sub-devices supported by the + ///< driver instance are + ///< visible to the context. + ///< otherwise, the context only has visibility to the devices and any + ///< sub-devices of the + ///< devices in this array. + ze_context_handle_t* phContext ///< [out] pointer to handle of context object created ) { - context.logger->log_trace("zeDriverGetLastErrorDescription(hDriver, ppString)"); + context.logger->log_trace("zeContextCreateEx(hDriver, desc, numDevices, phDevicesLocal, phContext)"); - auto pfnGetLastErrorDescription = context.zeDdiTable.Driver.pfnGetLastErrorDescription; + auto pfnCreateEx = context.zeDdiTable.Context.pfnCreateEx; - if( nullptr == pfnGetLastErrorDescription ) - return logAndPropagateResult_zeDriverGetLastErrorDescription(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, ppString); + if( nullptr == pfnCreateEx ) + return logAndPropagateResult_zeContextCreateEx(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, desc, numDevices, phDevices, phContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetLastErrorDescriptionPrologue( hDriver, ppString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + auto result = context.validationHandlers[i]->zeValidation->zeContextCreateExPrologue( hDriver, desc, numDevices, phDevices, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); } @@ -8018,38 +9958,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetLastErrorDescriptionPrologue( hDriver, ppString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + auto result = context.handleLifetime->zeHandleLifetime.zeContextCreateExPrologue( hDriver, desc, numDevices, phDevices, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); } - auto driver_result = pfnGetLastErrorDescription( hDriver, ppString ); + auto driver_result = pfnCreateEx( hDriver, desc, numDevices, phDevices, phContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetLastErrorDescriptionEpilogue( hDriver, ppString ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverGetLastErrorDescription(result, hDriver, ppString); + auto result = context.validationHandlers[i]->zeValidation->zeContextCreateExEpilogue( hDriver, desc, numDevices, phDevices, phContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); } - return logAndPropagateResult_zeDriverGetLastErrorDescription(driver_result, hDriver, ppString); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phContext){ + context.handleLifetime->addHandle( *phContext ); + context.handleLifetime->addDependent( hDriver, *phContext ); + + } + } + return logAndPropagateResult_zeContextCreateEx(driver_result, hDriver, desc, numDevices, phDevices, phContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverGetDefaultContext - __zedlllocal ze_context_handle_t ZE_APICALL - zeDriverGetDefaultContext( - ze_driver_handle_t hDriver ///< [in] handle of the driver instance + /// @brief Intercept function for zeContextDestroy + __zedlllocal ze_result_t ZE_APICALL + zeContextDestroy( + ze_context_handle_t hContext ///< [in][release] handle of context object to destroy ) { - context.logger->log_trace("zeDriverGetDefaultContext(hDriver)"); + context.logger->log_trace("zeContextDestroy(hContext)"); - auto pfnGetDefaultContext = context.zeDdiTable.Driver.pfnGetDefaultContext; + auto pfnDestroy = context.zeDdiTable.Context.pfnDestroy; - if( nullptr == pfnGetDefaultContext ) - return nullptr; + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeContextDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetDefaultContextPrologue( hDriver ); - if(result!=ZE_RESULT_SUCCESS) return nullptr; + auto result = context.validationHandlers[i]->zeValidation->zeContextDestroyPrologue( hContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); } @@ -8059,46 +10008,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverGetDefaultContextPrologue( hDriver ); - if(result!=ZE_RESULT_SUCCESS) return nullptr; + auto result = context.handleLifetime->zeHandleLifetime.zeContextDestroyPrologue( hContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); } - auto driver_result = pfnGetDefaultContext( hDriver ); + auto driver_result = pfnDestroy( hContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverGetDefaultContextEpilogue( hDriver ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return nullptr; + auto result = context.validationHandlers[i]->zeValidation->zeContextDestroyEpilogue( hContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); } - return driver_result; + return logAndPropagateResult_zeContextDestroy(driver_result, hContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGet + /// @brief Intercept function for zeContextGetStatus __zedlllocal ze_result_t ZE_APICALL - zeDeviceGet( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of devices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of devices available. - ///< if count is greater than the number of devices available, then the - ///< driver shall update the value with the correct number of devices available. - ze_device_handle_t* phDevices ///< [in,out][optional][range(0, *pCount)] array of handle of devices. - ///< if count is less than the number of devices available, then driver - ///< shall only retrieve that number of devices. + zeContextGetStatus( + ze_context_handle_t hContext ///< [in] handle of context object ) { - context.logger->log_trace("zeDeviceGet(hDriver, pCount, phDevices)"); + context.logger->log_trace("zeContextGetStatus(hContext)"); - auto pfnGet = context.zeDdiTable.Device.pfnGet; + auto pfnGetStatus = context.zeDdiTable.Context.pfnGetStatus; - if( nullptr == pfnGet ) - return logAndPropagateResult_zeDeviceGet(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, phDevices); + if( nullptr == pfnGetStatus ) + return logAndPropagateResult_zeContextGetStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPrologue( hDriver, pCount, phDevices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + auto result = context.validationHandlers[i]->zeValidation->zeContextGetStatusPrologue( hContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); } @@ -8108,49 +10049,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetPrologue( hDriver, pCount, phDevices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + auto result = context.handleLifetime->zeHandleLifetime.zeContextGetStatusPrologue( hContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); } - auto driver_result = pfnGet( hDriver, pCount, phDevices ); + auto driver_result = pfnGetStatus( hContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetEpilogue( hDriver, pCount, phDevices ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGet(result, hDriver, pCount, phDevices); + auto result = context.validationHandlers[i]->zeValidation->zeContextGetStatusEpilogue( hContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phDevices) && (i < *pCount); ++i){ - if (phDevices[i]){ - context.handleLifetime->addHandle( phDevices[i] ); - context.handleLifetime->addDependent( hDriver, phDevices[i] ); - } - } - } - return logAndPropagateResult_zeDeviceGet(driver_result, hDriver, pCount, phDevices); + return logAndPropagateResult_zeContextGetStatus(driver_result, hContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetRootDevice + /// @brief Intercept function for zeCommandQueueCreate __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetRootDevice( + zeCommandQueueCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device object - ze_device_handle_t* phRootDevice ///< [in,out] parent root device. + const ze_command_queue_desc_t* desc, ///< [in] pointer to command queue descriptor + ze_command_queue_handle_t* phCommandQueue ///< [out] pointer to handle of command queue object created ) { - context.logger->log_trace("zeDeviceGetRootDevice(hDevice, phRootDevice)"); + context.logger->log_trace("zeCommandQueueCreate(hContext, hDevice, desc, phCommandQueue)"); - auto pfnGetRootDevice = context.zeDdiTable.Device.pfnGetRootDevice; + auto pfnCreate = context.zeDdiTable.CommandQueue.pfnCreate; - if( nullptr == pfnGetRootDevice ) - return logAndPropagateResult_zeDeviceGetRootDevice(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, phRootDevice); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeCommandQueueCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phCommandQueue); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRootDevicePrologue( hDevice, phRootDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueCreatePrologue( hContext, hDevice, desc, phCommandQueue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); } @@ -8160,46 +10093,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRootDevicePrologue( hDevice, phRootDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueCreatePrologue( hContext, hDevice, desc, phCommandQueue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); } - auto driver_result = pfnGetRootDevice( hDevice, phRootDevice ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phCommandQueue ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRootDeviceEpilogue( hDevice, phRootDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRootDevice(result, hDevice, phRootDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueCreateEpilogue( hContext, hDevice, desc, phCommandQueue ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); } - return logAndPropagateResult_zeDeviceGetRootDevice(driver_result, hDevice, phRootDevice); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phCommandQueue){ + context.handleLifetime->addHandle( *phCommandQueue ); + context.handleLifetime->addDependent( hContext, *phCommandQueue ); + + } + } + return logAndPropagateResult_zeCommandQueueCreate(driver_result, hContext, hDevice, desc, phCommandQueue); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetSubDevices + /// @brief Intercept function for zeCommandQueueDestroy __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetSubDevices( - ze_device_handle_t hDevice, ///< [in] handle of the device object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-devices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-devices available. - ///< if count is greater than the number of sub-devices available, then the - ///< driver shall update the value with the correct number of sub-devices available. - ze_device_handle_t* phSubdevices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-devices. - ///< if count is less than the number of sub-devices available, then driver - ///< shall only retrieve that number of sub-devices. + zeCommandQueueDestroy( + ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy ) { - context.logger->log_trace("zeDeviceGetSubDevices(hDevice, pCount, phSubdevices)"); + context.logger->log_trace("zeCommandQueueDestroy(hCommandQueue)"); - auto pfnGetSubDevices = context.zeDdiTable.Device.pfnGetSubDevices; + auto pfnDestroy = context.zeDdiTable.CommandQueue.pfnDestroy; - if( nullptr == pfnGetSubDevices ) - return logAndPropagateResult_zeDeviceGetSubDevices(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, phSubdevices); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeCommandQueueDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetSubDevicesPrologue( hDevice, pCount, phSubdevices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueDestroyPrologue( hCommandQueue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); } @@ -8209,49 +10143,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetSubDevicesPrologue( hDevice, pCount, phSubdevices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueDestroyPrologue( hCommandQueue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); } - auto driver_result = pfnGetSubDevices( hDevice, pCount, phSubdevices ); + auto driver_result = pfnDestroy( hCommandQueue ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetSubDevicesEpilogue( hDevice, pCount, phSubdevices ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetSubDevices(result, hDevice, pCount, phSubdevices); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueDestroyEpilogue( hCommandQueue ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phSubdevices) && (i < *pCount); ++i){ - if (phSubdevices[i]){ - context.handleLifetime->addHandle( phSubdevices[i] ); - context.handleLifetime->addDependent( hDevice, phSubdevices[i] ); - } - } - } - return logAndPropagateResult_zeDeviceGetSubDevices(driver_result, hDevice, pCount, phSubdevices); + return logAndPropagateResult_zeCommandQueueDestroy(driver_result, hCommandQueue); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetProperties + /// @brief Intercept function for zeCommandQueueExecuteCommandLists __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_properties_t* pDeviceProperties ///< [in,out] query result for device properties + zeCommandQueueExecuteCommandLists( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint32_t numCommandLists, ///< [in] number of command lists to execute + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] list of handles of the command lists + ///< to execute + ze_fence_handle_t hFence ///< [in][optional] handle of the fence to signal on completion ) { - context.logger->log_trace("zeDeviceGetProperties(hDevice, pDeviceProperties)"); + context.logger->log_trace("zeCommandQueueExecuteCommandLists(hCommandQueue, numCommandLists, phCommandListsLocal, hFence)"); - auto pfnGetProperties = context.zeDdiTable.Device.pfnGetProperties; + auto pfnExecuteCommandLists = context.zeDdiTable.CommandQueue.pfnExecuteCommandLists; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zeDeviceGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pDeviceProperties); + if( nullptr == pfnExecuteCommandLists ) + return logAndPropagateResult_zeCommandQueueExecuteCommandLists(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, numCommandLists, phCommandLists, hFence); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPropertiesPrologue( hDevice, pDeviceProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueExecuteCommandListsPrologue( hCommandQueue, numCommandLists, phCommandLists, hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); } @@ -8261,39 +10188,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetPropertiesPrologue( hDevice, pDeviceProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueExecuteCommandListsPrologue( hCommandQueue, numCommandLists, phCommandLists, hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); } - auto driver_result = pfnGetProperties( hDevice, pDeviceProperties ); + auto driver_result = pfnExecuteCommandLists( hCommandQueue, numCommandLists, phCommandLists, hFence ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetPropertiesEpilogue( hDevice, pDeviceProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetProperties(result, hDevice, pDeviceProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueExecuteCommandListsEpilogue( hCommandQueue, numCommandLists, phCommandLists, hFence ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); } - return logAndPropagateResult_zeDeviceGetProperties(driver_result, hDevice, pDeviceProperties); + return logAndPropagateResult_zeCommandQueueExecuteCommandLists(driver_result, hCommandQueue, numCommandLists, phCommandLists, hFence); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetComputeProperties + /// @brief Intercept function for zeCommandQueueSynchronize __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetComputeProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_compute_properties_t* pComputeProperties ///< [in,out] query result for compute properties + zeCommandQueueSynchronize( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then immediately returns the status of the command queue; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { - context.logger->log_trace("zeDeviceGetComputeProperties(hDevice, pComputeProperties)"); + context.logger->log_trace("zeCommandQueueSynchronize(hCommandQueue, timeout)"); - auto pfnGetComputeProperties = context.zeDdiTable.Device.pfnGetComputeProperties; + auto pfnSynchronize = context.zeDdiTable.CommandQueue.pfnSynchronize; - if( nullptr == pfnGetComputeProperties ) - return logAndPropagateResult_zeDeviceGetComputeProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pComputeProperties); + if( nullptr == pfnSynchronize ) + return logAndPropagateResult_zeCommandQueueSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, timeout); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetComputePropertiesPrologue( hDevice, pComputeProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSynchronizePrologue( hCommandQueue, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); } @@ -8303,39 +10236,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetComputePropertiesPrologue( hDevice, pComputeProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueSynchronizePrologue( hCommandQueue, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); } - auto driver_result = pfnGetComputeProperties( hDevice, pComputeProperties ); + auto driver_result = pfnSynchronize( hCommandQueue, timeout ); - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetComputePropertiesEpilogue( hDevice, pComputeProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetComputeProperties(result, hDevice, pComputeProperties); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSynchronizeEpilogue( hCommandQueue, timeout ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); } - return logAndPropagateResult_zeDeviceGetComputeProperties(driver_result, hDevice, pComputeProperties); + return logAndPropagateResult_zeCommandQueueSynchronize(driver_result, hCommandQueue, timeout); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetModuleProperties + /// @brief Intercept function for zeCommandQueueGetOrdinal __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetModuleProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_module_properties_t* pModuleProperties///< [in,out] query result for module properties + zeCommandQueueGetOrdinal( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint32_t* pOrdinal ///< [out] command queue group ordinal ) { - context.logger->log_trace("zeDeviceGetModuleProperties(hDevice, pModuleProperties)"); + context.logger->log_trace("zeCommandQueueGetOrdinal(hCommandQueue, pOrdinal)"); - auto pfnGetModuleProperties = context.zeDdiTable.Device.pfnGetModuleProperties; + auto pfnGetOrdinal = context.zeDdiTable.CommandQueue.pfnGetOrdinal; - if( nullptr == pfnGetModuleProperties ) - return logAndPropagateResult_zeDeviceGetModuleProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pModuleProperties); + if( nullptr == pfnGetOrdinal ) + return logAndPropagateResult_zeCommandQueueGetOrdinal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, pOrdinal); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetModulePropertiesPrologue( hDevice, pModuleProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetOrdinalPrologue( hCommandQueue, pOrdinal ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); } @@ -8345,53 +10278,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetModulePropertiesPrologue( hDevice, pModuleProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetOrdinalPrologue( hCommandQueue, pOrdinal ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); } - auto driver_result = pfnGetModuleProperties( hDevice, pModuleProperties ); + auto driver_result = pfnGetOrdinal( hCommandQueue, pOrdinal ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetModulePropertiesEpilogue( hDevice, pModuleProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetModuleProperties(result, hDevice, pModuleProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetOrdinalEpilogue( hCommandQueue, pOrdinal ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); } - return logAndPropagateResult_zeDeviceGetModuleProperties(driver_result, hDevice, pModuleProperties); + return logAndPropagateResult_zeCommandQueueGetOrdinal(driver_result, hCommandQueue, pOrdinal); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetCommandQueueGroupProperties + /// @brief Intercept function for zeCommandQueueGetIndex __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetCommandQueueGroupProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of available command queue groups. - ///< If count is zero, then the driver shall update the value with the - ///< total number of command queue groups available. - ///< If count is less than the number of command queue groups available, - ///< then the driver shall only retrieve command queue group properties for - ///< the given number of command queue groups. - ///< If count is greater than or equal to the number of command queue - ///< groups available, then the driver shall retrieve command queue group - ///< properties for all available command queue groups. - ze_command_queue_group_properties_t* pCommandQueueGroupProperties ///< [in,out][optional][range(0, *pCount)] array of query results for - ///< command queue group properties. - ///< If count is less than the number of command queue groups available, - ///< then the driver shall only retrieve that number of command queue group properties. - ///< The order of properties in the array corresponds to the command queue - ///< group ordinal. + zeCommandQueueGetIndex( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint32_t* pIndex ///< [out] command queue index within the group ) { - context.logger->log_trace("zeDeviceGetCommandQueueGroupProperties(hDevice, pCount, pCommandQueueGroupProperties)"); + context.logger->log_trace("zeCommandQueueGetIndex(hCommandQueue, pIndex)"); - auto pfnGetCommandQueueGroupProperties = context.zeDdiTable.Device.pfnGetCommandQueueGroupProperties; + auto pfnGetIndex = context.zeDdiTable.CommandQueue.pfnGetIndex; - if( nullptr == pfnGetCommandQueueGroupProperties ) - return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pCommandQueueGroupProperties); + if( nullptr == pfnGetIndex ) + return logAndPropagateResult_zeCommandQueueGetIndex(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, pIndex); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCommandQueueGroupPropertiesPrologue( hDevice, pCount, pCommandQueueGroupProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetIndexPrologue( hCommandQueue, pIndex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); } @@ -8401,48 +10320,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCommandQueueGroupPropertiesPrologue( hDevice, pCount, pCommandQueueGroupProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetIndexPrologue( hCommandQueue, pIndex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); } - auto driver_result = pfnGetCommandQueueGroupProperties( hDevice, pCount, pCommandQueueGroupProperties ); + auto driver_result = pfnGetIndex( hCommandQueue, pIndex ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCommandQueueGroupPropertiesEpilogue( hDevice, pCount, pCommandQueueGroupProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(result, hDevice, pCount, pCommandQueueGroupProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetIndexEpilogue( hCommandQueue, pIndex ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); } - return logAndPropagateResult_zeDeviceGetCommandQueueGroupProperties(driver_result, hDevice, pCount, pCommandQueueGroupProperties); + return logAndPropagateResult_zeCommandQueueGetIndex(driver_result, hCommandQueue, pIndex); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetMemoryProperties + /// @brief Intercept function for zeCommandQueueGetFlags __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetMemoryProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of memory properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of memory properties available. - ///< if 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. - ze_device_memory_properties_t* pMemProperties ///< [in,out][optional][range(0, *pCount)] array of query results for - ///< memory properties. - ///< if count is less than the number of memory properties available, then - ///< driver shall only retrieve that number of memory properties. + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation ) { - context.logger->log_trace("zeDeviceGetMemoryProperties(hDevice, pCount, pMemProperties)"); + context.logger->log_trace("zeCommandQueueGetFlags(hCmdQueue, pFlags)"); - auto pfnGetMemoryProperties = context.zeDdiTable.Device.pfnGetMemoryProperties; + auto pfnGetFlags = context.zeDdiTable.CommandQueue.pfnGetFlags; - if( nullptr == pfnGetMemoryProperties ) - return logAndPropagateResult_zeDeviceGetMemoryProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pMemProperties); + if( nullptr == pfnGetFlags ) + return logAndPropagateResult_zeCommandQueueGetFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCmdQueue, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryPropertiesPrologue( hDevice, pCount, pMemProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetFlagsPrologue( hCmdQueue, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetFlags(result, hCmdQueue, pFlags); } @@ -8452,39 +10362,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetMemoryPropertiesPrologue( hDevice, pCount, pMemProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetFlagsPrologue( hCmdQueue, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetFlags(result, hCmdQueue, pFlags); } - auto driver_result = pfnGetMemoryProperties( hDevice, pCount, pMemProperties ); + auto driver_result = pfnGetFlags( hCmdQueue, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryPropertiesEpilogue( hDevice, pCount, pMemProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryProperties(result, hDevice, pCount, pMemProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetFlagsEpilogue( hCmdQueue, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetFlags(result, hCmdQueue, pFlags); } - return logAndPropagateResult_zeDeviceGetMemoryProperties(driver_result, hDevice, pCount, pMemProperties); + return logAndPropagateResult_zeCommandQueueGetFlags(driver_result, hCmdQueue, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetMemoryAccessProperties + /// @brief Intercept function for zeCommandQueueGetMode __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetMemoryAccessProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_memory_access_properties_t* pMemAccessProperties ///< [in,out] query result for memory access properties + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation ) { - context.logger->log_trace("zeDeviceGetMemoryAccessProperties(hDevice, pMemAccessProperties)"); + context.logger->log_trace("zeCommandQueueGetMode(hCmdQueue, pMode)"); - auto pfnGetMemoryAccessProperties = context.zeDdiTable.Device.pfnGetMemoryAccessProperties; + auto pfnGetMode = context.zeDdiTable.CommandQueue.pfnGetMode; - if( nullptr == pfnGetMemoryAccessProperties ) - return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pMemAccessProperties); + if( nullptr == pfnGetMode ) + return logAndPropagateResult_zeCommandQueueGetMode(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCmdQueue, pMode); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryAccessPropertiesPrologue( hDevice, pMemAccessProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetModePrologue( hCmdQueue, pMode ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetMode(result, hCmdQueue, pMode); } @@ -8494,47 +10404,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetMemoryAccessPropertiesPrologue( hDevice, pMemAccessProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetModePrologue( hCmdQueue, pMode ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetMode(result, hCmdQueue, pMode); } - auto driver_result = pfnGetMemoryAccessProperties( hDevice, pMemAccessProperties ); + auto driver_result = pfnGetMode( hCmdQueue, pMode ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetMemoryAccessPropertiesEpilogue( hDevice, pMemAccessProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(result, hDevice, pMemAccessProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetModeEpilogue( hCmdQueue, pMode ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetMode(result, hCmdQueue, pMode); } - return logAndPropagateResult_zeDeviceGetMemoryAccessProperties(driver_result, hDevice, pMemAccessProperties); + return logAndPropagateResult_zeCommandQueueGetMode(driver_result, hCmdQueue, pMode); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetCacheProperties + /// @brief Intercept function for zeCommandQueueGetPriority __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetCacheProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of cache properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of cache properties available. - ///< if count is greater than the number of cache properties available, - ///< then the driver shall update the value with the correct number of - ///< cache properties available. - ze_device_cache_properties_t* pCacheProperties ///< [in,out][optional][range(0, *pCount)] array of query results for cache properties. - ///< if count is less than the number of cache properties available, then - ///< driver shall only retrieve that number of cache properties. + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation ) { - context.logger->log_trace("zeDeviceGetCacheProperties(hDevice, pCount, pCacheProperties)"); + context.logger->log_trace("zeCommandQueueGetPriority(hCmdQueue, pPriority)"); - auto pfnGetCacheProperties = context.zeDdiTable.Device.pfnGetCacheProperties; + auto pfnGetPriority = context.zeDdiTable.CommandQueue.pfnGetPriority; - if( nullptr == pfnGetCacheProperties ) - return logAndPropagateResult_zeDeviceGetCacheProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pCacheProperties); + if( nullptr == pfnGetPriority ) + return logAndPropagateResult_zeCommandQueueGetPriority(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCmdQueue, pPriority); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCachePropertiesPrologue( hDevice, pCount, pCacheProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetPriorityPrologue( hCmdQueue, pPriority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetPriority(result, hCmdQueue, pPriority); } @@ -8544,39 +10446,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCachePropertiesPrologue( hDevice, pCount, pCacheProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetPriorityPrologue( hCmdQueue, pPriority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetPriority(result, hCmdQueue, pPriority); } - auto driver_result = pfnGetCacheProperties( hDevice, pCount, pCacheProperties ); + auto driver_result = pfnGetPriority( hCmdQueue, pPriority ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCachePropertiesEpilogue( hDevice, pCount, pCacheProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCacheProperties(result, hDevice, pCount, pCacheProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetPriorityEpilogue( hCmdQueue, pPriority ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetPriority(result, hCmdQueue, pPriority); } - return logAndPropagateResult_zeDeviceGetCacheProperties(driver_result, hDevice, pCount, pCacheProperties); + return logAndPropagateResult_zeCommandQueueGetPriority(driver_result, hCmdQueue, pPriority); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetImageProperties + /// @brief Intercept function for zeCommandListCreate __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetImageProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_image_properties_t* pImageProperties ///< [in,out] query result for image properties + zeCommandListCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + const ze_command_list_desc_t* desc, ///< [in] pointer to command list descriptor + ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created ) { - context.logger->log_trace("zeDeviceGetImageProperties(hDevice, pImageProperties)"); + context.logger->log_trace("zeCommandListCreate(hContext, hDevice, desc, phCommandList)"); - auto pfnGetImageProperties = context.zeDdiTable.Device.pfnGetImageProperties; + auto pfnCreate = context.zeDdiTable.CommandList.pfnCreate; - if( nullptr == pfnGetImageProperties ) - return logAndPropagateResult_zeDeviceGetImageProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pImageProperties); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeCommandListCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetImagePropertiesPrologue( hDevice, pImageProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreatePrologue( hContext, hDevice, desc, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); } @@ -8586,39 +10490,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetImagePropertiesPrologue( hDevice, pImageProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreatePrologue( hContext, hDevice, desc, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); } - auto driver_result = pfnGetImageProperties( hDevice, pImageProperties ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetImagePropertiesEpilogue( hDevice, pImageProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetImageProperties(result, hDevice, pImageProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateEpilogue( hContext, hDevice, desc, phCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); } - return logAndPropagateResult_zeDeviceGetImageProperties(driver_result, hDevice, pImageProperties); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phCommandList){ + context.handleLifetime->addHandle( *phCommandList ); + context.handleLifetime->addDependent( hContext, *phCommandList ); + + } + } + return logAndPropagateResult_zeCommandListCreate(driver_result, hContext, hDevice, desc, phCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetExternalMemoryProperties + /// @brief Intercept function for zeCommandListCreateImmediate __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetExternalMemoryProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_device_external_memory_properties_t* pExternalMemoryProperties ///< [in,out] query result for external memory properties + zeCommandListCreateImmediate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + const ze_command_queue_desc_t* altdesc, ///< [in] pointer to command queue descriptor + ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created ) { - context.logger->log_trace("zeDeviceGetExternalMemoryProperties(hDevice, pExternalMemoryProperties)"); + context.logger->log_trace("zeCommandListCreateImmediate(hContext, hDevice, altdesc, phCommandList)"); - auto pfnGetExternalMemoryProperties = context.zeDdiTable.Device.pfnGetExternalMemoryProperties; + auto pfnCreateImmediate = context.zeDdiTable.CommandList.pfnCreateImmediate; - if( nullptr == pfnGetExternalMemoryProperties ) - return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pExternalMemoryProperties); + if( nullptr == pfnCreateImmediate ) + return logAndPropagateResult_zeCommandListCreateImmediate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, altdesc, phCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetExternalMemoryPropertiesPrologue( hDevice, pExternalMemoryProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateImmediatePrologue( hContext, hDevice, altdesc, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); } @@ -8628,40 +10543,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetExternalMemoryPropertiesPrologue( hDevice, pExternalMemoryProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreateImmediatePrologue( hContext, hDevice, altdesc, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); } - auto driver_result = pfnGetExternalMemoryProperties( hDevice, pExternalMemoryProperties ); + auto driver_result = pfnCreateImmediate( hContext, hDevice, altdesc, phCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetExternalMemoryPropertiesEpilogue( hDevice, pExternalMemoryProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(result, hDevice, pExternalMemoryProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateImmediateEpilogue( hContext, hDevice, altdesc, phCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); } - return logAndPropagateResult_zeDeviceGetExternalMemoryProperties(driver_result, hDevice, pExternalMemoryProperties); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phCommandList){ + context.handleLifetime->addHandle( *phCommandList , false); + } + } + return logAndPropagateResult_zeCommandListCreateImmediate(driver_result, hContext, hDevice, altdesc, phCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetP2PProperties + /// @brief Intercept function for zeCommandListDestroy __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetP2PProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device performing the access - ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation - ze_device_p2p_properties_t* pP2PProperties ///< [in,out] Peer-to-Peer properties between source and peer device + zeCommandListDestroy( + ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy ) { - context.logger->log_trace("zeDeviceGetP2PProperties(hDevice, hPeerDevice, pP2PProperties)"); + context.logger->log_trace("zeCommandListDestroy(hCommandList)"); - auto pfnGetP2PProperties = context.zeDdiTable.Device.pfnGetP2PProperties; + auto pfnDestroy = context.zeDdiTable.CommandList.pfnDestroy; - if( nullptr == pfnGetP2PProperties ) - return logAndPropagateResult_zeDeviceGetP2PProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hPeerDevice, pP2PProperties); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeCommandListDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetP2PPropertiesPrologue( hDevice, hPeerDevice, pP2PProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListDestroyPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); } @@ -8671,40 +10591,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetP2PPropertiesPrologue( hDevice, hPeerDevice, pP2PProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListDestroyPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); } - auto driver_result = pfnGetP2PProperties( hDevice, hPeerDevice, pP2PProperties ); + auto driver_result = pfnDestroy( hCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetP2PPropertiesEpilogue( hDevice, hPeerDevice, pP2PProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetP2PProperties(result, hDevice, hPeerDevice, pP2PProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListDestroyEpilogue( hCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); } - return logAndPropagateResult_zeDeviceGetP2PProperties(driver_result, hDevice, hPeerDevice, pP2PProperties); + return logAndPropagateResult_zeCommandListDestroy(driver_result, hCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceCanAccessPeer + /// @brief Intercept function for zeCommandListClose __zedlllocal ze_result_t ZE_APICALL - zeDeviceCanAccessPeer( - ze_device_handle_t hDevice, ///< [in] handle of the device performing the access - ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation - ze_bool_t* value ///< [out] returned access capability + zeCommandListClose( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close ) { - context.logger->log_trace("zeDeviceCanAccessPeer(hDevice, hPeerDevice, value)"); + context.logger->log_trace("zeCommandListClose(hCommandList)"); - auto pfnCanAccessPeer = context.zeDdiTable.Device.pfnCanAccessPeer; + auto pfnClose = context.zeDdiTable.CommandList.pfnClose; - if( nullptr == pfnCanAccessPeer ) - return logAndPropagateResult_zeDeviceCanAccessPeer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hPeerDevice, value); + if( nullptr == pfnClose ) + return logAndPropagateResult_zeCommandListClose(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceCanAccessPeerPrologue( hDevice, hPeerDevice, value ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListClosePrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); } @@ -8714,38 +10632,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceCanAccessPeerPrologue( hDevice, hPeerDevice, value ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListClosePrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); } - auto driver_result = pfnCanAccessPeer( hDevice, hPeerDevice, value ); + auto driver_result = pfnClose( hCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceCanAccessPeerEpilogue( hDevice, hPeerDevice, value ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceCanAccessPeer(result, hDevice, hPeerDevice, value); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCloseEpilogue( hCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); } - return logAndPropagateResult_zeDeviceCanAccessPeer(driver_result, hDevice, hPeerDevice, value); + return logAndPropagateResult_zeCommandListClose(driver_result, hCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetStatus + /// @brief Intercept function for zeCommandListReset __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetStatus( - ze_device_handle_t hDevice ///< [in] handle of the device + zeCommandListReset( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset ) { - context.logger->log_trace("zeDeviceGetStatus(hDevice)"); + context.logger->log_trace("zeCommandListReset(hCommandList)"); - auto pfnGetStatus = context.zeDdiTable.Device.pfnGetStatus; + auto pfnReset = context.zeDdiTable.CommandList.pfnReset; - if( nullptr == pfnGetStatus ) - return logAndPropagateResult_zeDeviceGetStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + if( nullptr == pfnReset ) + return logAndPropagateResult_zeCommandListReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetStatusPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListResetPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); } @@ -8755,42 +10673,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetStatusPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListResetPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); } - auto driver_result = pfnGetStatus( hDevice ); + auto driver_result = pfnReset( hCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetStatusEpilogue( hDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetStatus(result, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListResetEpilogue( hCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); } - return logAndPropagateResult_zeDeviceGetStatus(driver_result, hDevice); + return logAndPropagateResult_zeCommandListReset(driver_result, hCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetGlobalTimestamps + /// @brief Intercept function for zeCommandListAppendWriteGlobalTimestamp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetGlobalTimestamps( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + zeCommandListAppendWriteGlobalTimestamp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t* dstptr, ///< [in,out] pointer to memory where timestamp value will be written; must + ///< be 8byte-aligned. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing query ) { - context.logger->log_trace("zeDeviceGetGlobalTimestamps(hDevice, hostTimestamp, deviceTimestamp)"); + context.logger->log_trace("zeCommandListAppendWriteGlobalTimestamp(hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetGlobalTimestamps = context.zeDdiTable.Device.pfnGetGlobalTimestamps; + auto pfnAppendWriteGlobalTimestamp = context.zeDdiTable.CommandList.pfnAppendWriteGlobalTimestamp; - if( nullptr == pfnGetGlobalTimestamps ) - return logAndPropagateResult_zeDeviceGetGlobalTimestamps(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, hostTimestamp, deviceTimestamp); + if( nullptr == pfnAppendWriteGlobalTimestamp ) + return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetGlobalTimestampsPrologue( hDevice, hostTimestamp, deviceTimestamp ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWriteGlobalTimestampPrologue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -8800,38 +10721,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetGlobalTimestampsPrologue( hDevice, hostTimestamp, deviceTimestamp ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWriteGlobalTimestampPrologue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetGlobalTimestamps( hDevice, hostTimestamp, deviceTimestamp ); + auto driver_result = pfnAppendWriteGlobalTimestamp( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetGlobalTimestampsEpilogue( hDevice, hostTimestamp, deviceTimestamp ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetGlobalTimestamps(result, hDevice, hostTimestamp, deviceTimestamp); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWriteGlobalTimestampEpilogue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeDeviceGetGlobalTimestamps(driver_result, hDevice, hostTimestamp, deviceTimestamp); + return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(driver_result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSynchronize + /// @brief Intercept function for zeCommandListHostSynchronize __zedlllocal ze_result_t ZE_APICALL - zeDeviceSynchronize( - ze_device_handle_t hDevice ///< [in] handle of the device + zeCommandListHostSynchronize( + ze_command_list_handle_t hCommandList, ///< [in] handle of the immediate command list + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then immediately returns the status of the immediate command list; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { - context.logger->log_trace("zeDeviceSynchronize(hDevice)"); + context.logger->log_trace("zeCommandListHostSynchronize(hCommandList, timeout)"); - auto pfnSynchronize = context.zeDdiTable.Device.pfnSynchronize; + auto pfnHostSynchronize = context.zeDdiTable.CommandList.pfnHostSynchronize; - if( nullptr == pfnSynchronize ) - return logAndPropagateResult_zeDeviceSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + if( nullptr == pfnHostSynchronize ) + return logAndPropagateResult_zeCommandListHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, timeout); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceSynchronizePrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListHostSynchronizePrologue( hCommandList, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); } @@ -8841,39 +10769,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceSynchronizePrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListHostSynchronizePrologue( hCommandList, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); } - auto driver_result = pfnSynchronize( hDevice ); + auto driver_result = pfnHostSynchronize( hCommandList, timeout ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceSynchronizeEpilogue( hDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSynchronize(result, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListHostSynchronizeEpilogue( hCommandList, timeout ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); } - return logAndPropagateResult_zeDeviceSynchronize(driver_result, hDevice); + return logAndPropagateResult_zeCommandListHostSynchronize(driver_result, hCommandList, timeout); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetAggregatedCopyOffloadIncrementValue + /// @brief Intercept function for zeCommandListGetDeviceHandle __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetAggregatedCopyOffloadIncrementValue( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* incrementValue ///< [out] increment value that can be used for Event creation + zeCommandListGetDeviceHandle( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_device_handle_t* phDevice ///< [out] handle of the device on which the command list was created ) { - context.logger->log_trace("zeDeviceGetAggregatedCopyOffloadIncrementValue(hDevice, incrementValue)"); + context.logger->log_trace("zeCommandListGetDeviceHandle(hCommandList, phDevice)"); - auto pfnGetAggregatedCopyOffloadIncrementValue = context.zeDdiTable.Device.pfnGetAggregatedCopyOffloadIncrementValue; + auto pfnGetDeviceHandle = context.zeDdiTable.CommandList.pfnGetDeviceHandle; - if( nullptr == pfnGetAggregatedCopyOffloadIncrementValue ) - return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, incrementValue); + if( nullptr == pfnGetDeviceHandle ) + return logAndPropagateResult_zeCommandListGetDeviceHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( hDevice, incrementValue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetDeviceHandlePrologue( hCommandList, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); } @@ -8883,42 +10811,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetAggregatedCopyOffloadIncrementValuePrologue( hDevice, incrementValue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetDeviceHandlePrologue( hCommandList, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); } - auto driver_result = pfnGetAggregatedCopyOffloadIncrementValue( hDevice, incrementValue ); + auto driver_result = pfnGetDeviceHandle( hCommandList, phDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetAggregatedCopyOffloadIncrementValueEpilogue( hDevice, incrementValue ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(result, hDevice, incrementValue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetDeviceHandleEpilogue( hCommandList, phDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); } - return logAndPropagateResult_zeDeviceGetAggregatedCopyOffloadIncrementValue(driver_result, hDevice, incrementValue); + return logAndPropagateResult_zeCommandListGetDeviceHandle(driver_result, hCommandList, phDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetRuntimeRequirements + /// @brief Intercept function for zeCommandListGetContextHandle __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetRuntimeRequirements( - ze_device_handle_t hDevice, ///< [in] handle of the device - const void* pObjDesc, ///< [in] describes the object for which the requirements are to be - ///< gathered - size_t* pSize, ///< [in,out] size of requirements string in bytes. - char* pRequirements ///< [in,out][optional] holds results of the query. + zeCommandListGetContextHandle( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_context_handle_t* phContext ///< [out] handle of the context on which the command list was created ) { - context.logger->log_trace("zeDeviceGetRuntimeRequirements(hDevice, pObjDesc, pSize, pRequirements)"); + context.logger->log_trace("zeCommandListGetContextHandle(hCommandList, phContext)"); - auto pfnGetRuntimeRequirements = context.zeDdiTable.Device.pfnGetRuntimeRequirements; + auto pfnGetContextHandle = context.zeDdiTable.CommandList.pfnGetContextHandle; - if( nullptr == pfnGetRuntimeRequirements ) - return logAndPropagateResult_zeDeviceGetRuntimeRequirements(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pObjDesc, pSize, pRequirements); + if( nullptr == pfnGetContextHandle ) + return logAndPropagateResult_zeCommandListGetContextHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsPrologue( hDevice, pObjDesc, pSize, pRequirements ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetContextHandlePrologue( hCommandList, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); } @@ -8928,39 +10853,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRuntimeRequirementsPrologue( hDevice, pObjDesc, pSize, pRequirements ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetContextHandlePrologue( hCommandList, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); } - auto driver_result = pfnGetRuntimeRequirements( hDevice, pObjDesc, pSize, pRequirements ); + auto driver_result = pfnGetContextHandle( hCommandList, phContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsEpilogue( hDevice, pObjDesc, pSize, pRequirements ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirements(result, hDevice, pObjDesc, pSize, pRequirements); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetContextHandleEpilogue( hCommandList, phContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); } - return logAndPropagateResult_zeDeviceGetRuntimeRequirements(driver_result, hDevice, pObjDesc, pSize, pRequirements); + return logAndPropagateResult_zeCommandListGetContextHandle(driver_result, hCommandList, phContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetRuntimeRequirementsKey + /// @brief Intercept function for zeCommandListGetOrdinal __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetRuntimeRequirementsKey( - ze_device_handle_t hDevice, ///< [in] handle of the device - const char** pKey ///< [out] returned key + zeCommandListGetOrdinal( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t* pOrdinal ///< [out] command queue group ordinal to which command list is submitted ) { - context.logger->log_trace("zeDeviceGetRuntimeRequirementsKey(hDevice, pKey)"); + context.logger->log_trace("zeCommandListGetOrdinal(hCommandList, pOrdinal)"); - auto pfnGetRuntimeRequirementsKey = context.zeDdiTable.Device.pfnGetRuntimeRequirementsKey; + auto pfnGetOrdinal = context.zeDdiTable.CommandList.pfnGetOrdinal; - if( nullptr == pfnGetRuntimeRequirementsKey ) - return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pKey); + if( nullptr == pfnGetOrdinal ) + return logAndPropagateResult_zeCommandListGetOrdinal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pOrdinal); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsKeyPrologue( hDevice, pKey ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetOrdinalPrologue( hCommandList, pOrdinal ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); } @@ -8970,42 +10895,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetRuntimeRequirementsKeyPrologue( hDevice, pKey ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetOrdinalPrologue( hCommandList, pOrdinal ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); } - auto driver_result = pfnGetRuntimeRequirementsKey( hDevice, pKey ); + auto driver_result = pfnGetOrdinal( hCommandList, pOrdinal ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetRuntimeRequirementsKeyEpilogue( hDevice, pKey ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(result, hDevice, pKey); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetOrdinalEpilogue( hCommandList, pOrdinal ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); } - return logAndPropagateResult_zeDeviceGetRuntimeRequirementsKey(driver_result, hDevice, pKey); + return logAndPropagateResult_zeCommandListGetOrdinal(driver_result, hCommandList, pOrdinal); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceValidateRuntimeRequirements + /// @brief Intercept function for zeCommandListImmediateGetIndex __zedlllocal ze_result_t ZE_APICALL - zeDeviceValidateRuntimeRequirements( - ze_device_handle_t hDevice, ///< [in] handle of the device - const char* pRequirements, ///< [in] requirements to be validated. Requirements should be - ///< null-terminated plain text representation of runtime requirements - ///< previously retrieved from the device. - ze_validate_runtime_requirements_output_t* pOut ///< [in][out] Output of the validation call. + zeCommandListImmediateGetIndex( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t* pIndex ///< [out] command queue index within the group to which the immediate + ///< command list is submitted ) { - context.logger->log_trace("zeDeviceValidateRuntimeRequirements(hDevice, pRequirements, pOut)"); + context.logger->log_trace("zeCommandListImmediateGetIndex(hCommandListImmediate, pIndex)"); - auto pfnValidateRuntimeRequirements = context.zeDdiTable.Device.pfnValidateRuntimeRequirements; + auto pfnImmediateGetIndex = context.zeDdiTable.CommandList.pfnImmediateGetIndex; - if( nullptr == pfnValidateRuntimeRequirements ) - return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pRequirements, pOut); + if( nullptr == pfnImmediateGetIndex ) + return logAndPropagateResult_zeCommandListImmediateGetIndex(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, pIndex); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceValidateRuntimeRequirementsPrologue( hDevice, pRequirements, pOut ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetIndexPrologue( hCommandListImmediate, pIndex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); } @@ -9015,40 +10938,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceValidateRuntimeRequirementsPrologue( hDevice, pRequirements, pOut ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateGetIndexPrologue( hCommandListImmediate, pIndex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); } - auto driver_result = pfnValidateRuntimeRequirements( hDevice, pRequirements, pOut ); + auto driver_result = pfnImmediateGetIndex( hCommandListImmediate, pIndex ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceValidateRuntimeRequirementsEpilogue( hDevice, pRequirements, pOut ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(result, hDevice, pRequirements, pOut); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetIndexEpilogue( hCommandListImmediate, pIndex ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); } - return logAndPropagateResult_zeDeviceValidateRuntimeRequirements(driver_result, hDevice, pRequirements, pOut); + return logAndPropagateResult_zeCommandListImmediateGetIndex(driver_result, hCommandListImmediate, pIndex); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextCreate + /// @brief Intercept function for zeCommandListIsImmediate __zedlllocal ze_result_t ZE_APICALL - zeContextCreate( - ze_driver_handle_t hDriver, ///< [in] handle of the driver object - const ze_context_desc_t* desc, ///< [in] pointer to context descriptor - ze_context_handle_t* phContext ///< [out] pointer to handle of context object created + zeCommandListIsImmediate( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsImmediate ///< [out] Boolean indicating whether the command list is an immediate + ///< command list (true) or not (false) ) { - context.logger->log_trace("zeContextCreate(hDriver, desc, phContext)"); + context.logger->log_trace("zeCommandListIsImmediate(hCommandList, pIsImmediate)"); - auto pfnCreate = context.zeDdiTable.Context.pfnCreate; + auto pfnIsImmediate = context.zeDdiTable.CommandList.pfnIsImmediate; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeContextCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, desc, phContext); + if( nullptr == pfnIsImmediate ) + return logAndPropagateResult_zeCommandListIsImmediate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pIsImmediate); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextCreatePrologue( hDriver, desc, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsImmediatePrologue( hCommandList, pIsImmediate ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); } @@ -9058,59 +10981,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextCreatePrologue( hDriver, desc, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsImmediatePrologue( hCommandList, pIsImmediate ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); } - auto driver_result = pfnCreate( hDriver, desc, phContext ); + auto driver_result = pfnIsImmediate( hCommandList, pIsImmediate ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextCreateEpilogue( hDriver, desc, phContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreate(result, hDriver, desc, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsImmediateEpilogue( hCommandList, pIsImmediate ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phContext){ - context.handleLifetime->addHandle( *phContext ); - context.handleLifetime->addDependent( hDriver, *phContext ); - - } - } - return logAndPropagateResult_zeContextCreate(driver_result, hDriver, desc, phContext); + return logAndPropagateResult_zeCommandListIsImmediate(driver_result, hCommandList, pIsImmediate); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextCreateEx + /// @brief Intercept function for zeCommandListGetFlags __zedlllocal ze_result_t ZE_APICALL - zeContextCreateEx( - ze_driver_handle_t hDriver, ///< [in] handle of the driver object - const ze_context_desc_t* desc, ///< [in] pointer to context descriptor - uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == - ///< phDevices` - ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which - ///< context has visibility. - ///< if nullptr, then all devices and any sub-devices supported by the - ///< driver instance are - ///< visible to the context. - ///< otherwise, the context only has visibility to the devices and any - ///< sub-devices of the - ///< devices in this array. - ze_context_handle_t* phContext ///< [out] pointer to handle of context object created + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation ) { - context.logger->log_trace("zeContextCreateEx(hDriver, desc, numDevices, phDevicesLocal, phContext)"); + context.logger->log_trace("zeCommandListGetFlags(hCommandList, pFlags)"); - auto pfnCreateEx = context.zeDdiTable.Context.pfnCreateEx; + auto pfnGetFlags = context.zeDdiTable.CommandList.pfnGetFlags; - if( nullptr == pfnCreateEx ) - return logAndPropagateResult_zeContextCreateEx(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, desc, numDevices, phDevices, phContext); + if( nullptr == pfnGetFlags ) + return logAndPropagateResult_zeCommandListGetFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextCreateExPrologue( hDriver, desc, numDevices, phDevices, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetFlagsPrologue( hCommandList, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetFlags(result, hCommandList, pFlags); } @@ -9120,47 +11023,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextCreateExPrologue( hDriver, desc, numDevices, phDevices, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetFlagsPrologue( hCommandList, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetFlags(result, hCommandList, pFlags); } - auto driver_result = pfnCreateEx( hDriver, desc, numDevices, phDevices, phContext ); + auto driver_result = pfnGetFlags( hCommandList, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextCreateExEpilogue( hDriver, desc, numDevices, phDevices, phContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextCreateEx(result, hDriver, desc, numDevices, phDevices, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetFlagsEpilogue( hCommandList, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetFlags(result, hCommandList, pFlags); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phContext){ - context.handleLifetime->addHandle( *phContext ); - context.handleLifetime->addDependent( hDriver, *phContext ); - - } - } - return logAndPropagateResult_zeContextCreateEx(driver_result, hDriver, desc, numDevices, phDevices, phContext); + return logAndPropagateResult_zeCommandListGetFlags(driver_result, hCommandList, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextDestroy + /// @brief Intercept function for zeCommandListImmediateGetFlags __zedlllocal ze_result_t ZE_APICALL - zeContextDestroy( - ze_context_handle_t hContext ///< [in][release] handle of context object to destroy + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation ) { - context.logger->log_trace("zeContextDestroy(hContext)"); + context.logger->log_trace("zeCommandListImmediateGetFlags(hCommandList, pFlags)"); - auto pfnDestroy = context.zeDdiTable.Context.pfnDestroy; + auto pfnImmediateGetFlags = context.zeDdiTable.CommandList.pfnImmediateGetFlags; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeContextDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext); + if( nullptr == pfnImmediateGetFlags ) + return logAndPropagateResult_zeCommandListImmediateGetFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextDestroyPrologue( hContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetFlagsPrologue( hCommandList, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetFlags(result, hCommandList, pFlags); } @@ -9170,38 +11065,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextDestroyPrologue( hContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateGetFlagsPrologue( hCommandList, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetFlags(result, hCommandList, pFlags); } - auto driver_result = pfnDestroy( hContext ); + auto driver_result = pfnImmediateGetFlags( hCommandList, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextDestroyEpilogue( hContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextDestroy(result, hContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetFlagsEpilogue( hCommandList, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetFlags(result, hCommandList, pFlags); } - return logAndPropagateResult_zeContextDestroy(driver_result, hContext); + return logAndPropagateResult_zeCommandListImmediateGetFlags(driver_result, hCommandList, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextGetStatus + /// @brief Intercept function for zeCommandListImmediateGetMode __zedlllocal ze_result_t ZE_APICALL - zeContextGetStatus( - ze_context_handle_t hContext ///< [in] handle of context object + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation ) { - context.logger->log_trace("zeContextGetStatus(hContext)"); + context.logger->log_trace("zeCommandListImmediateGetMode(hCommandList, pMode)"); - auto pfnGetStatus = context.zeDdiTable.Context.pfnGetStatus; + auto pfnImmediateGetMode = context.zeDdiTable.CommandList.pfnImmediateGetMode; - if( nullptr == pfnGetStatus ) - return logAndPropagateResult_zeContextGetStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext); + if( nullptr == pfnImmediateGetMode ) + return logAndPropagateResult_zeCommandListImmediateGetMode(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pMode); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextGetStatusPrologue( hContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetModePrologue( hCommandList, pMode ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetMode(result, hCommandList, pMode); } @@ -9211,41 +11107,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextGetStatusPrologue( hContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateGetModePrologue( hCommandList, pMode ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetMode(result, hCommandList, pMode); } - auto driver_result = pfnGetStatus( hContext ); + auto driver_result = pfnImmediateGetMode( hCommandList, pMode ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextGetStatusEpilogue( hContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextGetStatus(result, hContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetModeEpilogue( hCommandList, pMode ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetMode(result, hCommandList, pMode); } - return logAndPropagateResult_zeContextGetStatus(driver_result, hContext); + return logAndPropagateResult_zeCommandListImmediateGetMode(driver_result, hCommandList, pMode); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueCreate + /// @brief Intercept function for zeCommandListImmediateGetPriority __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - const ze_command_queue_desc_t* desc, ///< [in] pointer to command queue descriptor - ze_command_queue_handle_t* phCommandQueue ///< [out] pointer to handle of command queue object created + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation ) { - context.logger->log_trace("zeCommandQueueCreate(hContext, hDevice, desc, phCommandQueue)"); + context.logger->log_trace("zeCommandListImmediateGetPriority(hCommandList, pPriority)"); - auto pfnCreate = context.zeDdiTable.CommandQueue.pfnCreate; + auto pfnImmediateGetPriority = context.zeDdiTable.CommandList.pfnImmediateGetPriority; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeCommandQueueCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phCommandQueue); + if( nullptr == pfnImmediateGetPriority ) + return logAndPropagateResult_zeCommandListImmediateGetPriority(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pPriority); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueCreatePrologue( hContext, hDevice, desc, phCommandQueue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetPriorityPrologue( hCommandList, pPriority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetPriority(result, hCommandList, pPriority); } @@ -9255,47 +11149,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueCreatePrologue( hContext, hDevice, desc, phCommandQueue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateGetPriorityPrologue( hCommandList, pPriority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetPriority(result, hCommandList, pPriority); } - auto driver_result = pfnCreate( hContext, hDevice, desc, phCommandQueue ); + auto driver_result = pfnImmediateGetPriority( hCommandList, pPriority ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueCreateEpilogue( hContext, hDevice, desc, phCommandQueue ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueCreate(result, hContext, hDevice, desc, phCommandQueue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetPriorityEpilogue( hCommandList, pPriority ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetPriority(result, hCommandList, pPriority); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phCommandQueue){ - context.handleLifetime->addHandle( *phCommandQueue ); - context.handleLifetime->addDependent( hContext, *phCommandQueue ); - - } - } - return logAndPropagateResult_zeCommandQueueCreate(driver_result, hContext, hDevice, desc, phCommandQueue); + return logAndPropagateResult_zeCommandListImmediateGetPriority(driver_result, hCommandList, pPriority); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueDestroy + /// @brief Intercept function for zeCommandListAppendBarrier __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueDestroy( - ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy + zeCommandListAppendBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing barrier ) { - context.logger->log_trace("zeCommandQueueDestroy(hCommandQueue)"); + context.logger->log_trace("zeCommandListAppendBarrier(hCommandList, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnDestroy = context.zeDdiTable.CommandQueue.pfnDestroy; + auto pfnAppendBarrier = context.zeDdiTable.CommandList.pfnAppendBarrier; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeCommandQueueDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue); + if( nullptr == pfnAppendBarrier ) + return logAndPropagateResult_zeCommandListAppendBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueDestroyPrologue( hCommandQueue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendBarrierPrologue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9305,42 +11195,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueDestroyPrologue( hCommandQueue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendBarrierPrologue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnDestroy( hCommandQueue ); + auto driver_result = pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueDestroyEpilogue( hCommandQueue ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueDestroy(result, hCommandQueue); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendBarrierEpilogue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandQueueDestroy(driver_result, hCommandQueue); + return logAndPropagateResult_zeCommandListAppendBarrier(driver_result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueExecuteCommandLists + /// @brief Intercept function for zeCommandListAppendMemoryRangesBarrier __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueExecuteCommandLists( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue - uint32_t numCommandLists, ///< [in] number of command lists to execute - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] list of handles of the command lists - ///< to execute - ze_fence_handle_t hFence ///< [in][optional] handle of the fence to signal on completion + zeCommandListAppendMemoryRangesBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numRanges, ///< [in] number of memory ranges + const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range + const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing barrier ) { - context.logger->log_trace("zeCommandQueueExecuteCommandLists(hCommandQueue, numCommandLists, phCommandListsLocal, hFence)"); + context.logger->log_trace("zeCommandListAppendMemoryRangesBarrier(hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnExecuteCommandLists = context.zeDdiTable.CommandQueue.pfnExecuteCommandLists; + auto pfnAppendMemoryRangesBarrier = context.zeDdiTable.CommandList.pfnAppendMemoryRangesBarrier; - if( nullptr == pfnExecuteCommandLists ) - return logAndPropagateResult_zeCommandQueueExecuteCommandLists(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, numCommandLists, phCommandLists, hFence); + if( nullptr == pfnAppendMemoryRangesBarrier ) + return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueExecuteCommandListsPrologue( hCommandQueue, numCommandLists, phCommandLists, hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryRangesBarrierPrologue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9350,45 +11244,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueExecuteCommandListsPrologue( hCommandQueue, numCommandLists, phCommandLists, hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryRangesBarrierPrologue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnExecuteCommandLists( hCommandQueue, numCommandLists, phCommandLists, hFence ); + auto driver_result = pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueExecuteCommandListsEpilogue( hCommandQueue, numCommandLists, phCommandLists, hFence ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueExecuteCommandLists(result, hCommandQueue, numCommandLists, phCommandLists, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryRangesBarrierEpilogue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandQueueExecuteCommandLists(driver_result, hCommandQueue, numCommandLists, phCommandLists, hFence); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueSynchronize - __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueSynchronize( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then immediately returns the status of the command queue; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. + return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(driver_result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextSystemBarrier + __zedlllocal ze_result_t ZE_APICALL + zeContextSystemBarrier( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice ///< [in] handle of the device ) { - context.logger->log_trace("zeCommandQueueSynchronize(hCommandQueue, timeout)"); + context.logger->log_trace("zeContextSystemBarrier(hContext, hDevice)"); - auto pfnSynchronize = context.zeDdiTable.CommandQueue.pfnSynchronize; + auto pfnSystemBarrier = context.zeDdiTable.Context.pfnSystemBarrier; - if( nullptr == pfnSynchronize ) - return logAndPropagateResult_zeCommandQueueSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, timeout); + if( nullptr == pfnSystemBarrier ) + return logAndPropagateResult_zeContextSystemBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSynchronizePrologue( hCommandQueue, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeContextSystemBarrierPrologue( hContext, hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); } @@ -9398,39 +11286,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueSynchronizePrologue( hCommandQueue, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); + auto result = context.handleLifetime->zeHandleLifetime.zeContextSystemBarrierPrologue( hContext, hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); } - auto driver_result = pfnSynchronize( hCommandQueue, timeout ); + auto driver_result = pfnSystemBarrier( hContext, hDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSynchronizeEpilogue( hCommandQueue, timeout ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSynchronize(result, hCommandQueue, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeContextSystemBarrierEpilogue( hContext, hDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); } - return logAndPropagateResult_zeCommandQueueSynchronize(driver_result, hCommandQueue, timeout); + return logAndPropagateResult_zeContextSystemBarrier(driver_result, hContext, hDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueGetOrdinal + /// @brief Intercept function for zeCommandListAppendMemoryCopy __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueGetOrdinal( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue - uint32_t* pOrdinal ///< [out] command queue group ordinal + zeCommandListAppendMemoryCopy( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandQueueGetOrdinal(hCommandQueue, pOrdinal)"); + context.logger->log_trace("zeCommandListAppendMemoryCopy(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetOrdinal = context.zeDdiTable.CommandQueue.pfnGetOrdinal; + auto pfnAppendMemoryCopy = context.zeDdiTable.CommandList.pfnAppendMemoryCopy; - if( nullptr == pfnGetOrdinal ) - return logAndPropagateResult_zeCommandQueueGetOrdinal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, pOrdinal); + if( nullptr == pfnAppendMemoryCopy ) + return logAndPropagateResult_zeCommandListAppendMemoryCopy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetOrdinalPrologue( hCommandQueue, pOrdinal ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9440,39 +11335,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetOrdinalPrologue( hCommandQueue, pOrdinal ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetOrdinal( hCommandQueue, pOrdinal ); + auto driver_result = pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetOrdinalEpilogue( hCommandQueue, pOrdinal ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetOrdinal(result, hCommandQueue, pOrdinal); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandQueueGetOrdinal(driver_result, hCommandQueue, pOrdinal); + return logAndPropagateResult_zeCommandListAppendMemoryCopy(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandQueueGetIndex + /// @brief Intercept function for zeCommandListAppendMemoryCopyWithParameters __zedlllocal ze_result_t ZE_APICALL - zeCommandQueueGetIndex( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue - uint32_t* pIndex ///< [out] command queue index within the group + zeCommandListAppendMemoryCopyWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + size_t size, ///< [in] size in bytes to copy + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandQueueGetIndex(hCommandQueue, pIndex)"); + context.logger->log_trace("zeCommandListAppendMemoryCopyWithParameters(hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetIndex = context.zeDdiTable.CommandQueue.pfnGetIndex; + auto pfnAppendMemoryCopyWithParameters = context.zeDdiTable.CommandList.pfnAppendMemoryCopyWithParameters; - if( nullptr == pfnGetIndex ) - return logAndPropagateResult_zeCommandQueueGetIndex(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, pIndex); + if( nullptr == pfnAppendMemoryCopyWithParameters ) + return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetIndexPrologue( hCommandQueue, pIndex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyWithParametersPrologue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9482,41 +11385,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueGetIndexPrologue( hCommandQueue, pIndex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyWithParametersPrologue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetIndex( hCommandQueue, pIndex ); + auto driver_result = pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueGetIndexEpilogue( hCommandQueue, pIndex ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueGetIndex(result, hCommandQueue, pIndex); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyWithParametersEpilogue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandQueueGetIndex(driver_result, hCommandQueue, pIndex); + return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(driver_result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreate + /// @brief Intercept function for zeCommandListAppendMemoryFill __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - const ze_command_list_desc_t* desc, ///< [in] pointer to command list descriptor - ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created + zeCommandListAppendMemoryFill( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* ptr, ///< [in] pointer to memory to initialize + const void* pattern, ///< [in] pointer to value to initialize memory to + size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to + size_t size, ///< [in] size in bytes to initialize + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListCreate(hContext, hDevice, desc, phCommandList)"); + context.logger->log_trace("zeCommandListAppendMemoryFill(hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreate = context.zeDdiTable.CommandList.pfnCreate; + auto pfnAppendMemoryFill = context.zeDdiTable.CommandList.pfnAppendMemoryFill; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeCommandListCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phCommandList); + if( nullptr == pfnAppendMemoryFill ) + return logAndPropagateResult_zeCommandListAppendMemoryFill(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreatePrologue( hContext, hDevice, desc, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillPrologue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9526,50 +11435,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreatePrologue( hContext, hDevice, desc, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryFillPrologue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnCreate( hContext, hDevice, desc, phCommandList ); + auto driver_result = pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateEpilogue( hContext, hDevice, desc, phCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreate(result, hContext, hDevice, desc, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillEpilogue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phCommandList){ - context.handleLifetime->addHandle( *phCommandList ); - context.handleLifetime->addDependent( hContext, *phCommandList ); - - } - } - return logAndPropagateResult_zeCommandListCreate(driver_result, hContext, hDevice, desc, phCommandList); + return logAndPropagateResult_zeCommandListAppendMemoryFill(driver_result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateImmediate + /// @brief Intercept function for zeCommandListAppendMemoryFillWithParameters __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateImmediate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - const ze_command_queue_desc_t* altdesc, ///< [in] pointer to command queue descriptor - ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created + zeCommandListAppendMemoryFillWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* ptr, ///< [in] pointer to memory to initialize + const void* pattern, ///< [in] pointer to value to initialize memory to + size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to + size_t size, ///< [in] size in bytes to initialize + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListCreateImmediate(hContext, hDevice, altdesc, phCommandList)"); + context.logger->log_trace("zeCommandListAppendMemoryFillWithParameters(hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreateImmediate = context.zeDdiTable.CommandList.pfnCreateImmediate; + auto pfnAppendMemoryFillWithParameters = context.zeDdiTable.CommandList.pfnAppendMemoryFillWithParameters; - if( nullptr == pfnCreateImmediate ) - return logAndPropagateResult_zeCommandListCreateImmediate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, altdesc, phCommandList); + if( nullptr == pfnAppendMemoryFillWithParameters ) + return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateImmediatePrologue( hContext, hDevice, altdesc, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillWithParametersPrologue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9579,45 +11486,55 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreateImmediatePrologue( hContext, hDevice, altdesc, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryFillWithParametersPrologue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnCreateImmediate( hContext, hDevice, altdesc, phCommandList ); + auto driver_result = pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateImmediateEpilogue( hContext, hDevice, altdesc, phCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateImmediate(result, hContext, hDevice, altdesc, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillWithParametersEpilogue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phCommandList){ - context.handleLifetime->addHandle( *phCommandList , false); - } - } - return logAndPropagateResult_zeCommandListCreateImmediate(driver_result, hContext, hDevice, altdesc, phCommandList); + return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(driver_result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListDestroy + /// @brief Intercept function for zeCommandListAppendMemoryCopyRegion __zedlllocal ze_result_t ZE_APICALL - zeCommandListDestroy( - ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy + zeCommandListAppendMemoryCopyRegion( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + const ze_copy_region_t* dstRegion, ///< [in] pointer to destination region to copy to + uint32_t dstPitch, ///< [in] destination pitch in bytes + uint32_t dstSlicePitch, ///< [in] destination slice pitch in bytes. This is required for 3D region + ///< copies where the `depth` member of ::ze_copy_region_t is not 0, + ///< otherwise it's ignored. + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_copy_region_t* srcRegion, ///< [in] pointer to source region to copy from + uint32_t srcPitch, ///< [in] source pitch in bytes + uint32_t srcSlicePitch, ///< [in] source slice pitch in bytes. This is required for 3D region + ///< copies where the `depth` member of ::ze_copy_region_t is not 0, + ///< otherwise it's ignored. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListDestroy(hCommandList)"); + context.logger->log_trace("zeCommandListAppendMemoryCopyRegion(hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnDestroy = context.zeDdiTable.CommandList.pfnDestroy; + auto pfnAppendMemoryCopyRegion = context.zeDdiTable.CommandList.pfnAppendMemoryCopyRegion; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeCommandListDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); + if( nullptr == pfnAppendMemoryCopyRegion ) + return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListDestroyPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyRegionPrologue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9627,38 +11544,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListDestroyPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyRegionPrologue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnDestroy( hCommandList ); + auto driver_result = pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListDestroyEpilogue( hCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListDestroy(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyRegionEpilogue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListDestroy(driver_result, hCommandList); + return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(driver_result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListClose + /// @brief Intercept function for zeCommandListAppendMemoryCopyFromContext __zedlllocal ze_result_t ZE_APICALL - zeCommandListClose( - ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close + zeCommandListAppendMemoryCopyFromContext( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_context_handle_t hContextSrc, ///< [in] handle of source context object + const void* srcptr, ///< [in] pointer to source memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListClose(hCommandList)"); + context.logger->log_trace("zeCommandListAppendMemoryCopyFromContext(hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnClose = context.zeDdiTable.CommandList.pfnClose; + auto pfnAppendMemoryCopyFromContext = context.zeDdiTable.CommandList.pfnAppendMemoryCopyFromContext; - if( nullptr == pfnClose ) - return logAndPropagateResult_zeCommandListClose(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); + if( nullptr == pfnAppendMemoryCopyFromContext ) + return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListClosePrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyFromContextPrologue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9668,38 +11594,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListClosePrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyFromContextPrologue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnClose( hCommandList ); + auto driver_result = pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCloseEpilogue( hCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListClose(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyFromContextEpilogue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListClose(driver_result, hCommandList); + return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(driver_result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListReset + /// @brief Intercept function for zeCommandListAppendImageCopy __zedlllocal ze_result_t ZE_APICALL - zeCommandListReset( - ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset + zeCommandListAppendImageCopy( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListReset(hCommandList)"); + context.logger->log_trace("zeCommandListAppendImageCopy(hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnReset = context.zeDdiTable.CommandList.pfnReset; + auto pfnAppendImageCopy = context.zeDdiTable.CommandList.pfnAppendImageCopy; - if( nullptr == pfnReset ) - return logAndPropagateResult_zeCommandListReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); + if( nullptr == pfnAppendImageCopy ) + return logAndPropagateResult_zeCommandListAppendImageCopy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListResetPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyPrologue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9709,45 +11642,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListResetPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyPrologue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnReset( hCommandList ); + auto driver_result = pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListResetEpilogue( hCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListReset(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyEpilogue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListReset(driver_result, hCommandList); + return logAndPropagateResult_zeCommandListAppendImageCopy(driver_result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWriteGlobalTimestamp + /// @brief Intercept function for zeCommandListAppendImageCopyRegion __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWriteGlobalTimestamp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t* dstptr, ///< [in,out] pointer to memory where timestamp value will be written; must - ///< be 8byte-aligned. + zeCommandListAppendImageCopyRegion( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; - ///< must be 0 if `nullptr == phWaitEvents` + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing query + ///< on before launching ) { - context.logger->log_trace("zeCommandListAppendWriteGlobalTimestamp(hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListAppendImageCopyRegion(hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnAppendWriteGlobalTimestamp = context.zeDdiTable.CommandList.pfnAppendWriteGlobalTimestamp; + auto pfnAppendImageCopyRegion = context.zeDdiTable.CommandList.pfnAppendImageCopyRegion; - if( nullptr == pfnAppendWriteGlobalTimestamp ) - return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnAppendImageCopyRegion ) + return logAndPropagateResult_zeCommandListAppendImageCopyRegion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWriteGlobalTimestampPrologue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyRegionPrologue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9757,45 +11692,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWriteGlobalTimestampPrologue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyRegionPrologue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnAppendWriteGlobalTimestamp( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWriteGlobalTimestampEpilogue( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyRegionEpilogue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListAppendWriteGlobalTimestamp(driver_result, hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListAppendImageCopyRegion(driver_result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListHostSynchronize + /// @brief Intercept function for zeCommandListAppendImageCopyToMemory __zedlllocal ze_result_t ZE_APICALL - zeCommandListHostSynchronize( - ze_command_list_handle_t hCommandList, ///< [in] handle of the immediate command list - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then immediately returns the status of the immediate command list; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. + zeCommandListAppendImageCopyToMemory( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListHostSynchronize(hCommandList, timeout)"); + context.logger->log_trace("zeCommandListAppendImageCopyToMemory(hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnHostSynchronize = context.zeDdiTable.CommandList.pfnHostSynchronize; + auto pfnAppendImageCopyToMemory = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemory; - if( nullptr == pfnHostSynchronize ) - return logAndPropagateResult_zeCommandListHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, timeout); + if( nullptr == pfnAppendImageCopyToMemory ) + return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListHostSynchronizePrologue( hCommandList, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9805,39 +11741,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListHostSynchronizePrologue( hCommandList, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyToMemoryPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnHostSynchronize( hCommandList, timeout ); + auto driver_result = pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListHostSynchronizeEpilogue( hCommandList, timeout ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListHostSynchronize(result, hCommandList, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryEpilogue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListHostSynchronize(driver_result, hCommandList, timeout); + return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(driver_result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetDeviceHandle + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemory __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetDeviceHandle( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_device_handle_t* phDevice ///< [out] handle of the device on which the command list was created + zeCommandListAppendImageCopyFromMemory( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListGetDeviceHandle(hCommandList, phDevice)"); + context.logger->log_trace("zeCommandListAppendImageCopyFromMemory(hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetDeviceHandle = context.zeDdiTable.CommandList.pfnGetDeviceHandle; + auto pfnAppendImageCopyFromMemory = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemory; - if( nullptr == pfnGetDeviceHandle ) - return logAndPropagateResult_zeCommandListGetDeviceHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phDevice); + if( nullptr == pfnAppendImageCopyFromMemory ) + return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetDeviceHandlePrologue( hCommandList, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryPrologue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -9847,39 +11790,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetDeviceHandlePrologue( hCommandList, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyFromMemoryPrologue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetDeviceHandle( hCommandList, phDevice ); + auto driver_result = pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetDeviceHandleEpilogue( hCommandList, phDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetDeviceHandle(result, hCommandList, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryEpilogue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListGetDeviceHandle(driver_result, hCommandList, phDevice); + return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(driver_result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetContextHandle + /// @brief Intercept function for zeCommandListAppendMemoryPrefetch __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetContextHandle( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_context_handle_t* phContext ///< [out] handle of the context on which the command list was created + zeCommandListAppendMemoryPrefetch( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + const void* ptr, ///< [in] pointer to start of the memory range to prefetch + size_t size ///< [in] size in bytes of the memory range to prefetch ) { - context.logger->log_trace("zeCommandListGetContextHandle(hCommandList, phContext)"); + context.logger->log_trace("zeCommandListAppendMemoryPrefetch(hCommandList, ptr, size)"); - auto pfnGetContextHandle = context.zeDdiTable.CommandList.pfnGetContextHandle; + auto pfnAppendMemoryPrefetch = context.zeDdiTable.CommandList.pfnAppendMemoryPrefetch; - if( nullptr == pfnGetContextHandle ) - return logAndPropagateResult_zeCommandListGetContextHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phContext); + if( nullptr == pfnAppendMemoryPrefetch ) + return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, size); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetContextHandlePrologue( hCommandList, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryPrefetchPrologue( hCommandList, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); } @@ -9889,39 +11833,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetContextHandlePrologue( hCommandList, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryPrefetchPrologue( hCommandList, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); } - auto driver_result = pfnGetContextHandle( hCommandList, phContext ); + auto driver_result = pfnAppendMemoryPrefetch( hCommandList, ptr, size ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetContextHandleEpilogue( hCommandList, phContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetContextHandle(result, hCommandList, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryPrefetchEpilogue( hCommandList, ptr, size ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); } - return logAndPropagateResult_zeCommandListGetContextHandle(driver_result, hCommandList, phContext); + return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(driver_result, hCommandList, ptr, size); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetOrdinal + /// @brief Intercept function for zeCommandListAppendMemAdvise __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetOrdinal( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t* pOrdinal ///< [out] command queue group ordinal to which command list is submitted + zeCommandListAppendMemAdvise( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_advice_t advice ///< [in] Memory advice for the memory range ) { - context.logger->log_trace("zeCommandListGetOrdinal(hCommandList, pOrdinal)"); + context.logger->log_trace("zeCommandListAppendMemAdvise(hCommandList, hDevice, ptr, size, advice)"); - auto pfnGetOrdinal = context.zeDdiTable.CommandList.pfnGetOrdinal; + auto pfnAppendMemAdvise = context.zeDdiTable.CommandList.pfnAppendMemAdvise; - if( nullptr == pfnGetOrdinal ) - return logAndPropagateResult_zeCommandListGetOrdinal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pOrdinal); + if( nullptr == pfnAppendMemAdvise ) + return logAndPropagateResult_zeCommandListAppendMemAdvise(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDevice, ptr, size, advice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetOrdinalPrologue( hCommandList, pOrdinal ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemAdvisePrologue( hCommandList, hDevice, ptr, size, advice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); } @@ -9931,40 +11878,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetOrdinalPrologue( hCommandList, pOrdinal ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemAdvisePrologue( hCommandList, hDevice, ptr, size, advice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); } - auto driver_result = pfnGetOrdinal( hCommandList, pOrdinal ); + auto driver_result = pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetOrdinalEpilogue( hCommandList, pOrdinal ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetOrdinal(result, hCommandList, pOrdinal); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemAdviseEpilogue( hCommandList, hDevice, ptr, size, advice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); } - return logAndPropagateResult_zeCommandListGetOrdinal(driver_result, hCommandList, pOrdinal); + return logAndPropagateResult_zeCommandListAppendMemAdvise(driver_result, hCommandList, hDevice, ptr, size, advice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateGetIndex + /// @brief Intercept function for zeEventPoolCreate __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateGetIndex( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t* pIndex ///< [out] command queue index within the group to which the immediate - ///< command list is submitted + zeEventPoolCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_event_pool_desc_t* desc, ///< [in] pointer to event pool descriptor + uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == + ///< phDevices` + ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which + ///< have visibility to the event pool. + ///< if nullptr, then event pool is visible to all devices supported by the + ///< driver instance. + ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { - context.logger->log_trace("zeCommandListImmediateGetIndex(hCommandListImmediate, pIndex)"); + context.logger->log_trace("zeEventPoolCreate(hContext, desc, numDevices, phDevicesLocal, phEventPool)"); - auto pfnImmediateGetIndex = context.zeDdiTable.CommandList.pfnImmediateGetIndex; + auto pfnCreate = context.zeDdiTable.EventPool.pfnCreate; - if( nullptr == pfnImmediateGetIndex ) - return logAndPropagateResult_zeCommandListImmediateGetIndex(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, pIndex); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeEventPoolCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, desc, numDevices, phDevices, phEventPool); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetIndexPrologue( hCommandListImmediate, pIndex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCreatePrologue( hContext, desc, numDevices, phDevices, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); } @@ -9974,40 +11927,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateGetIndexPrologue( hCommandListImmediate, pIndex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolCreatePrologue( hContext, desc, numDevices, phDevices, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); } - auto driver_result = pfnImmediateGetIndex( hCommandListImmediate, pIndex ); + auto driver_result = pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateGetIndexEpilogue( hCommandListImmediate, pIndex ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateGetIndex(result, hCommandListImmediate, pIndex); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCreateEpilogue( hContext, desc, numDevices, phDevices, phEventPool ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); } - return logAndPropagateResult_zeCommandListImmediateGetIndex(driver_result, hCommandListImmediate, pIndex); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phEventPool){ + context.handleLifetime->addHandle( *phEventPool ); + context.handleLifetime->addDependent( hContext, *phEventPool ); + + } + } + return logAndPropagateResult_zeEventPoolCreate(driver_result, hContext, desc, numDevices, phDevices, phEventPool); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsImmediate + /// @brief Intercept function for zeEventPoolDestroy __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsImmediate( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsImmediate ///< [out] Boolean indicating whether the command list is an immediate - ///< command list (true) or not (false) + zeEventPoolDestroy( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy ) { - context.logger->log_trace("zeCommandListIsImmediate(hCommandList, pIsImmediate)"); + context.logger->log_trace("zeEventPoolDestroy(hEventPool)"); - auto pfnIsImmediate = context.zeDdiTable.CommandList.pfnIsImmediate; + auto pfnDestroy = context.zeDdiTable.EventPool.pfnDestroy; - if( nullptr == pfnIsImmediate ) - return logAndPropagateResult_zeCommandListIsImmediate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pIsImmediate); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeEventPoolDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsImmediatePrologue( hCommandList, pIsImmediate ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolDestroyPrologue( hEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); } @@ -10017,43 +11977,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsImmediatePrologue( hCommandList, pIsImmediate ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolDestroyPrologue( hEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); } - auto driver_result = pfnIsImmediate( hCommandList, pIsImmediate ); + auto driver_result = pfnDestroy( hEventPool ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsImmediateEpilogue( hCommandList, pIsImmediate ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsImmediate(result, hCommandList, pIsImmediate); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolDestroyEpilogue( hEventPool ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); } - return logAndPropagateResult_zeCommandListIsImmediate(driver_result, hCommandList, pIsImmediate); + return logAndPropagateResult_zeEventPoolDestroy(driver_result, hEventPool); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendBarrier + /// @brief Intercept function for zeEventCreate __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendBarrier( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + zeEventCreate( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + const ze_event_desc_t* desc, ///< [in] pointer to event descriptor + ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ) { - context.logger->log_trace("zeCommandListAppendBarrier(hCommandList, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCreate(hEventPool, desc, phEvent)"); - auto pfnAppendBarrier = context.zeDdiTable.CommandList.pfnAppendBarrier; + auto pfnCreate = context.zeDdiTable.Event.pfnCreate; - if( nullptr == pfnAppendBarrier ) - return logAndPropagateResult_zeCommandListAppendBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeEventCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, desc, phEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendBarrierPrologue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCreatePrologue( hEventPool, desc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); } @@ -10063,46 +12020,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendBarrierPrologue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCreatePrologue( hEventPool, desc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); } - auto driver_result = pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCreate( hEventPool, desc, phEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendBarrierEpilogue( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendBarrier(result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCreateEpilogue( hEventPool, desc, phEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); } - return logAndPropagateResult_zeCommandListAppendBarrier(driver_result, hCommandList, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phEvent){ + context.handleLifetime->addHandle( *phEvent ); + context.handleLifetime->addDependent( hEventPool, *phEvent ); + + } + } + return logAndPropagateResult_zeEventCreate(driver_result, hEventPool, desc, phEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryRangesBarrier + /// @brief Intercept function for zeEventCounterBasedCreate __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryRangesBarrier( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numRanges, ///< [in] number of memory ranges - const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range - const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + zeEventCounterBasedCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + const ze_event_counter_based_desc_t* desc, ///< [in] pointer to counter based event descriptor + ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ) { - context.logger->log_trace("zeCommandListAppendMemoryRangesBarrier(hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCounterBasedCreate(hContext, hDevice, desc, phEvent)"); - auto pfnAppendMemoryRangesBarrier = context.zeDdiTable.CommandList.pfnAppendMemoryRangesBarrier; + auto pfnCounterBasedCreate = context.zeDdiTable.Event.pfnCounterBasedCreate; - if( nullptr == pfnAppendMemoryRangesBarrier ) - return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCounterBasedCreate ) + return logAndPropagateResult_zeEventCounterBasedCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryRangesBarrierPrologue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCreatePrologue( hContext, hDevice, desc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); } @@ -10112,39 +12073,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryRangesBarrierPrologue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedCreatePrologue( hContext, hDevice, desc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); } - auto driver_result = pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryRangesBarrierEpilogue( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCreateEpilogue( hContext, hDevice, desc, phEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); } - return logAndPropagateResult_zeCommandListAppendMemoryRangesBarrier(driver_result, hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phEvent){ + context.handleLifetime->addHandle( *phEvent ); + context.handleLifetime->addDependent( hContext, *phEvent ); + + } + } + return logAndPropagateResult_zeEventCounterBasedCreate(driver_result, hContext, hDevice, desc, phEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextSystemBarrier + /// @brief Intercept function for zeEventDestroy __zedlllocal ze_result_t ZE_APICALL - zeContextSystemBarrier( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice ///< [in] handle of the device + zeEventDestroy( + ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy ) { - context.logger->log_trace("zeContextSystemBarrier(hContext, hDevice)"); + context.logger->log_trace("zeEventDestroy(hEvent)"); - auto pfnSystemBarrier = context.zeDdiTable.Context.pfnSystemBarrier; + auto pfnDestroy = context.zeDdiTable.Event.pfnDestroy; - if( nullptr == pfnSystemBarrier ) - return logAndPropagateResult_zeContextSystemBarrier(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeEventDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextSystemBarrierPrologue( hContext, hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeEventDestroyPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); } @@ -10154,46 +12123,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextSystemBarrierPrologue( hContext, hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeEventDestroyPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); } - auto driver_result = pfnSystemBarrier( hContext, hDevice ); + auto driver_result = pfnDestroy( hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextSystemBarrierEpilogue( hContext, hDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextSystemBarrier(result, hContext, hDevice); + auto result = context.validationHandlers[i]->zeValidation->zeEventDestroyEpilogue( hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); } - return logAndPropagateResult_zeContextSystemBarrier(driver_result, hContext, hDevice); + return logAndPropagateResult_zeEventDestroy(driver_result, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryCopy + /// @brief Intercept function for zeEventPoolGetIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryCopy( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventPoolGetIpcHandle( + ze_event_pool_handle_t hEventPool, ///< [in] handle of event pool object + ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle ) { - context.logger->log_trace("zeCommandListAppendMemoryCopy(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventPoolGetIpcHandle(hEventPool, phIpc)"); - auto pfnAppendMemoryCopy = context.zeDdiTable.CommandList.pfnAppendMemoryCopy; + auto pfnGetIpcHandle = context.zeDdiTable.EventPool.pfnGetIpcHandle; - if( nullptr == pfnAppendMemoryCopy ) - return logAndPropagateResult_zeCommandListAppendMemoryCopy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnGetIpcHandle ) + return logAndPropagateResult_zeEventPoolGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, phIpc); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetIpcHandlePrologue( hEventPool, phIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); } @@ -10203,47 +12165,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetIpcHandlePrologue( hEventPool, phIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); } - auto driver_result = pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnGetIpcHandle( hEventPool, phIpc ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopy(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetIpcHandleEpilogue( hEventPool, phIpc ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); } - return logAndPropagateResult_zeCommandListAppendMemoryCopy(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeEventPoolGetIpcHandle(driver_result, hEventPool, phIpc); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryCopyWithParameters + /// @brief Intercept function for zeEventPoolPutIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryCopyWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - size_t size, ///< [in] size in bytes to copy - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventPoolPutIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object associated with the IPC event pool + ///< handle + ze_ipc_event_pool_handle_t hIpc ///< [in] IPC event pool handle ) { - context.logger->log_trace("zeCommandListAppendMemoryCopyWithParameters(hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventPoolPutIpcHandle(hContext, hIpc)"); - auto pfnAppendMemoryCopyWithParameters = context.zeDdiTable.CommandList.pfnAppendMemoryCopyWithParameters; + auto pfnPutIpcHandle = context.zeDdiTable.EventPool.pfnPutIpcHandle; - if( nullptr == pfnAppendMemoryCopyWithParameters ) - return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnPutIpcHandle ) + return logAndPropagateResult_zeEventPoolPutIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyWithParametersPrologue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolPutIpcHandlePrologue( hContext, hIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); } @@ -10253,47 +12212,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyWithParametersPrologue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolPutIpcHandlePrologue( hContext, hIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); } - auto driver_result = pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnPutIpcHandle( hContext, hIpc ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyWithParametersEpilogue( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolPutIpcHandleEpilogue( hContext, hIpc ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); } - return logAndPropagateResult_zeCommandListAppendMemoryCopyWithParameters(driver_result, hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventPoolPutIpcHandle(driver_result, hContext, hIpc); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryFill + /// @brief Intercept function for zeEventPoolOpenIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryFill( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* ptr, ///< [in] pointer to memory to initialize - const void* pattern, ///< [in] pointer to value to initialize memory to - size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to - size_t size, ///< [in] size in bytes to initialize - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventPoolOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event pool + ///< handle + ze_ipc_event_pool_handle_t hIpc, ///< [in] IPC event pool handle + ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { - context.logger->log_trace("zeCommandListAppendMemoryFill(hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventPoolOpenIpcHandle(hContext, hIpc, phEventPool)"); - auto pfnAppendMemoryFill = context.zeDdiTable.CommandList.pfnAppendMemoryFill; + auto pfnOpenIpcHandle = context.zeDdiTable.EventPool.pfnOpenIpcHandle; - if( nullptr == pfnAppendMemoryFill ) - return logAndPropagateResult_zeCommandListAppendMemoryFill(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnOpenIpcHandle ) + return logAndPropagateResult_zeEventPoolOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc, phEventPool); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillPrologue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolOpenIpcHandlePrologue( hContext, hIpc, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); } @@ -10303,48 +12256,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryFillPrologue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolOpenIpcHandlePrologue( hContext, hIpc, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); } - auto driver_result = pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnOpenIpcHandle( hContext, hIpc, phEventPool ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillEpilogue( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFill(result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolOpenIpcHandleEpilogue( hContext, hIpc, phEventPool ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); } - return logAndPropagateResult_zeCommandListAppendMemoryFill(driver_result, hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventPoolOpenIpcHandle(driver_result, hContext, hIpc, phEventPool); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryFillWithParameters + /// @brief Intercept function for zeEventPoolCloseIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryFillWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* ptr, ///< [in] pointer to memory to initialize - const void* pattern, ///< [in] pointer to value to initialize memory to - size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to - size_t size, ///< [in] size in bytes to initialize - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventPoolCloseIpcHandle( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object ) { - context.logger->log_trace("zeCommandListAppendMemoryFillWithParameters(hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventPoolCloseIpcHandle(hEventPool)"); - auto pfnAppendMemoryFillWithParameters = context.zeDdiTable.CommandList.pfnAppendMemoryFillWithParameters; + auto pfnCloseIpcHandle = context.zeDdiTable.EventPool.pfnCloseIpcHandle; - if( nullptr == pfnAppendMemoryFillWithParameters ) - return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCloseIpcHandle ) + return logAndPropagateResult_zeEventPoolCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillWithParametersPrologue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCloseIpcHandlePrologue( hEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); } @@ -10354,55 +12297,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryFillWithParametersPrologue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolCloseIpcHandlePrologue( hEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); } - auto driver_result = pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCloseIpcHandle( hEventPool ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryFillWithParametersEpilogue( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCloseIpcHandleEpilogue( hEventPool ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); } - return logAndPropagateResult_zeCommandListAppendMemoryFillWithParameters(driver_result, hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventPoolCloseIpcHandle(driver_result, hEventPool); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryCopyRegion + /// @brief Intercept function for zeEventCounterBasedGetIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryCopyRegion( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - const ze_copy_region_t* dstRegion, ///< [in] pointer to destination region to copy to - uint32_t dstPitch, ///< [in] destination pitch in bytes - uint32_t dstSlicePitch, ///< [in] destination slice pitch in bytes. This is required for 3D region - ///< copies where the `depth` member of ::ze_copy_region_t is not 0, - ///< otherwise it's ignored. - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_copy_region_t* srcRegion, ///< [in] pointer to source region to copy from - uint32_t srcPitch, ///< [in] source pitch in bytes - uint32_t srcSlicePitch, ///< [in] source slice pitch in bytes. This is required for 3D region - ///< copies where the `depth` member of ::ze_copy_region_t is not 0, - ///< otherwise it's ignored. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventCounterBasedGetIpcHandle( + ze_event_handle_t hEvent, ///< [in] handle of event object + ze_ipc_event_counter_based_handle_t* phIpc ///< [out] Returned IPC event handle ) { - context.logger->log_trace("zeCommandListAppendMemoryCopyRegion(hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCounterBasedGetIpcHandle(hEvent, phIpc)"); - auto pfnAppendMemoryCopyRegion = context.zeDdiTable.CommandList.pfnAppendMemoryCopyRegion; + auto pfnCounterBasedGetIpcHandle = context.zeDdiTable.Event.pfnCounterBasedGetIpcHandle; - if( nullptr == pfnAppendMemoryCopyRegion ) - return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCounterBasedGetIpcHandle ) + return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, phIpc); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyRegionPrologue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetIpcHandlePrologue( hEvent, phIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); } @@ -10412,47 +12339,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyRegionPrologue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedGetIpcHandlePrologue( hEvent, phIpc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); } - auto driver_result = pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCounterBasedGetIpcHandle( hEvent, phIpc ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyRegionEpilogue( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetIpcHandleEpilogue( hEvent, phIpc ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); } - return logAndPropagateResult_zeCommandListAppendMemoryCopyRegion(driver_result, hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(driver_result, hEvent, phIpc); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryCopyFromContext + /// @brief Intercept function for zeEventCounterBasedOpenIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryCopyFromContext( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_context_handle_t hContextSrc, ///< [in] handle of source context object - const void* srcptr, ///< [in] pointer to source memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventCounterBasedOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event + ///< handle + ze_ipc_event_counter_based_handle_t hIpc, ///< [in] IPC event handle + ze_event_handle_t* phEvent ///< [out] pointer handle of event object created ) { - context.logger->log_trace("zeCommandListAppendMemoryCopyFromContext(hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCounterBasedOpenIpcHandle(hContext, hIpc, phEvent)"); - auto pfnAppendMemoryCopyFromContext = context.zeDdiTable.CommandList.pfnAppendMemoryCopyFromContext; + auto pfnCounterBasedOpenIpcHandle = context.zeDdiTable.Event.pfnCounterBasedOpenIpcHandle; - if( nullptr == pfnAppendMemoryCopyFromContext ) - return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCounterBasedOpenIpcHandle ) + return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc, phEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyFromContextPrologue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedOpenIpcHandlePrologue( hContext, hIpc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); } @@ -10462,45 +12387,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryCopyFromContextPrologue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedOpenIpcHandlePrologue( hContext, hIpc, phEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); } - auto driver_result = pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryCopyFromContextEpilogue( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedOpenIpcHandleEpilogue( hContext, hIpc, phEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); } - return logAndPropagateResult_zeCommandListAppendMemoryCopyFromContext(driver_result, hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(driver_result, hContext, hIpc, phEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopy + /// @brief Intercept function for zeEventCounterBasedCloseIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopy( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventCounterBasedCloseIpcHandle( + ze_event_handle_t hEvent ///< [in][release] handle of event object ) { - context.logger->log_trace("zeCommandListAppendImageCopy(hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCounterBasedCloseIpcHandle(hEvent)"); - auto pfnAppendImageCopy = context.zeDdiTable.CommandList.pfnAppendImageCopy; + auto pfnCounterBasedCloseIpcHandle = context.zeDdiTable.Event.pfnCounterBasedCloseIpcHandle; - if( nullptr == pfnAppendImageCopy ) - return logAndPropagateResult_zeCommandListAppendImageCopy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCounterBasedCloseIpcHandle ) + return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyPrologue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCloseIpcHandlePrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); } @@ -10510,47 +12428,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyPrologue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedCloseIpcHandlePrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); } - auto driver_result = pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCounterBasedCloseIpcHandle( hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyEpilogue( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopy(result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCloseIpcHandleEpilogue( hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); } - return logAndPropagateResult_zeCommandListAppendImageCopy(driver_result, hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(driver_result, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyRegion + /// @brief Intercept function for zeEventCounterBasedGetDeviceAddress __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyRegion( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventCounterBasedGetDeviceAddress( + ze_event_handle_t hEvent, ///< [in] handle of event object + uint64_t* completionValue, ///< [in][out] completion value + uint64_t* deviceAddress ///< [in][out] counter device address ) { - context.logger->log_trace("zeCommandListAppendImageCopyRegion(hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeEventCounterBasedGetDeviceAddress(hEvent, completionValue, deviceAddress)"); - auto pfnAppendImageCopyRegion = context.zeDdiTable.CommandList.pfnAppendImageCopyRegion; + auto pfnCounterBasedGetDeviceAddress = context.zeDdiTable.Event.pfnCounterBasedGetDeviceAddress; - if( nullptr == pfnAppendImageCopyRegion ) - return logAndPropagateResult_zeCommandListAppendImageCopyRegion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCounterBasedGetDeviceAddress ) + return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, completionValue, deviceAddress); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyRegionPrologue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetDeviceAddressPrologue( hEvent, completionValue, deviceAddress ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); } @@ -10560,46 +12471,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyRegionPrologue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedGetDeviceAddressPrologue( hEvent, completionValue, deviceAddress ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); } - auto driver_result = pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyRegionEpilogue( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyRegion(result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetDeviceAddressEpilogue( hEvent, completionValue, deviceAddress ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); } - return logAndPropagateResult_zeCommandListAppendImageCopyRegion(driver_result, hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(driver_result, hEvent, completionValue, deviceAddress); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemory + /// @brief Intercept function for zeCommandListAppendSignalEvent __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemory( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListAppendSignalEvent( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_event_handle_t hEvent ///< [in] handle of the event ) { - context.logger->log_trace("zeCommandListAppendImageCopyToMemory(hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListAppendSignalEvent(hCommandList, hEvent)"); - auto pfnAppendImageCopyToMemory = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemory; + auto pfnAppendSignalEvent = context.zeDdiTable.CommandList.pfnAppendSignalEvent; - if( nullptr == pfnAppendImageCopyToMemory ) - return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnAppendSignalEvent ) + return logAndPropagateResult_zeCommandListAppendSignalEvent(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventPrologue( hCommandList, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); } @@ -10609,46 +12513,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyToMemoryPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalEventPrologue( hCommandList, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); } - auto driver_result = pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnAppendSignalEvent( hCommandList, hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryEpilogue( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventEpilogue( hCommandList, hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); } - return logAndPropagateResult_zeCommandListAppendImageCopyToMemory(driver_result, hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListAppendSignalEvent(driver_result, hCommandList, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemory + /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemory( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + 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 + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing ) { - context.logger->log_trace("zeCommandListAppendImageCopyFromMemory(hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListAppendWaitOnEvents(hCommandList, numEvents, phEventsLocal)"); - auto pfnAppendImageCopyFromMemory = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemory; + auto pfnAppendWaitOnEvents = context.zeDdiTable.CommandList.pfnAppendWaitOnEvents; - if( nullptr == pfnAppendImageCopyFromMemory ) - return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnAppendWaitOnEvents ) + return logAndPropagateResult_zeCommandListAppendWaitOnEvents(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numEvents, phEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryPrologue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsPrologue( hCommandList, numEvents, phEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); } @@ -10658,40 +12557,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyFromMemoryPrologue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitOnEventsPrologue( hCommandList, numEvents, phEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); } - auto driver_result = pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryEpilogue( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsEpilogue( hCommandList, numEvents, phEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); } - return logAndPropagateResult_zeCommandListAppendImageCopyFromMemory(driver_result, hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListAppendWaitOnEvents(driver_result, hCommandList, numEvents, phEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemoryPrefetch + /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemoryPrefetch( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - const void* ptr, ///< [in] pointer to start of the memory range to prefetch - size_t size ///< [in] size in bytes of the memory range to prefetch + zeEventHostSignal( + ze_event_handle_t hEvent ///< [in] handle of the event ) { - context.logger->log_trace("zeCommandListAppendMemoryPrefetch(hCommandList, ptr, size)"); + context.logger->log_trace("zeEventHostSignal(hEvent)"); - auto pfnAppendMemoryPrefetch = context.zeDdiTable.CommandList.pfnAppendMemoryPrefetch; + auto pfnHostSignal = context.zeDdiTable.Event.pfnHostSignal; - if( nullptr == pfnAppendMemoryPrefetch ) - return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, ptr, size); + if( nullptr == pfnHostSignal ) + return logAndPropagateResult_zeEventHostSignal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryPrefetchPrologue( hCommandList, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostSignalPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); } @@ -10701,42 +12598,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemoryPrefetchPrologue( hCommandList, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); + auto result = context.handleLifetime->zeHandleLifetime.zeEventHostSignalPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); } - auto driver_result = pfnAppendMemoryPrefetch( hCommandList, ptr, size ); + auto driver_result = pfnHostSignal( hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemoryPrefetchEpilogue( hCommandList, ptr, size ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(result, hCommandList, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostSignalEpilogue( hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); } - return logAndPropagateResult_zeCommandListAppendMemoryPrefetch(driver_result, hCommandList, ptr, size); + return logAndPropagateResult_zeEventHostSignal(driver_result, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendMemAdvise + /// @brief Intercept function for zeEventHostSynchronize __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendMemAdvise( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_advice_t advice ///< [in] Memory advice for the memory range + zeEventHostSynchronize( + ze_event_handle_t hEvent, ///< [in] handle of the event + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then operates exactly like ::zeEventQueryStatus; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { - context.logger->log_trace("zeCommandListAppendMemAdvise(hCommandList, hDevice, ptr, size, advice)"); + context.logger->log_trace("zeEventHostSynchronize(hEvent, timeout)"); - auto pfnAppendMemAdvise = context.zeDdiTable.CommandList.pfnAppendMemAdvise; + auto pfnHostSynchronize = context.zeDdiTable.Event.pfnHostSynchronize; - if( nullptr == pfnAppendMemAdvise ) - return logAndPropagateResult_zeCommandListAppendMemAdvise(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDevice, ptr, size, advice); + if( nullptr == pfnHostSynchronize ) + return logAndPropagateResult_zeEventHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, timeout); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemAdvisePrologue( hCommandList, hDevice, ptr, size, advice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostSynchronizePrologue( hEvent, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); } @@ -10746,46 +12646,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendMemAdvisePrologue( hCommandList, hDevice, ptr, size, advice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); + auto result = context.handleLifetime->zeHandleLifetime.zeEventHostSynchronizePrologue( hEvent, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); } - auto driver_result = pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); + auto driver_result = pfnHostSynchronize( hEvent, timeout ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendMemAdviseEpilogue( hCommandList, hDevice, ptr, size, advice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendMemAdvise(result, hCommandList, hDevice, ptr, size, advice); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostSynchronizeEpilogue( hEvent, timeout ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); } - return logAndPropagateResult_zeCommandListAppendMemAdvise(driver_result, hCommandList, hDevice, ptr, size, advice); + return logAndPropagateResult_zeEventHostSynchronize(driver_result, hEvent, timeout); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolCreate + /// @brief Intercept function for zeEventQueryStatus __zedlllocal ze_result_t ZE_APICALL - zeEventPoolCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_event_pool_desc_t* desc, ///< [in] pointer to event pool descriptor - uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == - ///< phDevices` - ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which - ///< have visibility to the event pool. - ///< if nullptr, then event pool is visible to all devices supported by the - ///< driver instance. - ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created + zeEventQueryStatus( + ze_event_handle_t hEvent ///< [in] handle of the event ) { - context.logger->log_trace("zeEventPoolCreate(hContext, desc, numDevices, phDevicesLocal, phEventPool)"); + context.logger->log_trace("zeEventQueryStatus(hEvent)"); - auto pfnCreate = context.zeDdiTable.EventPool.pfnCreate; + auto pfnQueryStatus = context.zeDdiTable.Event.pfnQueryStatus; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeEventPoolCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, desc, numDevices, phDevices, phEventPool); + if( nullptr == pfnQueryStatus ) + return logAndPropagateResult_zeEventQueryStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCreatePrologue( hContext, desc, numDevices, phDevices, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryStatusPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); } @@ -10795,47 +12687,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolCreatePrologue( hContext, desc, numDevices, phDevices, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); + auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryStatusPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); } - auto driver_result = pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); + auto driver_result = pfnQueryStatus( hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCreateEpilogue( hContext, desc, numDevices, phDevices, phEventPool ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCreate(result, hContext, desc, numDevices, phDevices, phEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryStatusEpilogue( hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phEventPool){ - context.handleLifetime->addHandle( *phEventPool ); - context.handleLifetime->addDependent( hContext, *phEventPool ); - - } - } - return logAndPropagateResult_zeEventPoolCreate(driver_result, hContext, desc, numDevices, phDevices, phEventPool); + return logAndPropagateResult_zeEventQueryStatus(driver_result, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolDestroy + /// @brief Intercept function for zeCommandListAppendEventReset __zedlllocal ze_result_t ZE_APICALL - zeEventPoolDestroy( - ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy + zeCommandListAppendEventReset( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_event_handle_t hEvent ///< [in] handle of the event ) { - context.logger->log_trace("zeEventPoolDestroy(hEventPool)"); + context.logger->log_trace("zeCommandListAppendEventReset(hCommandList, hEvent)"); - auto pfnDestroy = context.zeDdiTable.EventPool.pfnDestroy; + auto pfnAppendEventReset = context.zeDdiTable.CommandList.pfnAppendEventReset; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeEventPoolDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool); + if( nullptr == pfnAppendEventReset ) + return logAndPropagateResult_zeCommandListAppendEventReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolDestroyPrologue( hEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendEventResetPrologue( hCommandList, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); } @@ -10845,40 +12729,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolDestroyPrologue( hEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendEventResetPrologue( hCommandList, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); } - auto driver_result = pfnDestroy( hEventPool ); + auto driver_result = pfnAppendEventReset( hCommandList, hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolDestroyEpilogue( hEventPool ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolDestroy(result, hEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendEventResetEpilogue( hCommandList, hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); } - return logAndPropagateResult_zeEventPoolDestroy(driver_result, hEventPool); + return logAndPropagateResult_zeCommandListAppendEventReset(driver_result, hCommandList, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCreate + /// @brief Intercept function for zeEventHostReset __zedlllocal ze_result_t ZE_APICALL - zeEventCreate( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - const ze_event_desc_t* desc, ///< [in] pointer to event descriptor - ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created + zeEventHostReset( + ze_event_handle_t hEvent ///< [in] handle of the event ) { - context.logger->log_trace("zeEventCreate(hEventPool, desc, phEvent)"); + context.logger->log_trace("zeEventHostReset(hEvent)"); - auto pfnCreate = context.zeDdiTable.Event.pfnCreate; + auto pfnHostReset = context.zeDdiTable.Event.pfnHostReset; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeEventCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, desc, phEvent); + if( nullptr == pfnHostReset ) + return logAndPropagateResult_zeEventHostReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCreatePrologue( hEventPool, desc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostResetPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); } @@ -10888,50 +12770,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCreatePrologue( hEventPool, desc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeEventHostResetPrologue( hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); } - auto driver_result = pfnCreate( hEventPool, desc, phEvent ); + auto driver_result = pfnHostReset( hEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCreateEpilogue( hEventPool, desc, phEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCreate(result, hEventPool, desc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventHostResetEpilogue( hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phEvent){ - context.handleLifetime->addHandle( *phEvent ); - context.handleLifetime->addDependent( hEventPool, *phEvent ); - - } - } - return logAndPropagateResult_zeEventCreate(driver_result, hEventPool, desc, phEvent); + return logAndPropagateResult_zeEventHostReset(driver_result, hEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCounterBasedCreate + /// @brief Intercept function for zeEventQueryKernelTimestamp __zedlllocal ze_result_t ZE_APICALL - zeEventCounterBasedCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - const ze_event_counter_based_desc_t* desc, ///< [in] pointer to counter based event descriptor - ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created + zeEventQueryKernelTimestamp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. ) { - context.logger->log_trace("zeEventCounterBasedCreate(hContext, hDevice, desc, phEvent)"); + context.logger->log_trace("zeEventQueryKernelTimestamp(hEvent, dstptr)"); - auto pfnCounterBasedCreate = context.zeDdiTable.Event.pfnCounterBasedCreate; + auto pfnQueryKernelTimestamp = context.zeDdiTable.Event.pfnQueryKernelTimestamp; - if( nullptr == pfnCounterBasedCreate ) - return logAndPropagateResult_zeEventCounterBasedCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phEvent); + if( nullptr == pfnQueryKernelTimestamp ) + return logAndPropagateResult_zeEventQueryKernelTimestamp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, dstptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCreatePrologue( hContext, hDevice, desc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampPrologue( hEvent, dstptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); } @@ -10941,47 +12812,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedCreatePrologue( hContext, hDevice, desc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryKernelTimestampPrologue( hEvent, dstptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); } - auto driver_result = pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); + auto driver_result = pfnQueryKernelTimestamp( hEvent, dstptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCreateEpilogue( hContext, hDevice, desc, phEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCreate(result, hContext, hDevice, desc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampEpilogue( hEvent, dstptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phEvent){ - context.handleLifetime->addHandle( *phEvent ); - context.handleLifetime->addDependent( hContext, *phEvent ); - - } - } - return logAndPropagateResult_zeEventCounterBasedCreate(driver_result, hContext, hDevice, desc, phEvent); + return logAndPropagateResult_zeEventQueryKernelTimestamp(driver_result, hEvent, dstptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventDestroy + /// @brief Intercept function for zeCommandListAppendQueryKernelTimestamps __zedlllocal ze_result_t ZE_APICALL - zeEventDestroy( - ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy + zeCommandListAppendQueryKernelTimestamps( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numEvents, ///< [in] the number of timestamp events to query + ze_event_handle_t* phEvents, ///< [in][range(0, numEvents)] handles of timestamp events to query + void* dstptr, ///< [in,out] pointer to memory where ::ze_kernel_timestamp_result_t will + ///< be written; must be size-aligned. + const size_t* pOffsets, ///< [in][optional][range(0, numEvents)] offset, in bytes, to write + ///< results; address must be 4byte-aligned and offsets must be + ///< size-aligned. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing query ) { - context.logger->log_trace("zeEventDestroy(hEvent)"); + context.logger->log_trace("zeCommandListAppendQueryKernelTimestamps(hCommandList, numEvents, phEventsLocal, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnDestroy = context.zeDdiTable.Event.pfnDestroy; + auto pfnAppendQueryKernelTimestamps = context.zeDdiTable.CommandList.pfnAppendQueryKernelTimestamps; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeEventDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); + if( nullptr == pfnAppendQueryKernelTimestamps ) + return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventDestroyPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendQueryKernelTimestampsPrologue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -10991,39 +12865,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventDestroyPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendQueryKernelTimestampsPrologue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnDestroy( hEvent ); + auto driver_result = pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventDestroyEpilogue( hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventDestroy(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendQueryKernelTimestampsEpilogue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeEventDestroy(driver_result, hEvent); + return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(driver_result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolGetIpcHandle + /// @brief Intercept function for zeEventGetEventPool __zedlllocal ze_result_t ZE_APICALL - zeEventPoolGetIpcHandle( - ze_event_pool_handle_t hEventPool, ///< [in] handle of event pool object - ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle + zeEventGetEventPool( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event ) { - context.logger->log_trace("zeEventPoolGetIpcHandle(hEventPool, phIpc)"); + context.logger->log_trace("zeEventGetEventPool(hEvent, phEventPool)"); - auto pfnGetIpcHandle = context.zeDdiTable.EventPool.pfnGetIpcHandle; + auto pfnGetEventPool = context.zeDdiTable.Event.pfnGetEventPool; - if( nullptr == pfnGetIpcHandle ) - return logAndPropagateResult_zeEventPoolGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, phIpc); + if( nullptr == pfnGetEventPool ) + return logAndPropagateResult_zeEventGetEventPool(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, phEventPool); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetIpcHandlePrologue( hEventPool, phIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetEventPoolPrologue( hEvent, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); } @@ -11033,44 +12907,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetIpcHandlePrologue( hEventPool, phIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); + auto result = context.handleLifetime->zeHandleLifetime.zeEventGetEventPoolPrologue( hEvent, phEventPool ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); } - auto driver_result = pfnGetIpcHandle( hEventPool, phIpc ); + auto driver_result = pfnGetEventPool( hEvent, phEventPool ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetIpcHandleEpilogue( hEventPool, phIpc ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetIpcHandle(result, hEventPool, phIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetEventPoolEpilogue( hEvent, phEventPool ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeEventPoolGetIpcHandle(driver_result, hEventPool, phIpc); + return logAndPropagateResult_zeEventGetEventPool(driver_result, hEvent, phEventPool); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolPutIpcHandle + /// @brief Intercept function for zeEventGetSignalScope __zedlllocal ze_result_t ZE_APICALL - zeEventPoolPutIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object associated with the IPC event pool - ///< handle - ze_ipc_event_pool_handle_t hIpc ///< [in] IPC event pool handle + zeEventGetSignalScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pSignalScope ///< [out] signal event scope. This is the scope of relevant cache + ///< hierarchies that are flushed on a signal action before the event is + ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { - context.logger->log_trace("zeEventPoolPutIpcHandle(hContext, hIpc)"); + context.logger->log_trace("zeEventGetSignalScope(hEvent, pSignalScope)"); - auto pfnPutIpcHandle = context.zeDdiTable.EventPool.pfnPutIpcHandle; + auto pfnGetSignalScope = context.zeDdiTable.Event.pfnGetSignalScope; - if( nullptr == pfnPutIpcHandle ) - return logAndPropagateResult_zeEventPoolPutIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc); + if( nullptr == pfnGetSignalScope ) + return logAndPropagateResult_zeEventGetSignalScope(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, pSignalScope); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolPutIpcHandlePrologue( hContext, hIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetSignalScopePrologue( hEvent, pSignalScope ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); } @@ -11080,41 +12951,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolPutIpcHandlePrologue( hContext, hIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); + auto result = context.handleLifetime->zeHandleLifetime.zeEventGetSignalScopePrologue( hEvent, pSignalScope ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); } - auto driver_result = pfnPutIpcHandle( hContext, hIpc ); + auto driver_result = pfnGetSignalScope( hEvent, pSignalScope ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolPutIpcHandleEpilogue( hContext, hIpc ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolPutIpcHandle(result, hContext, hIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetSignalScopeEpilogue( hEvent, pSignalScope ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); } - return logAndPropagateResult_zeEventPoolPutIpcHandle(driver_result, hContext, hIpc); + return logAndPropagateResult_zeEventGetSignalScope(driver_result, hEvent, pSignalScope); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolOpenIpcHandle + /// @brief Intercept function for zeEventGetWaitScope __zedlllocal ze_result_t ZE_APICALL - zeEventPoolOpenIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event pool - ///< handle - ze_ipc_event_pool_handle_t hIpc, ///< [in] IPC event pool handle - ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created + zeEventGetWaitScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pWaitScope ///< [out] wait event scope. This is the scope of relevant cache + ///< hierarchies invalidated on a wait action after the event is complete. + ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { - context.logger->log_trace("zeEventPoolOpenIpcHandle(hContext, hIpc, phEventPool)"); + context.logger->log_trace("zeEventGetWaitScope(hEvent, pWaitScope)"); - auto pfnOpenIpcHandle = context.zeDdiTable.EventPool.pfnOpenIpcHandle; + auto pfnGetWaitScope = context.zeDdiTable.Event.pfnGetWaitScope; - if( nullptr == pfnOpenIpcHandle ) - return logAndPropagateResult_zeEventPoolOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc, phEventPool); + if( nullptr == pfnGetWaitScope ) + return logAndPropagateResult_zeEventGetWaitScope(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, pWaitScope); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolOpenIpcHandlePrologue( hContext, hIpc, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetWaitScopePrologue( hEvent, pWaitScope ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); } @@ -11124,38 +12995,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolOpenIpcHandlePrologue( hContext, hIpc, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); + auto result = context.handleLifetime->zeHandleLifetime.zeEventGetWaitScopePrologue( hEvent, pWaitScope ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); } - auto driver_result = pfnOpenIpcHandle( hContext, hIpc, phEventPool ); + auto driver_result = pfnGetWaitScope( hEvent, pWaitScope ); - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolOpenIpcHandleEpilogue( hContext, hIpc, phEventPool ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolOpenIpcHandle(result, hContext, hIpc, phEventPool); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeEventGetWaitScopeEpilogue( hEvent, pWaitScope ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); } - return logAndPropagateResult_zeEventPoolOpenIpcHandle(driver_result, hContext, hIpc, phEventPool); + return logAndPropagateResult_zeEventGetWaitScope(driver_result, hEvent, pWaitScope); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolCloseIpcHandle + /// @brief Intercept function for zeEventPoolGetContextHandle __zedlllocal ze_result_t ZE_APICALL - zeEventPoolCloseIpcHandle( - ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object + zeEventPoolGetContextHandle( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created ) { - context.logger->log_trace("zeEventPoolCloseIpcHandle(hEventPool)"); + context.logger->log_trace("zeEventPoolGetContextHandle(hEventPool, phContext)"); - auto pfnCloseIpcHandle = context.zeDdiTable.EventPool.pfnCloseIpcHandle; + auto pfnGetContextHandle = context.zeDdiTable.EventPool.pfnGetContextHandle; - if( nullptr == pfnCloseIpcHandle ) - return logAndPropagateResult_zeEventPoolCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool); + if( nullptr == pfnGetContextHandle ) + return logAndPropagateResult_zeEventPoolGetContextHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, phContext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCloseIpcHandlePrologue( hEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetContextHandlePrologue( hEventPool, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); } @@ -11165,39 +13037,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolCloseIpcHandlePrologue( hEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetContextHandlePrologue( hEventPool, phContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); } - auto driver_result = pfnCloseIpcHandle( hEventPool ); + auto driver_result = pfnGetContextHandle( hEventPool, phContext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolCloseIpcHandleEpilogue( hEventPool ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolCloseIpcHandle(result, hEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetContextHandleEpilogue( hEventPool, phContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); } - return logAndPropagateResult_zeEventPoolCloseIpcHandle(driver_result, hEventPool); + return logAndPropagateResult_zeEventPoolGetContextHandle(driver_result, hEventPool, phContext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCounterBasedGetIpcHandle + /// @brief Intercept function for zeEventPoolGetFlags __zedlllocal ze_result_t ZE_APICALL - zeEventCounterBasedGetIpcHandle( - ze_event_handle_t hEvent, ///< [in] handle of event object - ze_ipc_event_counter_based_handle_t* phIpc ///< [out] Returned IPC event handle + zeEventPoolGetFlags( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_event_pool_flags_t* pFlags ///< [out] creation flags used to create the event pool; may be 0 or a + ///< valid combination of ::ze_event_pool_flag_t ) { - context.logger->log_trace("zeEventCounterBasedGetIpcHandle(hEvent, phIpc)"); + context.logger->log_trace("zeEventPoolGetFlags(hEventPool, pFlags)"); - auto pfnCounterBasedGetIpcHandle = context.zeDdiTable.Event.pfnCounterBasedGetIpcHandle; + auto pfnGetFlags = context.zeDdiTable.EventPool.pfnGetFlags; - if( nullptr == pfnCounterBasedGetIpcHandle ) - return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, phIpc); + if( nullptr == pfnGetFlags ) + return logAndPropagateResult_zeEventPoolGetFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetIpcHandlePrologue( hEvent, phIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetFlagsPrologue( hEventPool, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); } @@ -11207,45 +13080,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedGetIpcHandlePrologue( hEvent, phIpc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); + auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetFlagsPrologue( hEventPool, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); } - auto driver_result = pfnCounterBasedGetIpcHandle( hEvent, phIpc ); + auto driver_result = pfnGetFlags( hEventPool, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetIpcHandleEpilogue( hEvent, phIpc ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(result, hEvent, phIpc); + auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetFlagsEpilogue( hEventPool, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeEventCounterBasedGetIpcHandle(driver_result, hEvent, phIpc); + return logAndPropagateResult_zeEventPoolGetFlags(driver_result, hEventPool, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCounterBasedOpenIpcHandle + /// @brief Intercept function for zeEventGetCounterBasedFlags __zedlllocal ze_result_t ZE_APICALL - zeEventCounterBasedOpenIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event - ///< handle - ze_ipc_event_counter_based_handle_t hIpc, ///< [in] IPC event handle - ze_event_handle_t* phEvent ///< [out] pointer handle of event object created + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t ) { - context.logger->log_trace("zeEventCounterBasedOpenIpcHandle(hContext, hIpc, phEvent)"); + context.logger->log_trace("zeEventGetCounterBasedFlags(hEvent, pFlags)"); - auto pfnCounterBasedOpenIpcHandle = context.zeDdiTable.Event.pfnCounterBasedOpenIpcHandle; + auto pfnGetCounterBasedFlags = context.zeDdiTable.Event.pfnGetCounterBasedFlags; - if( nullptr == pfnCounterBasedOpenIpcHandle ) - return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hIpc, phEvent); + if( nullptr == pfnGetCounterBasedFlags ) + return logAndPropagateResult_zeEventGetCounterBasedFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedOpenIpcHandlePrologue( hContext, hIpc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetCounterBasedFlagsPrologue( hEvent, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetCounterBasedFlags(result, hEvent, pFlags); } @@ -11255,38 +13123,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedOpenIpcHandlePrologue( hContext, hIpc, phEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeEventGetCounterBasedFlagsPrologue( hEvent, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetCounterBasedFlags(result, hEvent, pFlags); } - auto driver_result = pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); + auto driver_result = pfnGetCounterBasedFlags( hEvent, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedOpenIpcHandleEpilogue( hContext, hIpc, phEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(result, hContext, hIpc, phEvent); + auto result = context.validationHandlers[i]->zeValidation->zeEventGetCounterBasedFlagsEpilogue( hEvent, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetCounterBasedFlags(result, hEvent, pFlags); } - return logAndPropagateResult_zeEventCounterBasedOpenIpcHandle(driver_result, hContext, hIpc, phEvent); + return logAndPropagateResult_zeEventGetCounterBasedFlags(driver_result, hEvent, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCounterBasedCloseIpcHandle + /// @brief Intercept function for zeFenceCreate __zedlllocal ze_result_t ZE_APICALL - zeEventCounterBasedCloseIpcHandle( - ze_event_handle_t hEvent ///< [in][release] handle of event object + zeFenceCreate( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue + const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor + ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created ) { - context.logger->log_trace("zeEventCounterBasedCloseIpcHandle(hEvent)"); + context.logger->log_trace("zeFenceCreate(hCommandQueue, desc, phFence)"); - auto pfnCounterBasedCloseIpcHandle = context.zeDdiTable.Event.pfnCounterBasedCloseIpcHandle; + auto pfnCreate = context.zeDdiTable.Fence.pfnCreate; - if( nullptr == pfnCounterBasedCloseIpcHandle ) - return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeFenceCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, desc, phFence); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCloseIpcHandlePrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceCreatePrologue( hCommandQueue, desc, phFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); } @@ -11296,40 +13166,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedCloseIpcHandlePrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeFenceCreatePrologue( hCommandQueue, desc, phFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); } - auto driver_result = pfnCounterBasedCloseIpcHandle( hEvent ); + auto driver_result = pfnCreate( hCommandQueue, desc, phFence ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedCloseIpcHandleEpilogue( hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceCreateEpilogue( hCommandQueue, desc, phFence ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); } - return logAndPropagateResult_zeEventCounterBasedCloseIpcHandle(driver_result, hEvent); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phFence){ + context.handleLifetime->addHandle( *phFence ); + context.handleLifetime->addDependent( hCommandQueue, *phFence ); + + } + } + return logAndPropagateResult_zeFenceCreate(driver_result, hCommandQueue, desc, phFence); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventCounterBasedGetDeviceAddress + /// @brief Intercept function for zeFenceDestroy __zedlllocal ze_result_t ZE_APICALL - zeEventCounterBasedGetDeviceAddress( - ze_event_handle_t hEvent, ///< [in] handle of event object - uint64_t* completionValue, ///< [in][out] completion value - uint64_t* deviceAddress ///< [in][out] counter device address + zeFenceDestroy( + ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy ) { - context.logger->log_trace("zeEventCounterBasedGetDeviceAddress(hEvent, completionValue, deviceAddress)"); + context.logger->log_trace("zeFenceDestroy(hFence)"); - auto pfnCounterBasedGetDeviceAddress = context.zeDdiTable.Event.pfnCounterBasedGetDeviceAddress; + auto pfnDestroy = context.zeDdiTable.Fence.pfnDestroy; - if( nullptr == pfnCounterBasedGetDeviceAddress ) - return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, completionValue, deviceAddress); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeFenceDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetDeviceAddressPrologue( hEvent, completionValue, deviceAddress ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); + auto result = context.validationHandlers[i]->zeValidation->zeFenceDestroyPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); } @@ -11339,39 +13216,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventCounterBasedGetDeviceAddressPrologue( hEvent, completionValue, deviceAddress ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); + auto result = context.handleLifetime->zeHandleLifetime.zeFenceDestroyPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); } - auto driver_result = pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); + auto driver_result = pfnDestroy( hFence ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventCounterBasedGetDeviceAddressEpilogue( hEvent, completionValue, deviceAddress ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(result, hEvent, completionValue, deviceAddress); + auto result = context.validationHandlers[i]->zeValidation->zeFenceDestroyEpilogue( hFence ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); } - return logAndPropagateResult_zeEventCounterBasedGetDeviceAddress(driver_result, hEvent, completionValue, deviceAddress); + return logAndPropagateResult_zeFenceDestroy(driver_result, hFence); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalEvent + /// @brief Intercept function for zeFenceHostSynchronize __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalEvent( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hEvent ///< [in] handle of the event + zeFenceHostSynchronize( + ze_fence_handle_t hFence, ///< [in] handle of the fence + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then operates exactly like ::zeFenceQueryStatus; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { - context.logger->log_trace("zeCommandListAppendSignalEvent(hCommandList, hEvent)"); + context.logger->log_trace("zeFenceHostSynchronize(hFence, timeout)"); - auto pfnAppendSignalEvent = context.zeDdiTable.CommandList.pfnAppendSignalEvent; + auto pfnHostSynchronize = context.zeDdiTable.Fence.pfnHostSynchronize; - if( nullptr == pfnAppendSignalEvent ) - return logAndPropagateResult_zeCommandListAppendSignalEvent(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hEvent); + if( nullptr == pfnHostSynchronize ) + return logAndPropagateResult_zeFenceHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence, timeout); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventPrologue( hCommandList, hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceHostSynchronizePrologue( hFence, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); } @@ -11381,41 +13264,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalEventPrologue( hCommandList, hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeFenceHostSynchronizePrologue( hFence, timeout ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); } - auto driver_result = pfnAppendSignalEvent( hCommandList, hEvent ); + auto driver_result = pfnHostSynchronize( hFence, timeout ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventEpilogue( hCommandList, hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEvent(result, hCommandList, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceHostSynchronizeEpilogue( hFence, timeout ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); } - return logAndPropagateResult_zeCommandListAppendSignalEvent(driver_result, hCommandList, hEvent); + return logAndPropagateResult_zeFenceHostSynchronize(driver_result, hFence, timeout); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitOnEvents + /// @brief Intercept function for zeFenceQueryStatus __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 - ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before - ///< continuing + zeFenceQueryStatus( + ze_fence_handle_t hFence ///< [in] handle of the fence ) { - context.logger->log_trace("zeCommandListAppendWaitOnEvents(hCommandList, numEvents, phEventsLocal)"); + context.logger->log_trace("zeFenceQueryStatus(hFence)"); - auto pfnAppendWaitOnEvents = context.zeDdiTable.CommandList.pfnAppendWaitOnEvents; + auto pfnQueryStatus = context.zeDdiTable.Fence.pfnQueryStatus; - if( nullptr == pfnAppendWaitOnEvents ) - return logAndPropagateResult_zeCommandListAppendWaitOnEvents(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numEvents, phEvents); + if( nullptr == pfnQueryStatus ) + return logAndPropagateResult_zeFenceQueryStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsPrologue( hCommandList, numEvents, phEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); + auto result = context.validationHandlers[i]->zeValidation->zeFenceQueryStatusPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); } @@ -11425,38 +13305,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitOnEventsPrologue( hCommandList, numEvents, phEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeFenceQueryStatusPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); } - auto driver_result = pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); + auto driver_result = pfnQueryStatus( hFence ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsEpilogue( hCommandList, numEvents, phEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEvents(result, hCommandList, numEvents, phEvents); + auto result = context.validationHandlers[i]->zeValidation->zeFenceQueryStatusEpilogue( hFence ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); } - return logAndPropagateResult_zeCommandListAppendWaitOnEvents(driver_result, hCommandList, numEvents, phEvents); + return logAndPropagateResult_zeFenceQueryStatus(driver_result, hFence); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventHostSignal + /// @brief Intercept function for zeFenceReset __zedlllocal ze_result_t ZE_APICALL - zeEventHostSignal( - ze_event_handle_t hEvent ///< [in] handle of the event + zeFenceReset( + ze_fence_handle_t hFence ///< [in] handle of the fence ) { - context.logger->log_trace("zeEventHostSignal(hEvent)"); + context.logger->log_trace("zeFenceReset(hFence)"); - auto pfnHostSignal = context.zeDdiTable.Event.pfnHostSignal; + auto pfnReset = context.zeDdiTable.Fence.pfnReset; - if( nullptr == pfnHostSignal ) - return logAndPropagateResult_zeEventHostSignal(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); + if( nullptr == pfnReset ) + return logAndPropagateResult_zeFenceReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostSignalPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceResetPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); } @@ -11466,45 +13346,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventHostSignalPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeFenceResetPrologue( hFence ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); } - auto driver_result = pfnHostSignal( hEvent ); + auto driver_result = pfnReset( hFence ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostSignalEpilogue( hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSignal(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeFenceResetEpilogue( hFence ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); } - return logAndPropagateResult_zeEventHostSignal(driver_result, hEvent); + return logAndPropagateResult_zeFenceReset(driver_result, hFence); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventHostSynchronize + /// @brief Intercept function for zeImageGetProperties __zedlllocal ze_result_t ZE_APICALL - zeEventHostSynchronize( - ze_event_handle_t hEvent, ///< [in] handle of the event - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then operates exactly like ::zeEventQueryStatus; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. + zeImageGetProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_properties_t* pImageProperties ///< [out] pointer to image properties ) { - context.logger->log_trace("zeEventHostSynchronize(hEvent, timeout)"); + context.logger->log_trace("zeImageGetProperties(hDevice, desc, pImageProperties)"); - auto pfnHostSynchronize = context.zeDdiTable.Event.pfnHostSynchronize; + auto pfnGetProperties = context.zeDdiTable.Image.pfnGetProperties; - if( nullptr == pfnHostSynchronize ) - return logAndPropagateResult_zeEventHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, timeout); + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zeImageGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, pImageProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostSynchronizePrologue( hEvent, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetPropertiesPrologue( hDevice, desc, pImageProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); } @@ -11514,38 +13389,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventHostSynchronizePrologue( hEvent, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); + auto result = context.handleLifetime->zeHandleLifetime.zeImageGetPropertiesPrologue( hDevice, desc, pImageProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); } - auto driver_result = pfnHostSynchronize( hEvent, timeout ); + auto driver_result = pfnGetProperties( hDevice, desc, pImageProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostSynchronizeEpilogue( hEvent, timeout ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostSynchronize(result, hEvent, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetPropertiesEpilogue( hDevice, desc, pImageProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); } - return logAndPropagateResult_zeEventHostSynchronize(driver_result, hEvent, timeout); + return logAndPropagateResult_zeImageGetProperties(driver_result, hDevice, desc, pImageProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryStatus + /// @brief Intercept function for zeImageCreate __zedlllocal ze_result_t ZE_APICALL - zeEventQueryStatus( - ze_event_handle_t hEvent ///< [in] handle of the event + zeImageCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t* phImage ///< [out] pointer to handle of image object created ) { - context.logger->log_trace("zeEventQueryStatus(hEvent)"); + context.logger->log_trace("zeImageCreate(hContext, hDevice, desc, phImage)"); - auto pfnQueryStatus = context.zeDdiTable.Event.pfnQueryStatus; + auto pfnCreate = context.zeDdiTable.Image.pfnCreate; - if( nullptr == pfnQueryStatus ) - return logAndPropagateResult_zeEventQueryStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeImageCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phImage); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryStatusPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeImageCreatePrologue( hContext, hDevice, desc, phImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); } @@ -11555,39 +13433,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryStatusPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeImageCreatePrologue( hContext, hDevice, desc, phImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); } - auto driver_result = pfnQueryStatus( hEvent ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phImage ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryStatusEpilogue( hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryStatus(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeImageCreateEpilogue( hContext, hDevice, desc, phImage ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); } - return logAndPropagateResult_zeEventQueryStatus(driver_result, hEvent); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phImage){ + context.handleLifetime->addHandle( *phImage ); + context.handleLifetime->addDependent( hContext, *phImage ); + + } + } + return logAndPropagateResult_zeImageCreate(driver_result, hContext, hDevice, desc, phImage); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendEventReset + /// @brief Intercept function for zeImageDestroy __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendEventReset( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hEvent ///< [in] handle of the event + zeImageDestroy( + ze_image_handle_t hImage ///< [in][release] handle of image object to destroy ) { - context.logger->log_trace("zeCommandListAppendEventReset(hCommandList, hEvent)"); + context.logger->log_trace("zeImageDestroy(hImage)"); - auto pfnAppendEventReset = context.zeDdiTable.CommandList.pfnAppendEventReset; + auto pfnDestroy = context.zeDdiTable.Image.pfnDestroy; - if( nullptr == pfnAppendEventReset ) - return logAndPropagateResult_zeCommandListAppendEventReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hEvent); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeImageDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendEventResetPrologue( hCommandList, hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeImageDestroyPrologue( hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); } @@ -11597,38 +13483,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendEventResetPrologue( hCommandList, hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeImageDestroyPrologue( hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); } - auto driver_result = pfnAppendEventReset( hCommandList, hEvent ); + auto driver_result = pfnDestroy( hImage ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendEventResetEpilogue( hCommandList, hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendEventReset(result, hCommandList, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeImageDestroyEpilogue( hImage ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); } - return logAndPropagateResult_zeCommandListAppendEventReset(driver_result, hCommandList, hEvent); + return logAndPropagateResult_zeImageDestroy(driver_result, hImage); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventHostReset + /// @brief Intercept function for zeMemAllocShared __zedlllocal ze_result_t ZE_APICALL - zeEventHostReset( - ze_event_handle_t hEvent ///< [in] handle of the event + zeMemAllocShared( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor + const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + ze_device_handle_t hDevice, ///< [in][optional] device handle to associate with + void** pptr ///< [out] pointer to shared allocation ) { - context.logger->log_trace("zeEventHostReset(hEvent)"); + context.logger->log_trace("zeMemAllocShared(hContext, device_desc, host_desc, size, alignment, hDevice, pptr)"); - auto pfnHostReset = context.zeDdiTable.Event.pfnHostReset; + auto pfnAllocShared = context.zeDdiTable.Mem.pfnAllocShared; - if( nullptr == pfnHostReset ) - return logAndPropagateResult_zeEventHostReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent); + if( nullptr == pfnAllocShared ) + return logAndPropagateResult_zeMemAllocShared(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostResetPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocSharedPrologue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); } @@ -11638,39 +13532,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventHostResetPrologue( hEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocSharedPrologue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); } - auto driver_result = pfnHostReset( hEvent ); + auto driver_result = pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventHostResetEpilogue( hEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventHostReset(result, hEvent); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocSharedEpilogue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); } - return logAndPropagateResult_zeEventHostReset(driver_result, hEvent); + return logAndPropagateResult_zeMemAllocShared(driver_result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestamp + /// @brief Intercept function for zeMemAllocDevice __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestamp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. + zeMemAllocDevice( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + ze_device_handle_t hDevice, ///< [in] handle of the device + void** pptr ///< [out] pointer to device allocation ) { - context.logger->log_trace("zeEventQueryKernelTimestamp(hEvent, dstptr)"); + context.logger->log_trace("zeMemAllocDevice(hContext, device_desc, size, alignment, hDevice, pptr)"); - auto pfnQueryKernelTimestamp = context.zeDdiTable.Event.pfnQueryKernelTimestamp; + auto pfnAllocDevice = context.zeDdiTable.Mem.pfnAllocDevice; - if( nullptr == pfnQueryKernelTimestamp ) - return logAndPropagateResult_zeEventQueryKernelTimestamp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, dstptr); + if( nullptr == pfnAllocDevice ) + return logAndPropagateResult_zeMemAllocDevice(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, device_desc, size, alignment, hDevice, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampPrologue( hEvent, dstptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocDevicePrologue( hContext, device_desc, size, alignment, hDevice, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); } @@ -11680,50 +13580,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryKernelTimestampPrologue( hEvent, dstptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); + auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocDevicePrologue( hContext, device_desc, size, alignment, hDevice, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); } - auto driver_result = pfnQueryKernelTimestamp( hEvent, dstptr ); + auto driver_result = pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampEpilogue( hEvent, dstptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestamp(result, hEvent, dstptr); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocDeviceEpilogue( hContext, device_desc, size, alignment, hDevice, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); } - return logAndPropagateResult_zeEventQueryKernelTimestamp(driver_result, hEvent, dstptr); + return logAndPropagateResult_zeMemAllocDevice(driver_result, hContext, device_desc, size, alignment, hDevice, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendQueryKernelTimestamps + /// @brief Intercept function for zeMemAllocHost __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendQueryKernelTimestamps( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numEvents, ///< [in] the number of timestamp events to query - ze_event_handle_t* phEvents, ///< [in][range(0, numEvents)] handles of timestamp events to query - void* dstptr, ///< [in,out] pointer to memory where ::ze_kernel_timestamp_result_t will - ///< be written; must be size-aligned. - const size_t* pOffsets, ///< [in][optional][range(0, numEvents)] offset, in bytes, to write - ///< results; address must be 4byte-aligned and offsets must be - ///< size-aligned. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing query + zeMemAllocHost( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + void** pptr ///< [out] pointer to host allocation ) { - context.logger->log_trace("zeCommandListAppendQueryKernelTimestamps(hCommandList, numEvents, phEventsLocal, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeMemAllocHost(hContext, host_desc, size, alignment, pptr)"); - auto pfnAppendQueryKernelTimestamps = context.zeDdiTable.CommandList.pfnAppendQueryKernelTimestamps; + auto pfnAllocHost = context.zeDdiTable.Mem.pfnAllocHost; - if( nullptr == pfnAppendQueryKernelTimestamps ) - return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnAllocHost ) + return logAndPropagateResult_zeMemAllocHost(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, host_desc, size, alignment, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendQueryKernelTimestampsPrologue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocHostPrologue( hContext, host_desc, size, alignment, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); } @@ -11733,39 +13627,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendQueryKernelTimestampsPrologue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocHostPrologue( hContext, host_desc, size, alignment, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); } - auto driver_result = pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnAllocHost( hContext, host_desc, size, alignment, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendQueryKernelTimestampsEpilogue( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeMemAllocHostEpilogue( hContext, host_desc, size, alignment, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); } - return logAndPropagateResult_zeCommandListAppendQueryKernelTimestamps(driver_result, hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeMemAllocHost(driver_result, hContext, host_desc, size, alignment, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventGetEventPool + /// @brief Intercept function for zeMemFree __zedlllocal ze_result_t ZE_APICALL - zeEventGetEventPool( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event + zeMemFree( + ze_context_handle_t hContext, ///< [in] handle of the context object + void* ptr ///< [in][release] pointer to memory to free ) { - context.logger->log_trace("zeEventGetEventPool(hEvent, phEventPool)"); + context.logger->log_trace("zeMemFree(hContext, ptr)"); - auto pfnGetEventPool = context.zeDdiTable.Event.pfnGetEventPool; + auto pfnFree = context.zeDdiTable.Mem.pfnFree; - if( nullptr == pfnGetEventPool ) - return logAndPropagateResult_zeEventGetEventPool(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, phEventPool); + if( nullptr == pfnFree ) + return logAndPropagateResult_zeMemFree(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetEventPoolPrologue( hEvent, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeMemFreePrologue( hContext, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); } @@ -11775,41 +13669,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventGetEventPoolPrologue( hEvent, phEventPool ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); + auto result = context.handleLifetime->zeHandleLifetime.zeMemFreePrologue( hContext, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); } - auto driver_result = pfnGetEventPool( hEvent, phEventPool ); + auto driver_result = pfnFree( hContext, ptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetEventPoolEpilogue( hEvent, phEventPool ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetEventPool(result, hEvent, phEventPool); + auto result = context.validationHandlers[i]->zeValidation->zeMemFreeEpilogue( hContext, ptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); } - return logAndPropagateResult_zeEventGetEventPool(driver_result, hEvent, phEventPool); + return logAndPropagateResult_zeMemFree(driver_result, hContext, ptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventGetSignalScope + /// @brief Intercept function for zeMemGetAllocProperties __zedlllocal ze_result_t ZE_APICALL - zeEventGetSignalScope( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_scope_flags_t* pSignalScope ///< [out] signal event scope. This is the scope of relevant cache - ///< hierarchies that are flushed on a signal action before the event is - ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. + zeMemGetAllocProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] memory pointer to query + ze_memory_allocation_properties_t* pMemAllocProperties, ///< [in,out] query result for memory allocation properties + ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation ) { - context.logger->log_trace("zeEventGetSignalScope(hEvent, pSignalScope)"); + context.logger->log_trace("zeMemGetAllocProperties(hContext, ptr, pMemAllocProperties, phDevice)"); - auto pfnGetSignalScope = context.zeDdiTable.Event.pfnGetSignalScope; + auto pfnGetAllocProperties = context.zeDdiTable.Mem.pfnGetAllocProperties; - if( nullptr == pfnGetSignalScope ) - return logAndPropagateResult_zeEventGetSignalScope(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, pSignalScope); + if( nullptr == pfnGetAllocProperties ) + return logAndPropagateResult_zeMemGetAllocProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pMemAllocProperties, phDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetSignalScopePrologue( hEvent, pSignalScope ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAllocPropertiesPrologue( hContext, ptr, pMemAllocProperties, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); } @@ -11819,41 +13713,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventGetSignalScopePrologue( hEvent, pSignalScope ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAllocPropertiesPrologue( hContext, ptr, pMemAllocProperties, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); } - auto driver_result = pfnGetSignalScope( hEvent, pSignalScope ); + auto driver_result = pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetSignalScopeEpilogue( hEvent, pSignalScope ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetSignalScope(result, hEvent, pSignalScope); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAllocPropertiesEpilogue( hContext, ptr, pMemAllocProperties, phDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); } - return logAndPropagateResult_zeEventGetSignalScope(driver_result, hEvent, pSignalScope); + return logAndPropagateResult_zeMemGetAllocProperties(driver_result, hContext, ptr, pMemAllocProperties, phDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventGetWaitScope + /// @brief Intercept function for zeMemGetAddressRange __zedlllocal ze_result_t ZE_APICALL - zeEventGetWaitScope( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_scope_flags_t* pWaitScope ///< [out] wait event scope. This is the scope of relevant cache - ///< hierarchies invalidated on a wait action after the event is complete. - ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. + zeMemGetAddressRange( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] memory pointer to query + void** pBase, ///< [in,out][optional] base address of the allocation + size_t* pSize ///< [in,out][optional] size of the allocation ) { - context.logger->log_trace("zeEventGetWaitScope(hEvent, pWaitScope)"); + context.logger->log_trace("zeMemGetAddressRange(hContext, ptr, pBase, pSize)"); - auto pfnGetWaitScope = context.zeDdiTable.Event.pfnGetWaitScope; + auto pfnGetAddressRange = context.zeDdiTable.Mem.pfnGetAddressRange; - if( nullptr == pfnGetWaitScope ) - return logAndPropagateResult_zeEventGetWaitScope(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, pWaitScope); + if( nullptr == pfnGetAddressRange ) + return logAndPropagateResult_zeMemGetAddressRange(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pBase, pSize); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetWaitScopePrologue( hEvent, pWaitScope ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAddressRangePrologue( hContext, ptr, pBase, pSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); } @@ -11863,39 +13757,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventGetWaitScopePrologue( hEvent, pWaitScope ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAddressRangePrologue( hContext, ptr, pBase, pSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); } - auto driver_result = pfnGetWaitScope( hEvent, pWaitScope ); + auto driver_result = pfnGetAddressRange( hContext, ptr, pBase, pSize ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventGetWaitScopeEpilogue( hEvent, pWaitScope ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventGetWaitScope(result, hEvent, pWaitScope); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAddressRangeEpilogue( hContext, ptr, pBase, pSize ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); } - return logAndPropagateResult_zeEventGetWaitScope(driver_result, hEvent, pWaitScope); + return logAndPropagateResult_zeMemGetAddressRange(driver_result, hContext, ptr, pBase, pSize); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolGetContextHandle + /// @brief Intercept function for zeMemGetIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeEventPoolGetContextHandle( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created + zeMemGetIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - context.logger->log_trace("zeEventPoolGetContextHandle(hEventPool, phContext)"); + context.logger->log_trace("zeMemGetIpcHandle(hContext, ptr, pIpcHandle)"); - auto pfnGetContextHandle = context.zeDdiTable.EventPool.pfnGetContextHandle; + auto pfnGetIpcHandle = context.zeDdiTable.Mem.pfnGetIpcHandle; - if( nullptr == pfnGetContextHandle ) - return logAndPropagateResult_zeEventPoolGetContextHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, phContext); + if( nullptr == pfnGetIpcHandle ) + return logAndPropagateResult_zeMemGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pIpcHandle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetContextHandlePrologue( hEventPool, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandlePrologue( hContext, ptr, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); } @@ -11905,40 +13800,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetContextHandlePrologue( hEventPool, phContext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandlePrologue( hContext, ptr, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); } - auto driver_result = pfnGetContextHandle( hEventPool, phContext ); + auto driver_result = pfnGetIpcHandle( hContext, ptr, pIpcHandle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetContextHandleEpilogue( hEventPool, phContext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetContextHandle(result, hEventPool, phContext); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleEpilogue( hContext, ptr, pIpcHandle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); } - return logAndPropagateResult_zeEventPoolGetContextHandle(driver_result, hEventPool, phContext); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeMemGetIpcHandle(driver_result, hContext, ptr, pIpcHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventPoolGetFlags + /// @brief Intercept function for zeMemGetIpcHandleFromFileDescriptorExp __zedlllocal ze_result_t ZE_APICALL - zeEventPoolGetFlags( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - ze_event_pool_flags_t* pFlags ///< [out] creation flags used to create the event pool; may be 0 or a - ///< valid combination of ::ze_event_pool_flag_t + zeMemGetIpcHandleFromFileDescriptorExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + uint64_t handle, ///< [in] file descriptor + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - context.logger->log_trace("zeEventPoolGetFlags(hEventPool, pFlags)"); + context.logger->log_trace("zeMemGetIpcHandleFromFileDescriptorExp(hContext, handle, pIpcHandle)"); - auto pfnGetFlags = context.zeDdiTable.EventPool.pfnGetFlags; + auto pfnGetIpcHandleFromFileDescriptorExp = context.zeDdiTable.MemExp.pfnGetIpcHandleFromFileDescriptorExp; - if( nullptr == pfnGetFlags ) - return logAndPropagateResult_zeEventPoolGetFlags(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEventPool, pFlags); + if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) + return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, handle, pIpcHandle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetFlagsPrologue( hEventPool, pFlags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleFromFileDescriptorExpPrologue( hContext, handle, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); } @@ -11948,40 +13847,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventPoolGetFlagsPrologue( hEventPool, pFlags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleFromFileDescriptorExpPrologue( hContext, handle, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); } - auto driver_result = pfnGetFlags( hEventPool, pFlags ); + auto driver_result = pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventPoolGetFlagsEpilogue( hEventPool, pFlags ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventPoolGetFlags(result, hEventPool, pFlags); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleFromFileDescriptorExpEpilogue( hContext, handle, pIpcHandle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); } - return logAndPropagateResult_zeEventPoolGetFlags(driver_result, hEventPool, pFlags); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(driver_result, hContext, handle, pIpcHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFenceCreate + /// @brief Intercept function for zeMemGetFileDescriptorFromIpcHandleExp __zedlllocal ze_result_t ZE_APICALL - zeFenceCreate( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue - const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor - ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created + zeMemGetFileDescriptorFromIpcHandleExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_ipc_mem_handle_t ipcHandle, ///< [in] IPC memory handle + uint64_t* pHandle ///< [out] Returned file descriptor ) { - context.logger->log_trace("zeFenceCreate(hCommandQueue, desc, phFence)"); + context.logger->log_trace("zeMemGetFileDescriptorFromIpcHandleExp(hContext, ipcHandle, pHandle)"); - auto pfnCreate = context.zeDdiTable.Fence.pfnCreate; + auto pfnGetFileDescriptorFromIpcHandleExp = context.zeDdiTable.MemExp.pfnGetFileDescriptorFromIpcHandleExp; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeFenceCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, desc, phFence); + if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) + return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ipcHandle, pHandle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceCreatePrologue( hCommandQueue, desc, phFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetFileDescriptorFromIpcHandleExpPrologue( hContext, ipcHandle, pHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); } @@ -11991,47 +13894,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFenceCreatePrologue( hCommandQueue, desc, phFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetFileDescriptorFromIpcHandleExpPrologue( hContext, ipcHandle, pHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); } - auto driver_result = pfnCreate( hCommandQueue, desc, phFence ); + auto driver_result = pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceCreateEpilogue( hCommandQueue, desc, phFence ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceCreate(result, hCommandQueue, desc, phFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetFileDescriptorFromIpcHandleExpEpilogue( hContext, ipcHandle, pHandle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phFence){ - context.handleLifetime->addHandle( *phFence ); - context.handleLifetime->addDependent( hCommandQueue, *phFence ); - - } } - return logAndPropagateResult_zeFenceCreate(driver_result, hCommandQueue, desc, phFence); + return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(driver_result, hContext, ipcHandle, pHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFenceDestroy + /// @brief Intercept function for zeMemPutIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeFenceDestroy( - ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy + zeMemPutIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_ipc_mem_handle_t handle ///< [in] IPC memory handle ) { - context.logger->log_trace("zeFenceDestroy(hFence)"); + context.logger->log_trace("zeMemPutIpcHandle(hContext, handle)"); - auto pfnDestroy = context.zeDdiTable.Fence.pfnDestroy; + auto pfnPutIpcHandle = context.zeDdiTable.Mem.pfnPutIpcHandle; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeFenceDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); + if( nullptr == pfnPutIpcHandle ) + return logAndPropagateResult_zeMemPutIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, handle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceDestroyPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemPutIpcHandlePrologue( hContext, handle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); } @@ -12041,45 +13940,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFenceDestroyPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); + auto result = context.handleLifetime->zeHandleLifetime.zeMemPutIpcHandlePrologue( hContext, handle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); } - auto driver_result = pfnDestroy( hFence ); + auto driver_result = pfnPutIpcHandle( hContext, handle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceDestroyEpilogue( hFence ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceDestroy(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemPutIpcHandleEpilogue( hContext, handle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); } - return logAndPropagateResult_zeFenceDestroy(driver_result, hFence); + return logAndPropagateResult_zeMemPutIpcHandle(driver_result, hContext, handle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFenceHostSynchronize + /// @brief Intercept function for zeMemOpenIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeFenceHostSynchronize( - ze_fence_handle_t hFence, ///< [in] handle of the fence - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then operates exactly like ::zeFenceQueryStatus; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. + zeMemOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle + ze_ipc_mem_handle_t handle, ///< [in] IPC memory handle + ze_ipc_memory_flags_t flags, ///< [in] flags controlling the operation. + ///< must be 0 (default) or a valid combination of ::ze_ipc_memory_flag_t. + void** pptr ///< [out] pointer to device allocation in this process ) { - context.logger->log_trace("zeFenceHostSynchronize(hFence, timeout)"); + context.logger->log_trace("zeMemOpenIpcHandle(hContext, hDevice, handle, flags, pptr)"); - auto pfnHostSynchronize = context.zeDdiTable.Fence.pfnHostSynchronize; + auto pfnOpenIpcHandle = context.zeDdiTable.Mem.pfnOpenIpcHandle; - if( nullptr == pfnHostSynchronize ) - return logAndPropagateResult_zeFenceHostSynchronize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence, timeout); + if( nullptr == pfnOpenIpcHandle ) + return logAndPropagateResult_zeMemOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, handle, flags, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceHostSynchronizePrologue( hFence, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeMemOpenIpcHandlePrologue( hContext, hDevice, handle, flags, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); } @@ -12089,38 +13986,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFenceHostSynchronizePrologue( hFence, timeout ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); + auto result = context.handleLifetime->zeHandleLifetime.zeMemOpenIpcHandlePrologue( hContext, hDevice, handle, flags, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); } - auto driver_result = pfnHostSynchronize( hFence, timeout ); + auto driver_result = pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceHostSynchronizeEpilogue( hFence, timeout ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceHostSynchronize(result, hFence, timeout); + auto result = context.validationHandlers[i]->zeValidation->zeMemOpenIpcHandleEpilogue( hContext, hDevice, handle, flags, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); } - return logAndPropagateResult_zeFenceHostSynchronize(driver_result, hFence, timeout); + return logAndPropagateResult_zeMemOpenIpcHandle(driver_result, hContext, hDevice, handle, flags, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFenceQueryStatus + /// @brief Intercept function for zeMemCloseIpcHandle __zedlllocal ze_result_t ZE_APICALL - zeFenceQueryStatus( - ze_fence_handle_t hFence ///< [in] handle of the fence + zeMemCloseIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr ///< [in][release] pointer to device allocation in this process ) { - context.logger->log_trace("zeFenceQueryStatus(hFence)"); + context.logger->log_trace("zeMemCloseIpcHandle(hContext, ptr)"); - auto pfnQueryStatus = context.zeDdiTable.Fence.pfnQueryStatus; + auto pfnCloseIpcHandle = context.zeDdiTable.Mem.pfnCloseIpcHandle; - if( nullptr == pfnQueryStatus ) - return logAndPropagateResult_zeFenceQueryStatus(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); + if( nullptr == pfnCloseIpcHandle ) + return logAndPropagateResult_zeMemCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceQueryStatusPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemCloseIpcHandlePrologue( hContext, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); } @@ -12130,38 +14028,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFenceQueryStatusPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); + auto result = context.handleLifetime->zeHandleLifetime.zeMemCloseIpcHandlePrologue( hContext, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); } - auto driver_result = pfnQueryStatus( hFence ); + auto driver_result = pfnCloseIpcHandle( hContext, ptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceQueryStatusEpilogue( hFence ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceQueryStatus(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemCloseIpcHandleEpilogue( hContext, ptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); } - return logAndPropagateResult_zeFenceQueryStatus(driver_result, hFence); + return logAndPropagateResult_zeMemCloseIpcHandle(driver_result, hContext, ptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFenceReset + /// @brief Intercept function for zeMemSetAtomicAccessAttributeExp __zedlllocal ze_result_t ZE_APICALL - zeFenceReset( - ze_fence_handle_t hFence ///< [in] handle of the fence + zeMemSetAtomicAccessAttributeExp( + ze_context_handle_t hContext, ///< [in] handle of context + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_atomic_attr_exp_flags_t attr ///< [in] Atomic access attributes to set for the specified range. + ///< Must be 0 (default) or a valid combination of ::ze_memory_atomic_attr_exp_flag_t. ) { - context.logger->log_trace("zeFenceReset(hFence)"); + context.logger->log_trace("zeMemSetAtomicAccessAttributeExp(hContext, hDevice, ptr, size, attr)"); - auto pfnReset = context.zeDdiTable.Fence.pfnReset; + auto pfnSetAtomicAccessAttributeExp = context.zeDdiTable.MemExp.pfnSetAtomicAccessAttributeExp; - if( nullptr == pfnReset ) - return logAndPropagateResult_zeFenceReset(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hFence); + if( nullptr == pfnSetAtomicAccessAttributeExp ) + return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size, attr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceResetPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemSetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, attr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); } @@ -12171,40 +14074,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFenceResetPrologue( hFence ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); + auto result = context.handleLifetime->zeHandleLifetime.zeMemSetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, attr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); } - auto driver_result = pfnReset( hFence ); + auto driver_result = pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFenceResetEpilogue( hFence ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFenceReset(result, hFence); + auto result = context.validationHandlers[i]->zeValidation->zeMemSetAtomicAccessAttributeExpEpilogue( hContext, hDevice, ptr, size, attr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); } - return logAndPropagateResult_zeFenceReset(driver_result, hFence); + return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(driver_result, hContext, hDevice, ptr, size, attr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetProperties + /// @brief Intercept function for zeMemGetAtomicAccessAttributeExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_properties_t* pImageProperties ///< [out] pointer to image properties + zeMemGetAtomicAccessAttributeExp( + ze_context_handle_t hContext, ///< [in] handle of context + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_atomic_attr_exp_flags_t* pAttr ///< [out] Atomic access attributes for the specified range ) { - context.logger->log_trace("zeImageGetProperties(hDevice, desc, pImageProperties)"); + context.logger->log_trace("zeMemGetAtomicAccessAttributeExp(hContext, hDevice, ptr, size, pAttr)"); - auto pfnGetProperties = context.zeDdiTable.Image.pfnGetProperties; + auto pfnGetAtomicAccessAttributeExp = context.zeDdiTable.MemExp.pfnGetAtomicAccessAttributeExp; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zeImageGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, pImageProperties); + if( nullptr == pfnGetAtomicAccessAttributeExp ) + return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size, pAttr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetPropertiesPrologue( hDevice, desc, pImageProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, pAttr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); } @@ -12214,41 +14119,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageGetPropertiesPrologue( hDevice, desc, pImageProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, pAttr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); } - auto driver_result = pfnGetProperties( hDevice, desc, pImageProperties ); + auto driver_result = pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetPropertiesEpilogue( hDevice, desc, pImageProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetProperties(result, hDevice, desc, pImageProperties); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetAtomicAccessAttributeExpEpilogue( hContext, hDevice, ptr, size, pAttr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); } - return logAndPropagateResult_zeImageGetProperties(driver_result, hDevice, desc, pImageProperties); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(driver_result, hContext, hDevice, ptr, size, pAttr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageCreate + /// @brief Intercept function for zeModuleCreate __zedlllocal ze_result_t ZE_APICALL - zeImageCreate( + zeModuleCreate( ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t* phImage ///< [out] pointer to handle of image object created + const ze_module_desc_t* desc, ///< [in] pointer to module descriptor + ze_module_handle_t* phModule, ///< [out] pointer to handle of module object created + ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. ) { - context.logger->log_trace("zeImageCreate(hContext, hDevice, desc, phImage)"); + context.logger->log_trace("zeModuleCreate(hContext, hDevice, desc, phModule, phBuildLog)"); - auto pfnCreate = context.zeDdiTable.Image.pfnCreate; + auto pfnCreate = context.zeDdiTable.Module.pfnCreate; if( nullptr == pfnCreate ) - return logAndPropagateResult_zeImageCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phImage); + return logAndPropagateResult_zeModuleCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phModule, phBuildLog); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageCreatePrologue( hContext, hDevice, desc, phImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); + auto result = context.validationHandlers[i]->zeValidation->zeModuleCreatePrologue( hContext, hDevice, desc, phModule, phBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); } @@ -12258,47 +14168,52 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageCreatePrologue( hContext, hDevice, desc, phImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleCreatePrologue( hContext, hDevice, desc, phModule, phBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); } - auto driver_result = pfnCreate( hContext, hDevice, desc, phImage ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageCreateEpilogue( hContext, hDevice, desc, phImage ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageCreate(result, hContext, hDevice, desc, phImage); + auto result = context.validationHandlers[i]->zeValidation->zeModuleCreateEpilogue( hContext, hDevice, desc, phModule, phBuildLog ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phImage){ - context.handleLifetime->addHandle( *phImage ); - context.handleLifetime->addDependent( hContext, *phImage ); + if (phModule){ + context.handleLifetime->addHandle( *phModule ); + context.handleLifetime->addDependent( hContext, *phModule ); + + } + if (phBuildLog){ + context.handleLifetime->addHandle( *phBuildLog ); + context.handleLifetime->addDependent( hContext, *phBuildLog ); } } - return logAndPropagateResult_zeImageCreate(driver_result, hContext, hDevice, desc, phImage); + return logAndPropagateResult_zeModuleCreate(driver_result, hContext, hDevice, desc, phModule, phBuildLog); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageDestroy + /// @brief Intercept function for zeModuleDestroy __zedlllocal ze_result_t ZE_APICALL - zeImageDestroy( - ze_image_handle_t hImage ///< [in][release] handle of image object to destroy + zeModuleDestroy( + ze_module_handle_t hModule ///< [in][release] handle of the module ) { - context.logger->log_trace("zeImageDestroy(hImage)"); + context.logger->log_trace("zeModuleDestroy(hModule)"); - auto pfnDestroy = context.zeDdiTable.Image.pfnDestroy; + auto pfnDestroy = context.zeDdiTable.Module.pfnDestroy; if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeImageDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage); + return logAndPropagateResult_zeModuleDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageDestroyPrologue( hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeModuleDestroyPrologue( hModule ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); } @@ -12308,46 +14223,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageDestroyPrologue( hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleDestroyPrologue( hModule ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); } - auto driver_result = pfnDestroy( hImage ); + auto driver_result = pfnDestroy( hModule ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageDestroyEpilogue( hImage ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageDestroy(result, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeModuleDestroyEpilogue( hModule ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); } - return logAndPropagateResult_zeImageDestroy(driver_result, hImage); + return logAndPropagateResult_zeModuleDestroy(driver_result, hModule); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemAllocShared + /// @brief Intercept function for zeModuleDynamicLink __zedlllocal ze_result_t ZE_APICALL - zeMemAllocShared( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor - const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - ze_device_handle_t hDevice, ///< [in][optional] device handle to associate with - void** pptr ///< [out] pointer to shared allocation + zeModuleDynamicLink( + uint32_t numModules, ///< [in] number of modules to be linked pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to + ///< dynamically link together. + ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. ) { - context.logger->log_trace("zeMemAllocShared(hContext, device_desc, host_desc, size, alignment, hDevice, pptr)"); + context.logger->log_trace("zeModuleDynamicLink(numModules, phModulesLocal, phLinkLog)"); - auto pfnAllocShared = context.zeDdiTable.Mem.pfnAllocShared; + auto pfnDynamicLink = context.zeDdiTable.Module.pfnDynamicLink; - if( nullptr == pfnAllocShared ) - return logAndPropagateResult_zeMemAllocShared(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); + if( nullptr == pfnDynamicLink ) + return logAndPropagateResult_zeModuleDynamicLink(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, numModules, phModules, phLinkLog); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocSharedPrologue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleDynamicLinkPrologue( numModules, phModules, phLinkLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); } @@ -12357,45 +14267,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocSharedPrologue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleDynamicLinkPrologue( numModules, phModules, phLinkLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); } - auto driver_result = pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + auto driver_result = pfnDynamicLink( numModules, phModules, phLinkLog ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocSharedEpilogue( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocShared(result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleDynamicLinkEpilogue( numModules, phModules, phLinkLog ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); } - - return logAndPropagateResult_zeMemAllocShared(driver_result, hContext, device_desc, host_desc, size, alignment, hDevice, pptr); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemAllocDevice - __zedlllocal ze_result_t ZE_APICALL - zeMemAllocDevice( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - ze_device_handle_t hDevice, ///< [in] handle of the device - void** pptr ///< [out] pointer to device allocation + + return logAndPropagateResult_zeModuleDynamicLink(driver_result, numModules, phModules, phLinkLog); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleBuildLogDestroy + __zedlllocal ze_result_t ZE_APICALL + zeModuleBuildLogDestroy( + ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. ) { - context.logger->log_trace("zeMemAllocDevice(hContext, device_desc, size, alignment, hDevice, pptr)"); + context.logger->log_trace("zeModuleBuildLogDestroy(hModuleBuildLog)"); - auto pfnAllocDevice = context.zeDdiTable.Mem.pfnAllocDevice; + auto pfnDestroy = context.zeDdiTable.ModuleBuildLog.pfnDestroy; - if( nullptr == pfnAllocDevice ) - return logAndPropagateResult_zeMemAllocDevice(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, device_desc, size, alignment, hDevice, pptr); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeModuleBuildLogDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModuleBuildLog); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocDevicePrologue( hContext, device_desc, size, alignment, hDevice, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogDestroyPrologue( hModuleBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); } @@ -12405,44 +14308,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocDevicePrologue( hContext, device_desc, size, alignment, hDevice, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleBuildLogDestroyPrologue( hModuleBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); } - auto driver_result = pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); + auto driver_result = pfnDestroy( hModuleBuildLog ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocDeviceEpilogue( hContext, device_desc, size, alignment, hDevice, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocDevice(result, hContext, device_desc, size, alignment, hDevice, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogDestroyEpilogue( hModuleBuildLog ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); } - return logAndPropagateResult_zeMemAllocDevice(driver_result, hContext, device_desc, size, alignment, hDevice, pptr); + return logAndPropagateResult_zeModuleBuildLogDestroy(driver_result, hModuleBuildLog); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemAllocHost + /// @brief Intercept function for zeModuleBuildLogGetString __zedlllocal ze_result_t ZE_APICALL - zeMemAllocHost( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - void** pptr ///< [out] pointer to host allocation + zeModuleBuildLogGetString( + ze_module_build_log_handle_t hModuleBuildLog, ///< [in] handle of the module build log object. + size_t* pSize, ///< [in,out] size of build log string. + char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. ) { - context.logger->log_trace("zeMemAllocHost(hContext, host_desc, size, alignment, pptr)"); + context.logger->log_trace("zeModuleBuildLogGetString(hModuleBuildLog, pSize, pBuildLog)"); - auto pfnAllocHost = context.zeDdiTable.Mem.pfnAllocHost; + auto pfnGetString = context.zeDdiTable.ModuleBuildLog.pfnGetString; - if( nullptr == pfnAllocHost ) - return logAndPropagateResult_zeMemAllocHost(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, host_desc, size, alignment, pptr); + if( nullptr == pfnGetString ) + return logAndPropagateResult_zeModuleBuildLogGetString(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModuleBuildLog, pSize, pBuildLog); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocHostPrologue( hContext, host_desc, size, alignment, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogGetStringPrologue( hModuleBuildLog, pSize, pBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); } @@ -12452,39 +14351,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemAllocHostPrologue( hContext, host_desc, size, alignment, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleBuildLogGetStringPrologue( hModuleBuildLog, pSize, pBuildLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); } - auto driver_result = pfnAllocHost( hContext, host_desc, size, alignment, pptr ); + auto driver_result = pfnGetString( hModuleBuildLog, pSize, pBuildLog ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemAllocHostEpilogue( hContext, host_desc, size, alignment, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemAllocHost(result, hContext, host_desc, size, alignment, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogGetStringEpilogue( hModuleBuildLog, pSize, pBuildLog ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); } - return logAndPropagateResult_zeMemAllocHost(driver_result, hContext, host_desc, size, alignment, pptr); + return logAndPropagateResult_zeModuleBuildLogGetString(driver_result, hModuleBuildLog, pSize, pBuildLog); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFree + /// @brief Intercept function for zeModuleGetNativeBinary __zedlllocal ze_result_t ZE_APICALL - zeMemFree( - ze_context_handle_t hContext, ///< [in] handle of the context object - void* ptr ///< [in][release] pointer to memory to free + zeModuleGetNativeBinary( + ze_module_handle_t hModule, ///< [in] handle of the module + size_t* pSize, ///< [in,out] size of native binary in bytes. + uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary ) { - context.logger->log_trace("zeMemFree(hContext, ptr)"); + context.logger->log_trace("zeModuleGetNativeBinary(hModule, pSize, pModuleNativeBinary)"); - auto pfnFree = context.zeDdiTable.Mem.pfnFree; + auto pfnGetNativeBinary = context.zeDdiTable.Module.pfnGetNativeBinary; - if( nullptr == pfnFree ) - return logAndPropagateResult_zeMemFree(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr); + if( nullptr == pfnGetNativeBinary ) + return logAndPropagateResult_zeModuleGetNativeBinary(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pSize, pModuleNativeBinary); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemFreePrologue( hContext, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetNativeBinaryPrologue( hModule, pSize, pModuleNativeBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); } @@ -12494,41 +14394,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemFreePrologue( hContext, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetNativeBinaryPrologue( hModule, pSize, pModuleNativeBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); } - auto driver_result = pfnFree( hContext, ptr ); + auto driver_result = pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemFreeEpilogue( hContext, ptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFree(result, hContext, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetNativeBinaryEpilogue( hModule, pSize, pModuleNativeBinary ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); } - return logAndPropagateResult_zeMemFree(driver_result, hContext, ptr); + return logAndPropagateResult_zeModuleGetNativeBinary(driver_result, hModule, pSize, pModuleNativeBinary); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetAllocProperties + /// @brief Intercept function for zeModuleGetGlobalPointer __zedlllocal ze_result_t ZE_APICALL - zeMemGetAllocProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] memory pointer to query - ze_memory_allocation_properties_t* pMemAllocProperties, ///< [in,out] query result for memory allocation properties - ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation + zeModuleGetGlobalPointer( + ze_module_handle_t hModule, ///< [in] handle of the module + const char* pGlobalName, ///< [in] name of global variable in module + size_t* pSize, ///< [in,out][optional] size of global variable + void** pptr ///< [in,out][optional] device visible pointer ) { - context.logger->log_trace("zeMemGetAllocProperties(hContext, ptr, pMemAllocProperties, phDevice)"); + context.logger->log_trace("zeModuleGetGlobalPointer(hModule, pGlobalName, pSize, pptr)"); - auto pfnGetAllocProperties = context.zeDdiTable.Mem.pfnGetAllocProperties; + auto pfnGetGlobalPointer = context.zeDdiTable.Module.pfnGetGlobalPointer; - if( nullptr == pfnGetAllocProperties ) - return logAndPropagateResult_zeMemGetAllocProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pMemAllocProperties, phDevice); + if( nullptr == pfnGetGlobalPointer ) + return logAndPropagateResult_zeModuleGetGlobalPointer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pGlobalName, pSize, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAllocPropertiesPrologue( hContext, ptr, pMemAllocProperties, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetGlobalPointerPrologue( hModule, pGlobalName, pSize, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); } @@ -12538,41 +14438,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAllocPropertiesPrologue( hContext, ptr, pMemAllocProperties, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetGlobalPointerPrologue( hModule, pGlobalName, pSize, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); } - auto driver_result = pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); + auto driver_result = pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAllocPropertiesEpilogue( hContext, ptr, pMemAllocProperties, phDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAllocProperties(result, hContext, ptr, pMemAllocProperties, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetGlobalPointerEpilogue( hModule, pGlobalName, pSize, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); } - return logAndPropagateResult_zeMemGetAllocProperties(driver_result, hContext, ptr, pMemAllocProperties, phDevice); + return logAndPropagateResult_zeModuleGetGlobalPointer(driver_result, hModule, pGlobalName, pSize, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetAddressRange + /// @brief Intercept function for zeModuleGetKernelNames __zedlllocal ze_result_t ZE_APICALL - zeMemGetAddressRange( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] memory pointer to query - void** pBase, ///< [in,out][optional] base address of the allocation - size_t* pSize ///< [in,out][optional] size of the allocation + zeModuleGetKernelNames( + ze_module_handle_t hModule, ///< [in] handle of the module + uint32_t* pCount, ///< [in,out] pointer to the number of names. + ///< if count is zero, then the driver shall update the value with the + ///< total number of names available. + ///< if count is greater than the number of names available, then the + ///< driver shall update the value with the correct number of names available. + const char** pNames ///< [in,out][optional][range(0, *pCount)] array of names of functions. + ///< if count is less than the number of names available, then driver shall + ///< only retrieve that number of names. ) { - context.logger->log_trace("zeMemGetAddressRange(hContext, ptr, pBase, pSize)"); + context.logger->log_trace("zeModuleGetKernelNames(hModule, pCount, pNames)"); - auto pfnGetAddressRange = context.zeDdiTable.Mem.pfnGetAddressRange; + auto pfnGetKernelNames = context.zeDdiTable.Module.pfnGetKernelNames; - if( nullptr == pfnGetAddressRange ) - return logAndPropagateResult_zeMemGetAddressRange(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pBase, pSize); + if( nullptr == pfnGetKernelNames ) + return logAndPropagateResult_zeModuleGetKernelNames(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pCount, pNames); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAddressRangePrologue( hContext, ptr, pBase, pSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetKernelNamesPrologue( hModule, pCount, pNames ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); } @@ -12582,40 +14487,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAddressRangePrologue( hContext, ptr, pBase, pSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetKernelNamesPrologue( hModule, pCount, pNames ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); } - auto driver_result = pfnGetAddressRange( hContext, ptr, pBase, pSize ); + auto driver_result = pfnGetKernelNames( hModule, pCount, pNames ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAddressRangeEpilogue( hContext, ptr, pBase, pSize ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAddressRange(result, hContext, ptr, pBase, pSize); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetKernelNamesEpilogue( hModule, pCount, pNames ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); } - return logAndPropagateResult_zeMemGetAddressRange(driver_result, hContext, ptr, pBase, pSize); + return logAndPropagateResult_zeModuleGetKernelNames(driver_result, hModule, pCount, pNames); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandle + /// @brief Intercept function for zeModuleGetProperties __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeModuleGetProperties( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. ) { - context.logger->log_trace("zeMemGetIpcHandle(hContext, ptr, pIpcHandle)"); + context.logger->log_trace("zeModuleGetProperties(hModule, pModuleProperties)"); - auto pfnGetIpcHandle = context.zeDdiTable.Mem.pfnGetIpcHandle; + auto pfnGetProperties = context.zeDdiTable.Module.pfnGetProperties; - if( nullptr == pfnGetIpcHandle ) - return logAndPropagateResult_zeMemGetIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pIpcHandle); + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zeModuleGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pModuleProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandlePrologue( hContext, ptr, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetPropertiesPrologue( hModule, pModuleProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); } @@ -12625,44 +14529,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandlePrologue( hContext, ptr, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetPropertiesPrologue( hModule, pModuleProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); } - auto driver_result = pfnGetIpcHandle( hContext, ptr, pIpcHandle ); + auto driver_result = pfnGetProperties( hModule, pModuleProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleEpilogue( hContext, ptr, pIpcHandle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandle(result, hContext, ptr, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetPropertiesEpilogue( hModule, pModuleProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeMemGetIpcHandle(driver_result, hContext, ptr, pIpcHandle); + return logAndPropagateResult_zeModuleGetProperties(driver_result, hModule, pModuleProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleFromFileDescriptorExp + /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleFromFileDescriptorExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - uint64_t handle, ///< [in] file descriptor - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeKernelCreate( + ze_module_handle_t hModule, ///< [in] handle of the module + const ze_kernel_desc_t* desc, ///< [in] pointer to kernel descriptor + ze_kernel_handle_t* phKernel ///< [out] handle of the Function object ) { - context.logger->log_trace("zeMemGetIpcHandleFromFileDescriptorExp(hContext, handle, pIpcHandle)"); + context.logger->log_trace("zeKernelCreate(hModule, desc, phKernel)"); - auto pfnGetIpcHandleFromFileDescriptorExp = context.zeDdiTable.MemExp.pfnGetIpcHandleFromFileDescriptorExp; + auto pfnCreate = context.zeDdiTable.Kernel.pfnCreate; - if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) - return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, handle, pIpcHandle); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeKernelCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, desc, phKernel); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleFromFileDescriptorExpPrologue( hContext, handle, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeKernelCreatePrologue( hModule, desc, phKernel ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); } @@ -12672,44 +14572,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleFromFileDescriptorExpPrologue( hContext, handle, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelCreatePrologue( hModule, desc, phKernel ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); } - auto driver_result = pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); + auto driver_result = pfnCreate( hModule, desc, phKernel ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleFromFileDescriptorExpEpilogue( hContext, handle, pIpcHandle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(result, hContext, handle, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeKernelCreateEpilogue( hModule, desc, phKernel ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + if (phKernel){ + context.handleLifetime->addHandle( *phKernel ); + context.handleLifetime->addDependent( hModule, *phKernel ); + + } } - return logAndPropagateResult_zeMemGetIpcHandleFromFileDescriptorExp(driver_result, hContext, handle, pIpcHandle); + return logAndPropagateResult_zeKernelCreate(driver_result, hModule, desc, phKernel); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetFileDescriptorFromIpcHandleExp + /// @brief Intercept function for zeKernelDestroy __zedlllocal ze_result_t ZE_APICALL - zeMemGetFileDescriptorFromIpcHandleExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_ipc_mem_handle_t ipcHandle, ///< [in] IPC memory handle - uint64_t* pHandle ///< [out] Returned file descriptor + zeKernelDestroy( + ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object ) { - context.logger->log_trace("zeMemGetFileDescriptorFromIpcHandleExp(hContext, ipcHandle, pHandle)"); + context.logger->log_trace("zeKernelDestroy(hKernel)"); - auto pfnGetFileDescriptorFromIpcHandleExp = context.zeDdiTable.MemExp.pfnGetFileDescriptorFromIpcHandleExp; + auto pfnDestroy = context.zeDdiTable.Kernel.pfnDestroy; - if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) - return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ipcHandle, pHandle); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeKernelDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetFileDescriptorFromIpcHandleExpPrologue( hContext, ipcHandle, pHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); + auto result = context.validationHandlers[i]->zeValidation->zeKernelDestroyPrologue( hKernel ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); } @@ -12719,43 +14622,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetFileDescriptorFromIpcHandleExpPrologue( hContext, ipcHandle, pHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelDestroyPrologue( hKernel ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); } - auto driver_result = pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); + auto driver_result = pfnDestroy( hKernel ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetFileDescriptorFromIpcHandleExpEpilogue( hContext, ipcHandle, pHandle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(result, hContext, ipcHandle, pHandle); + auto result = context.validationHandlers[i]->zeValidation->zeKernelDestroyEpilogue( hKernel ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeMemGetFileDescriptorFromIpcHandleExp(driver_result, hContext, ipcHandle, pHandle); + return logAndPropagateResult_zeKernelDestroy(driver_result, hKernel); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemPutIpcHandle + /// @brief Intercept function for zeModuleGetFunctionPointer __zedlllocal ze_result_t ZE_APICALL - zeMemPutIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_ipc_mem_handle_t handle ///< [in] IPC memory handle + zeModuleGetFunctionPointer( + ze_module_handle_t hModule, ///< [in] handle of the module + const char* pFunctionName, ///< [in] Name of function to retrieve function pointer for. + void** pfnFunction ///< [out] pointer to function. ) { - context.logger->log_trace("zeMemPutIpcHandle(hContext, handle)"); + context.logger->log_trace("zeModuleGetFunctionPointer(hModule, pFunctionName, pfnFunction)"); - auto pfnPutIpcHandle = context.zeDdiTable.Mem.pfnPutIpcHandle; + auto pfnGetFunctionPointer = context.zeDdiTable.Module.pfnGetFunctionPointer; - if( nullptr == pfnPutIpcHandle ) - return logAndPropagateResult_zeMemPutIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, handle); + if( nullptr == pfnGetFunctionPointer ) + return logAndPropagateResult_zeModuleGetFunctionPointer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pFunctionName, pfnFunction); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemPutIpcHandlePrologue( hContext, handle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetFunctionPointerPrologue( hModule, pFunctionName, pfnFunction ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); } @@ -12765,43 +14665,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemPutIpcHandlePrologue( hContext, handle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetFunctionPointerPrologue( hModule, pFunctionName, pfnFunction ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); } - auto driver_result = pfnPutIpcHandle( hContext, handle ); + auto driver_result = pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemPutIpcHandleEpilogue( hContext, handle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemPutIpcHandle(result, hContext, handle); + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetFunctionPointerEpilogue( hModule, pFunctionName, pfnFunction ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); } - return logAndPropagateResult_zeMemPutIpcHandle(driver_result, hContext, handle); + return logAndPropagateResult_zeModuleGetFunctionPointer(driver_result, hModule, pFunctionName, pfnFunction); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemOpenIpcHandle + /// @brief Intercept function for zeKernelSetGroupSize __zedlllocal ze_result_t ZE_APICALL - zeMemOpenIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle - ze_ipc_mem_handle_t handle, ///< [in] IPC memory handle - ze_ipc_memory_flags_t flags, ///< [in] flags controlling the operation. - ///< must be 0 (default) or a valid combination of ::ze_ipc_memory_flag_t. - void** pptr ///< [out] pointer to device allocation in this process + zeKernelSetGroupSize( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t groupSizeX, ///< [in] group size for X dimension to use for this kernel + uint32_t groupSizeY, ///< [in] group size for Y dimension to use for this kernel + uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel ) { - context.logger->log_trace("zeMemOpenIpcHandle(hContext, hDevice, handle, flags, pptr)"); + context.logger->log_trace("zeKernelSetGroupSize(hKernel, groupSizeX, groupSizeY, groupSizeZ)"); - auto pfnOpenIpcHandle = context.zeDdiTable.Mem.pfnOpenIpcHandle; + auto pfnSetGroupSize = context.zeDdiTable.Kernel.pfnSetGroupSize; - if( nullptr == pfnOpenIpcHandle ) - return logAndPropagateResult_zeMemOpenIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, handle, flags, pptr); + if( nullptr == pfnSetGroupSize ) + return logAndPropagateResult_zeKernelSetGroupSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, groupSizeX, groupSizeY, groupSizeZ); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemOpenIpcHandlePrologue( hContext, hDevice, handle, flags, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGroupSizePrologue( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); } @@ -12811,39 +14709,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemOpenIpcHandlePrologue( hContext, hDevice, handle, flags, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetGroupSizePrologue( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); } - auto driver_result = pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); + auto driver_result = pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemOpenIpcHandleEpilogue( hContext, hDevice, handle, flags, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemOpenIpcHandle(result, hContext, hDevice, handle, flags, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGroupSizeEpilogue( hKernel, groupSizeX, groupSizeY, groupSizeZ ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); } - return logAndPropagateResult_zeMemOpenIpcHandle(driver_result, hContext, hDevice, handle, flags, pptr); + return logAndPropagateResult_zeKernelSetGroupSize(driver_result, hKernel, groupSizeX, groupSizeY, groupSizeZ); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemCloseIpcHandle + /// @brief Intercept function for zeKernelSuggestGroupSize __zedlllocal ze_result_t ZE_APICALL - zeMemCloseIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr ///< [in][release] pointer to device allocation in this process + zeKernelSuggestGroupSize( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t globalSizeX, ///< [in] global width for X dimension + uint32_t globalSizeY, ///< [in] global width for Y dimension + uint32_t globalSizeZ, ///< [in] global width for Z dimension + uint32_t* groupSizeX, ///< [out] recommended size of group for X dimension + uint32_t* groupSizeY, ///< [out] recommended size of group for Y dimension + uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension ) { - context.logger->log_trace("zeMemCloseIpcHandle(hContext, ptr)"); + context.logger->log_trace("zeKernelSuggestGroupSize(hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ)"); - auto pfnCloseIpcHandle = context.zeDdiTable.Mem.pfnCloseIpcHandle; + auto pfnSuggestGroupSize = context.zeDdiTable.Kernel.pfnSuggestGroupSize; - if( nullptr == pfnCloseIpcHandle ) - return logAndPropagateResult_zeMemCloseIpcHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr); + if( nullptr == pfnSuggestGroupSize ) + return logAndPropagateResult_zeKernelSuggestGroupSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemCloseIpcHandlePrologue( hContext, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestGroupSizePrologue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); } @@ -12853,43 +14756,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemCloseIpcHandlePrologue( hContext, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSuggestGroupSizePrologue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); } - auto driver_result = pfnCloseIpcHandle( hContext, ptr ); + auto driver_result = pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemCloseIpcHandleEpilogue( hContext, ptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemCloseIpcHandle(result, hContext, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestGroupSizeEpilogue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); } - return logAndPropagateResult_zeMemCloseIpcHandle(driver_result, hContext, ptr); + return logAndPropagateResult_zeKernelSuggestGroupSize(driver_result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemSetAtomicAccessAttributeExp + /// @brief Intercept function for zeKernelSuggestMaxCooperativeGroupCount __zedlllocal ze_result_t ZE_APICALL - zeMemSetAtomicAccessAttributeExp( - ze_context_handle_t hContext, ///< [in] handle of context - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_atomic_attr_exp_flags_t attr ///< [in] Atomic access attributes to set for the specified range. - ///< Must be 0 (default) or a valid combination of ::ze_memory_atomic_attr_exp_flag_t. + zeKernelSuggestMaxCooperativeGroupCount( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t* totalGroupCount ///< [out] recommended total group count. ) { - context.logger->log_trace("zeMemSetAtomicAccessAttributeExp(hContext, hDevice, ptr, size, attr)"); + context.logger->log_trace("zeKernelSuggestMaxCooperativeGroupCount(hKernel, totalGroupCount)"); - auto pfnSetAtomicAccessAttributeExp = context.zeDdiTable.MemExp.pfnSetAtomicAccessAttributeExp; + auto pfnSuggestMaxCooperativeGroupCount = context.zeDdiTable.Kernel.pfnSuggestMaxCooperativeGroupCount; - if( nullptr == pfnSetAtomicAccessAttributeExp ) - return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size, attr); + if( nullptr == pfnSuggestMaxCooperativeGroupCount ) + return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, totalGroupCount); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemSetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, attr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestMaxCooperativeGroupCountPrologue( hKernel, totalGroupCount ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); } @@ -12899,42 +14798,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemSetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, attr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSuggestMaxCooperativeGroupCountPrologue( hKernel, totalGroupCount ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); } - auto driver_result = pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); + auto driver_result = pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemSetAtomicAccessAttributeExpEpilogue( hContext, hDevice, ptr, size, attr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, attr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestMaxCooperativeGroupCountEpilogue( hKernel, totalGroupCount ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); } - return logAndPropagateResult_zeMemSetAtomicAccessAttributeExp(driver_result, hContext, hDevice, ptr, size, attr); + return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(driver_result, hKernel, totalGroupCount); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetAtomicAccessAttributeExp + /// @brief Intercept function for zeKernelSetArgumentValue __zedlllocal ze_result_t ZE_APICALL - zeMemGetAtomicAccessAttributeExp( - ze_context_handle_t hContext, ///< [in] handle of context - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_atomic_attr_exp_flags_t* pAttr ///< [out] Atomic access attributes for the specified range + zeKernelSetArgumentValue( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + size_t argSize, ///< [in] size of argument type + const void* pArgValue ///< [in][optional] argument value represented as matching arg type. If + ///< null then argument value is considered null. ) { - context.logger->log_trace("zeMemGetAtomicAccessAttributeExp(hContext, hDevice, ptr, size, pAttr)"); + context.logger->log_trace("zeKernelSetArgumentValue(hKernel, argIndex, argSize, pArgValue)"); - auto pfnGetAtomicAccessAttributeExp = context.zeDdiTable.MemExp.pfnGetAtomicAccessAttributeExp; + auto pfnSetArgumentValue = context.zeDdiTable.Kernel.pfnSetArgumentValue; - if( nullptr == pfnGetAtomicAccessAttributeExp ) - return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size, pAttr); + if( nullptr == pfnSetArgumentValue ) + return logAndPropagateResult_zeKernelSetArgumentValue(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, argIndex, argSize, pArgValue); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, pAttr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetArgumentValuePrologue( hKernel, argIndex, argSize, pArgValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); } @@ -12944,46 +14843,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetAtomicAccessAttributeExpPrologue( hContext, hDevice, ptr, size, pAttr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetArgumentValuePrologue( hKernel, argIndex, argSize, pArgValue ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); } - auto driver_result = pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); + auto driver_result = pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetAtomicAccessAttributeExpEpilogue( hContext, hDevice, ptr, size, pAttr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(result, hContext, hDevice, ptr, size, pAttr); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetArgumentValueEpilogue( hKernel, argIndex, argSize, pArgValue ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeMemGetAtomicAccessAttributeExp(driver_result, hContext, hDevice, ptr, size, pAttr); + return logAndPropagateResult_zeKernelSetArgumentValue(driver_result, hKernel, argIndex, argSize, pArgValue); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleCreate + /// @brief Intercept function for zeKernelSetIndirectAccess __zedlllocal ze_result_t ZE_APICALL - zeModuleCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_module_desc_t* desc, ///< [in] pointer to module descriptor - ze_module_handle_t* phModule, ///< [out] pointer to handle of module object created - ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. + zeKernelSetIndirectAccess( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags ) { - context.logger->log_trace("zeModuleCreate(hContext, hDevice, desc, phModule, phBuildLog)"); + context.logger->log_trace("zeKernelSetIndirectAccess(hKernel, flags)"); - auto pfnCreate = context.zeDdiTable.Module.pfnCreate; + auto pfnSetIndirectAccess = context.zeDdiTable.Kernel.pfnSetIndirectAccess; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeModuleCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phModule, phBuildLog); + if( nullptr == pfnSetIndirectAccess ) + return logAndPropagateResult_zeKernelSetIndirectAccess(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, flags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleCreatePrologue( hContext, hDevice, desc, phModule, phBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetIndirectAccessPrologue( hKernel, flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); } @@ -12993,52 +14885,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleCreatePrologue( hContext, hDevice, desc, phModule, phBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); - } - - auto driver_result = pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleCreateEpilogue( hContext, hDevice, desc, phModule, phBuildLog ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleCreate(result, hContext, hDevice, desc, phModule, phBuildLog); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetIndirectAccessPrologue( hKernel, flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); } + auto driver_result = pfnSetIndirectAccess( hKernel, flags ); - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phModule){ - context.handleLifetime->addHandle( *phModule ); - context.handleLifetime->addDependent( hContext, *phModule ); - - } - if (phBuildLog){ - context.handleLifetime->addHandle( *phBuildLog ); - context.handleLifetime->addDependent( hContext, *phBuildLog ); - - } + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetIndirectAccessEpilogue( hKernel, flags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); } - return logAndPropagateResult_zeModuleCreate(driver_result, hContext, hDevice, desc, phModule, phBuildLog); + + return logAndPropagateResult_zeKernelSetIndirectAccess(driver_result, hKernel, flags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleDestroy + /// @brief Intercept function for zeKernelGetIndirectAccess __zedlllocal ze_result_t ZE_APICALL - zeModuleDestroy( - ze_module_handle_t hModule ///< [in][release] handle of the module + zeKernelGetIndirectAccess( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. ) { - context.logger->log_trace("zeModuleDestroy(hModule)"); + context.logger->log_trace("zeKernelGetIndirectAccess(hKernel, pFlags)"); - auto pfnDestroy = context.zeDdiTable.Module.pfnDestroy; + auto pfnGetIndirectAccess = context.zeDdiTable.Kernel.pfnGetIndirectAccess; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeModuleDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule); + if( nullptr == pfnGetIndirectAccess ) + return logAndPropagateResult_zeKernelGetIndirectAccess(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pFlags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleDestroyPrologue( hModule ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetIndirectAccessPrologue( hKernel, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); } @@ -13048,41 +14927,51 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleDestroyPrologue( hModule ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetIndirectAccessPrologue( hKernel, pFlags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); } - auto driver_result = pfnDestroy( hModule ); + auto driver_result = pfnGetIndirectAccess( hKernel, pFlags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleDestroyEpilogue( hModule ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDestroy(result, hModule); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetIndirectAccessEpilogue( hKernel, pFlags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); } - return logAndPropagateResult_zeModuleDestroy(driver_result, hModule); + return logAndPropagateResult_zeKernelGetIndirectAccess(driver_result, hKernel, pFlags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleDynamicLink + /// @brief Intercept function for zeKernelGetSourceAttributes __zedlllocal ze_result_t ZE_APICALL - zeModuleDynamicLink( - uint32_t numModules, ///< [in] number of modules to be linked pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to - ///< dynamically link together. - ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. + zeKernelGetSourceAttributes( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t* pSize, ///< [in,out] pointer to size of string in bytes, including + ///< null-terminating character. + char** pString ///< [in,out][optional] pointer to application-managed character array + ///< (string data). + ///< If NULL, the string length of the kernel source attributes, including + ///< a null-terminating character, is returned in pSize. Otherwise, pString + ///< must point to valid application memory that is greater than or equal + ///< to *pSize bytes in length, and on return the pointed-to string will + ///< contain a space-separated list of kernel source attributes. Note: This + ///< API was originally intended to ship with a char *pString, however this + ///< typo was introduced. Thus the API has to stay this way for backwards + ///< compatible reasons. It can be corrected in v2.0. Suggestion is to + ///< create your own char *pString and then pass to this API with &pString. ) { - context.logger->log_trace("zeModuleDynamicLink(numModules, phModulesLocal, phLinkLog)"); + context.logger->log_trace("zeKernelGetSourceAttributes(hKernel, pSize, pString)"); - auto pfnDynamicLink = context.zeDdiTable.Module.pfnDynamicLink; + auto pfnGetSourceAttributes = context.zeDdiTable.Kernel.pfnGetSourceAttributes; - if( nullptr == pfnDynamicLink ) - return logAndPropagateResult_zeModuleDynamicLink(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, numModules, phModules, phLinkLog); + if( nullptr == pfnGetSourceAttributes ) + return logAndPropagateResult_zeKernelGetSourceAttributes(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pString); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleDynamicLinkPrologue( numModules, phModules, phLinkLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetSourceAttributesPrologue( hKernel, pSize, pString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); } @@ -13092,38 +14981,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleDynamicLinkPrologue( numModules, phModules, phLinkLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetSourceAttributesPrologue( hKernel, pSize, pString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); } - auto driver_result = pfnDynamicLink( numModules, phModules, phLinkLog ); + auto driver_result = pfnGetSourceAttributes( hKernel, pSize, pString ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleDynamicLinkEpilogue( numModules, phModules, phLinkLog ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleDynamicLink(result, numModules, phModules, phLinkLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetSourceAttributesEpilogue( hKernel, pSize, pString ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); } - return logAndPropagateResult_zeModuleDynamicLink(driver_result, numModules, phModules, phLinkLog); + return logAndPropagateResult_zeKernelGetSourceAttributes(driver_result, hKernel, pSize, pString); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleBuildLogDestroy + /// @brief Intercept function for zeKernelSetCacheConfig __zedlllocal ze_result_t ZE_APICALL - zeModuleBuildLogDestroy( - ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. + zeKernelSetCacheConfig( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_cache_config_flags_t flags ///< [in] cache configuration. + ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. ) { - context.logger->log_trace("zeModuleBuildLogDestroy(hModuleBuildLog)"); + context.logger->log_trace("zeKernelSetCacheConfig(hKernel, flags)"); - auto pfnDestroy = context.zeDdiTable.ModuleBuildLog.pfnDestroy; + auto pfnSetCacheConfig = context.zeDdiTable.Kernel.pfnSetCacheConfig; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeModuleBuildLogDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModuleBuildLog); + if( nullptr == pfnSetCacheConfig ) + return logAndPropagateResult_zeKernelSetCacheConfig(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, flags); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogDestroyPrologue( hModuleBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetCacheConfigPrologue( hKernel, flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); } @@ -13133,40 +15024,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleBuildLogDestroyPrologue( hModuleBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetCacheConfigPrologue( hKernel, flags ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); } - auto driver_result = pfnDestroy( hModuleBuildLog ); + auto driver_result = pfnSetCacheConfig( hKernel, flags ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogDestroyEpilogue( hModuleBuildLog ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogDestroy(result, hModuleBuildLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetCacheConfigEpilogue( hKernel, flags ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); } - return logAndPropagateResult_zeModuleBuildLogDestroy(driver_result, hModuleBuildLog); + return logAndPropagateResult_zeKernelSetCacheConfig(driver_result, hKernel, flags); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleBuildLogGetString + /// @brief Intercept function for zeKernelGetProperties __zedlllocal ze_result_t ZE_APICALL - zeModuleBuildLogGetString( - ze_module_build_log_handle_t hModuleBuildLog, ///< [in] handle of the module build log object. - size_t* pSize, ///< [in,out] size of build log string. - char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. + zeKernelGetProperties( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. ) { - context.logger->log_trace("zeModuleBuildLogGetString(hModuleBuildLog, pSize, pBuildLog)"); + context.logger->log_trace("zeKernelGetProperties(hKernel, pKernelProperties)"); - auto pfnGetString = context.zeDdiTable.ModuleBuildLog.pfnGetString; + auto pfnGetProperties = context.zeDdiTable.Kernel.pfnGetProperties; - if( nullptr == pfnGetString ) - return logAndPropagateResult_zeModuleBuildLogGetString(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModuleBuildLog, pSize, pBuildLog); + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zeKernelGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pKernelProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogGetStringPrologue( hModuleBuildLog, pSize, pBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetPropertiesPrologue( hKernel, pKernelProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); } @@ -13176,40 +15066,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleBuildLogGetStringPrologue( hModuleBuildLog, pSize, pBuildLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetPropertiesPrologue( hKernel, pKernelProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); } - auto driver_result = pfnGetString( hModuleBuildLog, pSize, pBuildLog ); + auto driver_result = pfnGetProperties( hKernel, pKernelProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleBuildLogGetStringEpilogue( hModuleBuildLog, pSize, pBuildLog ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleBuildLogGetString(result, hModuleBuildLog, pSize, pBuildLog); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetPropertiesEpilogue( hKernel, pKernelProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); } - return logAndPropagateResult_zeModuleBuildLogGetString(driver_result, hModuleBuildLog, pSize, pBuildLog); + return logAndPropagateResult_zeKernelGetProperties(driver_result, hKernel, pKernelProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleGetNativeBinary + /// @brief Intercept function for zeKernelGetName __zedlllocal ze_result_t ZE_APICALL - zeModuleGetNativeBinary( - ze_module_handle_t hModule, ///< [in] handle of the module - size_t* pSize, ///< [in,out] size of native binary in bytes. - uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary + zeKernelGetName( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + size_t* pSize, ///< [in,out] size of kernel name string, including null terminator, in + ///< bytes. + char* pName ///< [in,out][optional] char pointer to kernel name. ) { - context.logger->log_trace("zeModuleGetNativeBinary(hModule, pSize, pModuleNativeBinary)"); + context.logger->log_trace("zeKernelGetName(hKernel, pSize, pName)"); - auto pfnGetNativeBinary = context.zeDdiTable.Module.pfnGetNativeBinary; + auto pfnGetName = context.zeDdiTable.Kernel.pfnGetName; - if( nullptr == pfnGetNativeBinary ) - return logAndPropagateResult_zeModuleGetNativeBinary(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pSize, pModuleNativeBinary); + if( nullptr == pfnGetName ) + return logAndPropagateResult_zeKernelGetName(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pName); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetNativeBinaryPrologue( hModule, pSize, pModuleNativeBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetNamePrologue( hKernel, pSize, pName ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); } @@ -13219,41 +15110,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetNativeBinaryPrologue( hModule, pSize, pModuleNativeBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetNamePrologue( hKernel, pSize, pName ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); } - auto driver_result = pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); + auto driver_result = pfnGetName( hKernel, pSize, pName ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetNativeBinaryEpilogue( hModule, pSize, pModuleNativeBinary ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetNativeBinary(result, hModule, pSize, pModuleNativeBinary); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetNameEpilogue( hKernel, pSize, pName ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); } - return logAndPropagateResult_zeModuleGetNativeBinary(driver_result, hModule, pSize, pModuleNativeBinary); + return logAndPropagateResult_zeKernelGetName(driver_result, hKernel, pSize, pName); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleGetGlobalPointer + /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL - zeModuleGetGlobalPointer( - ze_module_handle_t hModule, ///< [in] handle of the module - const char* pGlobalName, ///< [in] name of global variable in module - size_t* pSize, ///< [in,out][optional] size of global variable - void** pptr ///< [in,out][optional] device visible pointer + zeCommandListAppendLaunchKernel( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeModuleGetGlobalPointer(hModule, pGlobalName, pSize, pptr)"); + context.logger->log_trace("zeCommandListAppendLaunchKernel(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetGlobalPointer = context.zeDdiTable.Module.pfnGetGlobalPointer; + auto pfnAppendLaunchKernel = context.zeDdiTable.CommandList.pfnAppendLaunchKernel; - if( nullptr == pfnGetGlobalPointer ) - return logAndPropagateResult_zeModuleGetGlobalPointer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pGlobalName, pSize, pptr); + if( nullptr == pfnAppendLaunchKernel ) + return logAndPropagateResult_zeCommandListAppendLaunchKernel(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetGlobalPointerPrologue( hModule, pGlobalName, pSize, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13263,46 +15158,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetGlobalPointerPrologue( hModule, pGlobalName, pSize, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); + auto driver_result = pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetGlobalPointerEpilogue( hModule, pGlobalName, pSize, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetGlobalPointer(result, hModule, pGlobalName, pSize, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelEpilogue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeModuleGetGlobalPointer(driver_result, hModule, pGlobalName, pSize, pptr); + return logAndPropagateResult_zeCommandListAppendLaunchKernel(driver_result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleGetKernelNames + /// @brief Intercept function for zeCommandListAppendLaunchKernelWithParameters __zedlllocal ze_result_t ZE_APICALL - zeModuleGetKernelNames( - ze_module_handle_t hModule, ///< [in] handle of the module - uint32_t* pCount, ///< [in,out] pointer to the number of names. - ///< if count is zero, then the driver shall update the value with the - ///< total number of names available. - ///< if count is greater than the number of names available, then the - ///< driver shall update the value with the correct number of names available. - const char** pNames ///< [in,out][optional][range(0, *pCount)] array of names of functions. - ///< if count is less than the number of names available, then driver shall - ///< only retrieve that number of names. + zeCommandListAppendLaunchKernelWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pGroupCounts, ///< [in] thread group launch arguments + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeModuleGetKernelNames(hModule, pCount, pNames)"); + context.logger->log_trace("zeCommandListAppendLaunchKernelWithParameters(hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetKernelNames = context.zeDdiTable.Module.pfnGetKernelNames; + auto pfnAppendLaunchKernelWithParameters = context.zeDdiTable.CommandList.pfnAppendLaunchKernelWithParameters; - if( nullptr == pfnGetKernelNames ) - return logAndPropagateResult_zeModuleGetKernelNames(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pCount, pNames); + if( nullptr == pfnAppendLaunchKernelWithParameters ) + return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetKernelNamesPrologue( hModule, pCount, pNames ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithParametersPrologue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13312,39 +15207,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetKernelNamesPrologue( hModule, pCount, pNames ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelWithParametersPrologue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetKernelNames( hModule, pCount, pNames ); + auto driver_result = pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetKernelNamesEpilogue( hModule, pCount, pNames ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetKernelNames(result, hModule, pCount, pNames); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithParametersEpilogue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeModuleGetKernelNames(driver_result, hModule, pCount, pNames); + return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(driver_result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleGetProperties + /// @brief Intercept function for zeCommandListAppendLaunchKernelWithArguments __zedlllocal ze_result_t ZE_APICALL - zeModuleGetProperties( - ze_module_handle_t hModule, ///< [in] handle of the module - ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. + zeCommandListAppendLaunchKernelWithArguments( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t groupCounts, ///< [in] thread group counts + const ze_group_size_t groupSizes, ///< [in] thread group sizes + void ** pArguments, ///< [in]pointer to an array of pointers + const void * pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeModuleGetProperties(hModule, pModuleProperties)"); + context.logger->log_trace("zeCommandListAppendLaunchKernelWithArguments(hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetProperties = context.zeDdiTable.Module.pfnGetProperties; + auto pfnAppendLaunchKernelWithArguments = context.zeDdiTable.CommandList.pfnAppendLaunchKernelWithArguments; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zeModuleGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pModuleProperties); + if( nullptr == pfnAppendLaunchKernelWithArguments ) + return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetPropertiesPrologue( hModule, pModuleProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithArgumentsPrologue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13354,40 +15258,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetPropertiesPrologue( hModule, pModuleProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelWithArgumentsPrologue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetProperties( hModule, pModuleProperties ); + auto driver_result = pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetPropertiesEpilogue( hModule, pModuleProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetProperties(result, hModule, pModuleProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithArgumentsEpilogue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeModuleGetProperties(driver_result, hModule, pModuleProperties); + return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(driver_result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelCreate + /// @brief Intercept function for zeCommandListAppendLaunchCooperativeKernel __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 - ze_kernel_handle_t* phKernel ///< [out] handle of the Function object + zeCommandListAppendLaunchCooperativeKernel( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeKernelCreate(hModule, desc, phKernel)"); + context.logger->log_trace("zeCommandListAppendLaunchCooperativeKernel(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreate = context.zeDdiTable.Kernel.pfnCreate; + auto pfnAppendLaunchCooperativeKernel = context.zeDdiTable.CommandList.pfnAppendLaunchCooperativeKernel; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeKernelCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, desc, phKernel); + if( nullptr == pfnAppendLaunchCooperativeKernel ) + return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelCreatePrologue( hModule, desc, phKernel ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchCooperativeKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13397,47 +15306,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelCreatePrologue( hModule, desc, phKernel ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchCooperativeKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnCreate( hModule, desc, phKernel ); + auto driver_result = pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelCreateEpilogue( hModule, desc, phKernel ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelCreate(result, hModule, desc, phKernel); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchCooperativeKernelEpilogue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phKernel){ - context.handleLifetime->addHandle( *phKernel ); - context.handleLifetime->addDependent( hModule, *phKernel ); - - } - } - return logAndPropagateResult_zeKernelCreate(driver_result, hModule, desc, phKernel); + return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(driver_result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelDestroy + /// @brief Intercept function for zeCommandListAppendLaunchKernelIndirect __zedlllocal ze_result_t ZE_APICALL - zeKernelDestroy( - ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object + zeCommandListAppendLaunchKernelIndirect( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in] pointer to device buffer that will contain thread group launch + ///< arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeKernelDestroy(hKernel)"); + context.logger->log_trace("zeCommandListAppendLaunchKernelIndirect(hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnDestroy = context.zeDdiTable.Kernel.pfnDestroy; + auto pfnAppendLaunchKernelIndirect = context.zeDdiTable.CommandList.pfnAppendLaunchKernelIndirect; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeKernelDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel); + if( nullptr == pfnAppendLaunchKernelIndirect ) + return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelDestroyPrologue( hKernel ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelIndirectPrologue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13447,40 +15355,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelDestroyPrologue( hKernel ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelIndirectPrologue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnDestroy( hKernel ); + auto driver_result = pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelDestroyEpilogue( hKernel ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelDestroy(result, hKernel); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelIndirectEpilogue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeKernelDestroy(driver_result, hKernel); + return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(driver_result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleGetFunctionPointer + /// @brief Intercept function for zeCommandListAppendLaunchMultipleKernelsIndirect __zedlllocal ze_result_t ZE_APICALL - zeModuleGetFunctionPointer( - ze_module_handle_t hModule, ///< [in] handle of the module - const char* pFunctionName, ///< [in] Name of function to retrieve function pointer for. - void** pfnFunction ///< [out] pointer to function. + zeCommandListAppendLaunchMultipleKernelsIndirect( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] maximum number of kernels to launch + ze_kernel_handle_t* phKernels, ///< [in][range(0, numKernels)] handles of the kernel objects + const uint32_t* pCountBuffer, ///< [in] pointer to device memory location that will contain the actual + ///< number of kernels to launch; value must be less than or equal to + ///< numKernels + const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in][range(0, numKernels)] pointer to device buffer that will contain + ///< a contiguous array of thread group launch arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeModuleGetFunctionPointer(hModule, pFunctionName, pfnFunction)"); + context.logger->log_trace("zeCommandListAppendLaunchMultipleKernelsIndirect(hCommandList, numKernels, phKernelsLocal, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetFunctionPointer = context.zeDdiTable.Module.pfnGetFunctionPointer; + auto pfnAppendLaunchMultipleKernelsIndirect = context.zeDdiTable.CommandList.pfnAppendLaunchMultipleKernelsIndirect; - if( nullptr == pfnGetFunctionPointer ) - return logAndPropagateResult_zeModuleGetFunctionPointer(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, pFunctionName, pfnFunction); + if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) + return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetFunctionPointerPrologue( hModule, pFunctionName, pfnFunction ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchMultipleKernelsIndirectPrologue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -13490,41 +15408,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetFunctionPointerPrologue( hModule, pFunctionName, pfnFunction ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchMultipleKernelsIndirectPrologue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); + auto driver_result = pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleGetFunctionPointerEpilogue( hModule, pFunctionName, pfnFunction ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetFunctionPointer(result, hModule, pFunctionName, pfnFunction); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchMultipleKernelsIndirectEpilogue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeModuleGetFunctionPointer(driver_result, hModule, pFunctionName, pfnFunction); + return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(driver_result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSetGroupSize + /// @brief Intercept function for zeContextMakeMemoryResident __zedlllocal ze_result_t ZE_APICALL - zeKernelSetGroupSize( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t groupSizeX, ///< [in] group size for X dimension to use for this kernel - uint32_t groupSizeY, ///< [in] group size for Y dimension to use for this kernel - uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel + zeContextMakeMemoryResident( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + void* ptr, ///< [in] pointer to memory to make resident + size_t size ///< [in] size in bytes to make resident ) { - context.logger->log_trace("zeKernelSetGroupSize(hKernel, groupSizeX, groupSizeY, groupSizeZ)"); + context.logger->log_trace("zeContextMakeMemoryResident(hContext, hDevice, ptr, size)"); - auto pfnSetGroupSize = context.zeDdiTable.Kernel.pfnSetGroupSize; + auto pfnMakeMemoryResident = context.zeDdiTable.Context.pfnMakeMemoryResident; - if( nullptr == pfnSetGroupSize ) - return logAndPropagateResult_zeKernelSetGroupSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, groupSizeX, groupSizeY, groupSizeZ); + if( nullptr == pfnMakeMemoryResident ) + return logAndPropagateResult_zeContextMakeMemoryResident(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGroupSizePrologue( hKernel, groupSizeX, groupSizeY, groupSizeZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.validationHandlers[i]->zeValidation->zeContextMakeMemoryResidentPrologue( hContext, hDevice, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); } @@ -13534,44 +15452,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetGroupSizePrologue( hKernel, groupSizeX, groupSizeY, groupSizeZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.handleLifetime->zeHandleLifetime.zeContextMakeMemoryResidentPrologue( hContext, hDevice, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); } - auto driver_result = pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + auto driver_result = pfnMakeMemoryResident( hContext, hDevice, ptr, size ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGroupSizeEpilogue( hKernel, groupSizeX, groupSizeY, groupSizeZ ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGroupSize(result, hKernel, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.validationHandlers[i]->zeValidation->zeContextMakeMemoryResidentEpilogue( hContext, hDevice, ptr, size ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); } - return logAndPropagateResult_zeKernelSetGroupSize(driver_result, hKernel, groupSizeX, groupSizeY, groupSizeZ); + return logAndPropagateResult_zeContextMakeMemoryResident(driver_result, hContext, hDevice, ptr, size); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSuggestGroupSize + /// @brief Intercept function for zeContextEvictMemory __zedlllocal ze_result_t ZE_APICALL - zeKernelSuggestGroupSize( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t globalSizeX, ///< [in] global width for X dimension - uint32_t globalSizeY, ///< [in] global width for Y dimension - uint32_t globalSizeZ, ///< [in] global width for Z dimension - uint32_t* groupSizeX, ///< [out] recommended size of group for X dimension - uint32_t* groupSizeY, ///< [out] recommended size of group for Y dimension - uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension + zeContextEvictMemory( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + void* ptr, ///< [in] pointer to memory to evict + size_t size ///< [in] size in bytes to evict ) { - context.logger->log_trace("zeKernelSuggestGroupSize(hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ)"); + context.logger->log_trace("zeContextEvictMemory(hContext, hDevice, ptr, size)"); - auto pfnSuggestGroupSize = context.zeDdiTable.Kernel.pfnSuggestGroupSize; + auto pfnEvictMemory = context.zeDdiTable.Context.pfnEvictMemory; - if( nullptr == pfnSuggestGroupSize ) - return logAndPropagateResult_zeKernelSuggestGroupSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); + if( nullptr == pfnEvictMemory ) + return logAndPropagateResult_zeContextEvictMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestGroupSizePrologue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.validationHandlers[i]->zeValidation->zeContextEvictMemoryPrologue( hContext, hDevice, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); } @@ -13581,39 +15496,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSuggestGroupSizePrologue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.handleLifetime->zeHandleLifetime.zeContextEvictMemoryPrologue( hContext, hDevice, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); } - auto driver_result = pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + auto driver_result = pfnEvictMemory( hContext, hDevice, ptr, size ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestGroupSizeEpilogue( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestGroupSize(result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); + auto result = context.validationHandlers[i]->zeValidation->zeContextEvictMemoryEpilogue( hContext, hDevice, ptr, size ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); } - return logAndPropagateResult_zeKernelSuggestGroupSize(driver_result, hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ); + return logAndPropagateResult_zeContextEvictMemory(driver_result, hContext, hDevice, ptr, size); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSuggestMaxCooperativeGroupCount + /// @brief Intercept function for zeContextMakeImageResident __zedlllocal ze_result_t ZE_APICALL - zeKernelSuggestMaxCooperativeGroupCount( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t* totalGroupCount ///< [out] recommended total group count. + zeContextMakeImageResident( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_image_handle_t hImage ///< [in] handle of image to make resident ) { - context.logger->log_trace("zeKernelSuggestMaxCooperativeGroupCount(hKernel, totalGroupCount)"); + context.logger->log_trace("zeContextMakeImageResident(hContext, hDevice, hImage)"); - auto pfnSuggestMaxCooperativeGroupCount = context.zeDdiTable.Kernel.pfnSuggestMaxCooperativeGroupCount; + auto pfnMakeImageResident = context.zeDdiTable.Context.pfnMakeImageResident; - if( nullptr == pfnSuggestMaxCooperativeGroupCount ) - return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, totalGroupCount); + if( nullptr == pfnMakeImageResident ) + return logAndPropagateResult_zeContextMakeImageResident(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, hImage); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestMaxCooperativeGroupCountPrologue( hKernel, totalGroupCount ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); + auto result = context.validationHandlers[i]->zeValidation->zeContextMakeImageResidentPrologue( hContext, hDevice, hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); } @@ -13623,42 +15539,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSuggestMaxCooperativeGroupCountPrologue( hKernel, totalGroupCount ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); + auto result = context.handleLifetime->zeHandleLifetime.zeContextMakeImageResidentPrologue( hContext, hDevice, hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); } - auto driver_result = pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); + auto driver_result = pfnMakeImageResident( hContext, hDevice, hImage ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSuggestMaxCooperativeGroupCountEpilogue( hKernel, totalGroupCount ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(result, hKernel, totalGroupCount); + auto result = context.validationHandlers[i]->zeValidation->zeContextMakeImageResidentEpilogue( hContext, hDevice, hImage ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); } - return logAndPropagateResult_zeKernelSuggestMaxCooperativeGroupCount(driver_result, hKernel, totalGroupCount); + return logAndPropagateResult_zeContextMakeImageResident(driver_result, hContext, hDevice, hImage); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSetArgumentValue + /// @brief Intercept function for zeContextEvictImage __zedlllocal ze_result_t ZE_APICALL - zeKernelSetArgumentValue( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - size_t argSize, ///< [in] size of argument type - const void* pArgValue ///< [in][optional] argument value represented as matching arg type. If - ///< null then argument value is considered null. + zeContextEvictImage( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_image_handle_t hImage ///< [in] handle of image to make evict ) { - context.logger->log_trace("zeKernelSetArgumentValue(hKernel, argIndex, argSize, pArgValue)"); + context.logger->log_trace("zeContextEvictImage(hContext, hDevice, hImage)"); - auto pfnSetArgumentValue = context.zeDdiTable.Kernel.pfnSetArgumentValue; + auto pfnEvictImage = context.zeDdiTable.Context.pfnEvictImage; - if( nullptr == pfnSetArgumentValue ) - return logAndPropagateResult_zeKernelSetArgumentValue(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, argIndex, argSize, pArgValue); + if( nullptr == pfnEvictImage ) + return logAndPropagateResult_zeContextEvictImage(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, hImage); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetArgumentValuePrologue( hKernel, argIndex, argSize, pArgValue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); + auto result = context.validationHandlers[i]->zeValidation->zeContextEvictImagePrologue( hContext, hDevice, hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); } @@ -13668,39 +15582,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetArgumentValuePrologue( hKernel, argIndex, argSize, pArgValue ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); + auto result = context.handleLifetime->zeHandleLifetime.zeContextEvictImagePrologue( hContext, hDevice, hImage ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); } - auto driver_result = pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); + auto driver_result = pfnEvictImage( hContext, hDevice, hImage ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetArgumentValueEpilogue( hKernel, argIndex, argSize, pArgValue ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetArgumentValue(result, hKernel, argIndex, argSize, pArgValue); + auto result = context.validationHandlers[i]->zeValidation->zeContextEvictImageEpilogue( hContext, hDevice, hImage ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); } - return logAndPropagateResult_zeKernelSetArgumentValue(driver_result, hKernel, argIndex, argSize, pArgValue); + return logAndPropagateResult_zeContextEvictImage(driver_result, hContext, hDevice, hImage); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSetIndirectAccess + /// @brief Intercept function for zeSamplerCreate __zedlllocal ze_result_t ZE_APICALL - zeKernelSetIndirectAccess( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags + zeSamplerCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_sampler_desc_t* desc, ///< [in] pointer to sampler descriptor + ze_sampler_handle_t* phSampler ///< [out] handle of the sampler ) { - context.logger->log_trace("zeKernelSetIndirectAccess(hKernel, flags)"); + context.logger->log_trace("zeSamplerCreate(hContext, hDevice, desc, phSampler)"); - auto pfnSetIndirectAccess = context.zeDdiTable.Kernel.pfnSetIndirectAccess; + auto pfnCreate = context.zeDdiTable.Sampler.pfnCreate; - if( nullptr == pfnSetIndirectAccess ) - return logAndPropagateResult_zeKernelSetIndirectAccess(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, flags); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zeSamplerCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phSampler); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetIndirectAccessPrologue( hKernel, flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); + auto result = context.validationHandlers[i]->zeValidation->zeSamplerCreatePrologue( hContext, hDevice, desc, phSampler ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); } @@ -13710,39 +15626,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetIndirectAccessPrologue( hKernel, flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); + auto result = context.handleLifetime->zeHandleLifetime.zeSamplerCreatePrologue( hContext, hDevice, desc, phSampler ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); } - auto driver_result = pfnSetIndirectAccess( hKernel, flags ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phSampler ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetIndirectAccessEpilogue( hKernel, flags ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetIndirectAccess(result, hKernel, flags); + auto result = context.validationHandlers[i]->zeValidation->zeSamplerCreateEpilogue( hContext, hDevice, desc, phSampler ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); } - return logAndPropagateResult_zeKernelSetIndirectAccess(driver_result, hKernel, flags); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phSampler){ + context.handleLifetime->addHandle( *phSampler ); + context.handleLifetime->addDependent( hContext, *phSampler ); + + } + } + return logAndPropagateResult_zeSamplerCreate(driver_result, hContext, hDevice, desc, phSampler); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetIndirectAccess + /// @brief Intercept function for zeSamplerDestroy __zedlllocal ze_result_t ZE_APICALL - zeKernelGetIndirectAccess( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. + zeSamplerDestroy( + ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler ) { - context.logger->log_trace("zeKernelGetIndirectAccess(hKernel, pFlags)"); + context.logger->log_trace("zeSamplerDestroy(hSampler)"); - auto pfnGetIndirectAccess = context.zeDdiTable.Kernel.pfnGetIndirectAccess; + auto pfnDestroy = context.zeDdiTable.Sampler.pfnDestroy; - if( nullptr == pfnGetIndirectAccess ) - return logAndPropagateResult_zeKernelGetIndirectAccess(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pFlags); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zeSamplerDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSampler); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetIndirectAccessPrologue( hKernel, pFlags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); + auto result = context.validationHandlers[i]->zeValidation->zeSamplerDestroyPrologue( hSampler ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); } @@ -13752,51 +15676,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetIndirectAccessPrologue( hKernel, pFlags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); + auto result = context.handleLifetime->zeHandleLifetime.zeSamplerDestroyPrologue( hSampler ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); } - auto driver_result = pfnGetIndirectAccess( hKernel, pFlags ); + auto driver_result = pfnDestroy( hSampler ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetIndirectAccessEpilogue( hKernel, pFlags ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetIndirectAccess(result, hKernel, pFlags); + auto result = context.validationHandlers[i]->zeValidation->zeSamplerDestroyEpilogue( hSampler ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); } - return logAndPropagateResult_zeKernelGetIndirectAccess(driver_result, hKernel, pFlags); + return logAndPropagateResult_zeSamplerDestroy(driver_result, hSampler); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetSourceAttributes + /// @brief Intercept function for zeVirtualMemReserve __zedlllocal ze_result_t ZE_APICALL - zeKernelGetSourceAttributes( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t* pSize, ///< [in,out] pointer to size of string in bytes, including - ///< null-terminating character. - char** pString ///< [in,out][optional] pointer to application-managed character array - ///< (string data). - ///< If NULL, the string length of the kernel source attributes, including - ///< a null-terminating character, is returned in pSize. Otherwise, pString - ///< must point to valid application memory that is greater than or equal - ///< to *pSize bytes in length, and on return the pointed-to string will - ///< contain a space-separated list of kernel source attributes. Note: This - ///< API was originally intended to ship with a char *pString, however this - ///< typo was introduced. Thus the API has to stay this way for backwards - ///< compatible reasons. It can be corrected in v2.0. Suggestion is to - ///< create your own char *pString and then pass to this API with &pString. + zeVirtualMemReserve( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* pStart, ///< [in][optional] pointer to start of region to reserve. If nullptr then + ///< implementation will choose a start address. + size_t size, ///< [in] size in bytes to reserve; must be page aligned. + void** pptr ///< [out] pointer to virtual reservation. ) { - context.logger->log_trace("zeKernelGetSourceAttributes(hKernel, pSize, pString)"); + context.logger->log_trace("zeVirtualMemReserve(hContext, pStart, size, pptr)"); - auto pfnGetSourceAttributes = context.zeDdiTable.Kernel.pfnGetSourceAttributes; + auto pfnReserve = context.zeDdiTable.VirtualMem.pfnReserve; - if( nullptr == pfnGetSourceAttributes ) - return logAndPropagateResult_zeKernelGetSourceAttributes(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pString); + if( nullptr == pfnReserve ) + return logAndPropagateResult_zeVirtualMemReserve(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pStart, size, pptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetSourceAttributesPrologue( hKernel, pSize, pString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemReservePrologue( hContext, pStart, size, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); } @@ -13806,40 +15721,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetSourceAttributesPrologue( hKernel, pSize, pString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemReservePrologue( hContext, pStart, size, pptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); } - auto driver_result = pfnGetSourceAttributes( hKernel, pSize, pString ); + auto driver_result = pfnReserve( hContext, pStart, size, pptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetSourceAttributesEpilogue( hKernel, pSize, pString ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetSourceAttributes(result, hKernel, pSize, pString); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemReserveEpilogue( hContext, pStart, size, pptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); } - return logAndPropagateResult_zeKernelGetSourceAttributes(driver_result, hKernel, pSize, pString); + return logAndPropagateResult_zeVirtualMemReserve(driver_result, hContext, pStart, size, pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSetCacheConfig + /// @brief Intercept function for zeVirtualMemFree __zedlllocal ze_result_t ZE_APICALL - zeKernelSetCacheConfig( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_cache_config_flags_t flags ///< [in] cache configuration. - ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. + zeVirtualMemFree( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of region to free. + size_t size ///< [in] size in bytes to free; must be page aligned. ) { - context.logger->log_trace("zeKernelSetCacheConfig(hKernel, flags)"); + context.logger->log_trace("zeVirtualMemFree(hContext, ptr, size)"); - auto pfnSetCacheConfig = context.zeDdiTable.Kernel.pfnSetCacheConfig; + auto pfnFree = context.zeDdiTable.VirtualMem.pfnFree; - if( nullptr == pfnSetCacheConfig ) - return logAndPropagateResult_zeKernelSetCacheConfig(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, flags); + if( nullptr == pfnFree ) + return logAndPropagateResult_zeVirtualMemFree(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetCacheConfigPrologue( hKernel, flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemFreePrologue( hContext, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); } @@ -13849,39 +15764,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetCacheConfigPrologue( hKernel, flags ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemFreePrologue( hContext, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); } - auto driver_result = pfnSetCacheConfig( hKernel, flags ); + auto driver_result = pfnFree( hContext, ptr, size ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetCacheConfigEpilogue( hKernel, flags ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetCacheConfig(result, hKernel, flags); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemFreeEpilogue( hContext, ptr, size ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); } - return logAndPropagateResult_zeKernelSetCacheConfig(driver_result, hKernel, flags); + return logAndPropagateResult_zeVirtualMemFree(driver_result, hContext, ptr, size); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetProperties + /// @brief Intercept function for zeVirtualMemQueryPageSize __zedlllocal ze_result_t ZE_APICALL - zeKernelGetProperties( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. + zeVirtualMemQueryPageSize( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t size, ///< [in] unaligned allocation size in bytes + size_t* pagesize ///< [out] pointer to page size to use for start address and size + ///< alignments. ) { - context.logger->log_trace("zeKernelGetProperties(hKernel, pKernelProperties)"); + context.logger->log_trace("zeVirtualMemQueryPageSize(hContext, hDevice, size, pagesize)"); - auto pfnGetProperties = context.zeDdiTable.Kernel.pfnGetProperties; + auto pfnQueryPageSize = context.zeDdiTable.VirtualMem.pfnQueryPageSize; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zeKernelGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pKernelProperties); + if( nullptr == pfnQueryPageSize ) + return logAndPropagateResult_zeVirtualMemQueryPageSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, size, pagesize); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetPropertiesPrologue( hKernel, pKernelProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemQueryPageSizePrologue( hContext, hDevice, size, pagesize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); } @@ -13891,41 +15809,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetPropertiesPrologue( hKernel, pKernelProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemQueryPageSizePrologue( hContext, hDevice, size, pagesize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); } - auto driver_result = pfnGetProperties( hKernel, pKernelProperties ); + auto driver_result = pfnQueryPageSize( hContext, hDevice, size, pagesize ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetPropertiesEpilogue( hKernel, pKernelProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetProperties(result, hKernel, pKernelProperties); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemQueryPageSizeEpilogue( hContext, hDevice, size, pagesize ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); } - return logAndPropagateResult_zeKernelGetProperties(driver_result, hKernel, pKernelProperties); + return logAndPropagateResult_zeVirtualMemQueryPageSize(driver_result, hContext, hDevice, size, pagesize); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetName + /// @brief Intercept function for zePhysicalMemGetProperties __zedlllocal ze_result_t ZE_APICALL - zeKernelGetName( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - size_t* pSize, ///< [in,out] size of kernel name string, including null terminator, in - ///< bytes. - char* pName ///< [in,out][optional] char pointer to kernel name. + zePhysicalMemGetProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object + ze_physical_mem_properties_t* pMemProperties ///< [in,out] pointer to physical memory properties structure. ) { - context.logger->log_trace("zeKernelGetName(hKernel, pSize, pName)"); + context.logger->log_trace("zePhysicalMemGetProperties(hContext, hPhysicalMem, pMemProperties)"); - auto pfnGetName = context.zeDdiTable.Kernel.pfnGetName; + auto pfnGetProperties = context.zeDdiTable.PhysicalMem.pfnGetProperties; - if( nullptr == pfnGetName ) - return logAndPropagateResult_zeKernelGetName(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pName); + if( nullptr == pfnGetProperties ) + return logAndPropagateResult_zePhysicalMemGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hPhysicalMem, pMemProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetNamePrologue( hKernel, pSize, pName ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemGetPropertiesPrologue( hContext, hPhysicalMem, pMemProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); } @@ -13935,45 +15852,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetNamePrologue( hKernel, pSize, pName ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); + auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemGetPropertiesPrologue( hContext, hPhysicalMem, pMemProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); } - auto driver_result = pfnGetName( hKernel, pSize, pName ); + auto driver_result = pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetNameEpilogue( hKernel, pSize, pName ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetName(result, hKernel, pSize, pName); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemGetPropertiesEpilogue( hContext, hPhysicalMem, pMemProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); } - return logAndPropagateResult_zeKernelGetName(driver_result, hKernel, pSize, pName); + return logAndPropagateResult_zePhysicalMemGetProperties(driver_result, hContext, hPhysicalMem, pMemProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchKernel + /// @brief Intercept function for zePhysicalMemCreate __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 - const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zePhysicalMemCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating + ///< physical host memory. + ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. + ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created ) { - context.logger->log_trace("zeCommandListAppendLaunchKernel(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zePhysicalMemCreate(hContext, hDevice, desc, phPhysicalMemory)"); - auto pfnAppendLaunchKernel = context.zeDdiTable.CommandList.pfnAppendLaunchKernel; + auto pfnCreate = context.zeDdiTable.PhysicalMem.pfnCreate; - if( nullptr == pfnAppendLaunchKernel ) - return logAndPropagateResult_zeCommandListAppendLaunchKernel(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCreate ) + return logAndPropagateResult_zePhysicalMemCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phPhysicalMemory); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemCreatePrologue( hContext, hDevice, desc, phPhysicalMemory ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); } @@ -13983,46 +15897,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemCreatePrologue( hContext, hDevice, desc, phPhysicalMemory ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); } - auto driver_result = pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelEpilogue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemCreateEpilogue( hContext, hDevice, desc, phPhysicalMemory ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); } - return logAndPropagateResult_zeCommandListAppendLaunchKernel(driver_result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phPhysicalMemory){ + context.handleLifetime->addHandle( *phPhysicalMemory ); + context.handleLifetime->addDependent( hContext, *phPhysicalMemory ); + + } + } + return logAndPropagateResult_zePhysicalMemCreate(driver_result, hContext, hDevice, desc, phPhysicalMemory); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchKernelWithParameters + /// @brief Intercept function for zePhysicalMemDestroy __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendLaunchKernelWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pGroupCounts, ///< [in] thread group launch arguments - const void * pNext, ///< [in][optional] additional parameters passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zePhysicalMemDestroy( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy ) { - context.logger->log_trace("zeCommandListAppendLaunchKernelWithParameters(hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zePhysicalMemDestroy(hContext, hPhysicalMemory)"); - auto pfnAppendLaunchKernelWithParameters = context.zeDdiTable.CommandList.pfnAppendLaunchKernelWithParameters; + auto pfnDestroy = context.zeDdiTable.PhysicalMem.pfnDestroy; - if( nullptr == pfnAppendLaunchKernelWithParameters ) - return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnDestroy ) + return logAndPropagateResult_zePhysicalMemDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hPhysicalMemory); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithParametersPrologue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemDestroyPrologue( hContext, hPhysicalMemory ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); } @@ -14032,48 +15948,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelWithParametersPrologue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemDestroyPrologue( hContext, hPhysicalMemory ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); } - auto driver_result = pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnDestroy( hContext, hPhysicalMemory ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithParametersEpilogue( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemDestroyEpilogue( hContext, hPhysicalMemory ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); } - return logAndPropagateResult_zeCommandListAppendLaunchKernelWithParameters(driver_result, hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zePhysicalMemDestroy(driver_result, hContext, hPhysicalMemory); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchKernelWithArguments + /// @brief Intercept function for zeVirtualMemMap __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendLaunchKernelWithArguments( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t groupCounts, ///< [in] thread group counts - const ze_group_size_t groupSizes, ///< [in] thread group sizes - void ** pArguments, ///< [in]pointer to an array of pointers - const void * pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeVirtualMemMap( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of virtual address range to map. + size_t size, ///< [in] size in bytes of virtual address range to map; must be page + ///< aligned. + ze_physical_mem_handle_t hPhysicalMemory, ///< [in] handle to physical memory object. + size_t offset, ///< [in] offset into physical memory allocation object; must be page + ///< aligned. + ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address + ///< range. ) { - context.logger->log_trace("zeCommandListAppendLaunchKernelWithArguments(hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeVirtualMemMap(hContext, ptr, size, hPhysicalMemory, offset, access)"); - auto pfnAppendLaunchKernelWithArguments = context.zeDdiTable.CommandList.pfnAppendLaunchKernelWithArguments; + auto pfnMap = context.zeDdiTable.VirtualMem.pfnMap; - if( nullptr == pfnAppendLaunchKernelWithArguments ) - return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnMap ) + return logAndPropagateResult_zeVirtualMemMap(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, hPhysicalMemory, offset, access); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithArgumentsPrologue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemMapPrologue( hContext, ptr, size, hPhysicalMemory, offset, access ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); } @@ -14083,45 +15997,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelWithArgumentsPrologue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemMapPrologue( hContext, ptr, size, hPhysicalMemory, offset, access ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); } - auto driver_result = pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelWithArgumentsEpilogue( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemMapEpilogue( hContext, ptr, size, hPhysicalMemory, offset, access ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); } - return logAndPropagateResult_zeCommandListAppendLaunchKernelWithArguments(driver_result, hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeVirtualMemMap(driver_result, hContext, ptr, size, hPhysicalMemory, offset, access); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchCooperativeKernel + /// @brief Intercept function for zeVirtualMemUnmap __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendLaunchCooperativeKernel( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeVirtualMemUnmap( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of region to unmap. + size_t size ///< [in] size in bytes to unmap; must be page aligned. ) { - context.logger->log_trace("zeCommandListAppendLaunchCooperativeKernel(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeVirtualMemUnmap(hContext, ptr, size)"); - auto pfnAppendLaunchCooperativeKernel = context.zeDdiTable.CommandList.pfnAppendLaunchCooperativeKernel; + auto pfnUnmap = context.zeDdiTable.VirtualMem.pfnUnmap; - if( nullptr == pfnAppendLaunchCooperativeKernel ) - return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnUnmap ) + return logAndPropagateResult_zeVirtualMemUnmap(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchCooperativeKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemUnmapPrologue( hContext, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); } @@ -14131,46 +16040,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchCooperativeKernelPrologue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemUnmapPrologue( hContext, ptr, size ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); } - auto driver_result = pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnUnmap( hContext, ptr, size ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchCooperativeKernelEpilogue( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemUnmapEpilogue( hContext, ptr, size ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); } - return logAndPropagateResult_zeCommandListAppendLaunchCooperativeKernel(driver_result, hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeVirtualMemUnmap(driver_result, hContext, ptr, size); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchKernelIndirect + /// @brief Intercept function for zeVirtualMemSetAccessAttribute __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendLaunchKernelIndirect( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in] pointer to device buffer that will contain thread group launch - ///< arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeVirtualMemSetAccessAttribute( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of reserved virtual address region. + size_t size, ///< [in] size in bytes; must be page aligned. + ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address + ///< range. ) { - context.logger->log_trace("zeCommandListAppendLaunchKernelIndirect(hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - - auto pfnAppendLaunchKernelIndirect = context.zeDdiTable.CommandList.pfnAppendLaunchKernelIndirect; + context.logger->log_trace("zeVirtualMemSetAccessAttribute(hContext, ptr, size, access)"); - if( nullptr == pfnAppendLaunchKernelIndirect ) - return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto pfnSetAccessAttribute = context.zeDdiTable.VirtualMem.pfnSetAccessAttribute; + + if( nullptr == pfnSetAccessAttribute ) + return logAndPropagateResult_zeVirtualMemSetAccessAttribute(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, access); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelIndirectPrologue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemSetAccessAttributePrologue( hContext, ptr, size, access ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); } @@ -14180,50 +16085,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchKernelIndirectPrologue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemSetAccessAttributePrologue( hContext, ptr, size, access ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); } - auto driver_result = pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnSetAccessAttribute( hContext, ptr, size, access ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchKernelIndirectEpilogue( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemSetAccessAttributeEpilogue( hContext, ptr, size, access ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); } - return logAndPropagateResult_zeCommandListAppendLaunchKernelIndirect(driver_result, hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeVirtualMemSetAccessAttribute(driver_result, hContext, ptr, size, access); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendLaunchMultipleKernelsIndirect + /// @brief Intercept function for zeVirtualMemGetAccessAttribute __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendLaunchMultipleKernelsIndirect( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] maximum number of kernels to launch - ze_kernel_handle_t* phKernels, ///< [in][range(0, numKernels)] handles of the kernel objects - const uint32_t* pCountBuffer, ///< [in] pointer to device memory location that will contain the actual - ///< number of kernels to launch; value must be less than or equal to - ///< numKernels - const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in][range(0, numKernels)] pointer to device buffer that will contain - ///< a contiguous array of thread group launch arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeVirtualMemGetAccessAttribute( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of virtual address region for query. + size_t size, ///< [in] size in bytes; must be page aligned. + ze_memory_access_attribute_t* access, ///< [out] query result for page access attribute. + size_t* outSize ///< [out] query result for size of virtual address range, starting at ptr, + ///< that shares same access attribute. ) { - context.logger->log_trace("zeCommandListAppendLaunchMultipleKernelsIndirect(hCommandList, numKernels, phKernelsLocal, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeVirtualMemGetAccessAttribute(hContext, ptr, size, access, outSize)"); - auto pfnAppendLaunchMultipleKernelsIndirect = context.zeDdiTable.CommandList.pfnAppendLaunchMultipleKernelsIndirect; + auto pfnGetAccessAttribute = context.zeDdiTable.VirtualMem.pfnGetAccessAttribute; - if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) - return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnGetAccessAttribute ) + return logAndPropagateResult_zeVirtualMemGetAccessAttribute(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, access, outSize); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchMultipleKernelsIndirectPrologue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemGetAccessAttributePrologue( hContext, ptr, size, access, outSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); } @@ -14233,41 +16131,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendLaunchMultipleKernelsIndirectPrologue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemGetAccessAttributePrologue( hContext, ptr, size, access, outSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); } - auto driver_result = pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendLaunchMultipleKernelsIndirectEpilogue( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemGetAccessAttributeEpilogue( hContext, ptr, size, access, outSize ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); } - return logAndPropagateResult_zeCommandListAppendLaunchMultipleKernelsIndirect(driver_result, hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeVirtualMemGetAccessAttribute(driver_result, hContext, ptr, size, access, outSize); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextMakeMemoryResident + /// @brief Intercept function for zeKernelSetGlobalOffsetExp __zedlllocal ze_result_t ZE_APICALL - zeContextMakeMemoryResident( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - void* ptr, ///< [in] pointer to memory to make resident - size_t size ///< [in] size in bytes to make resident + zeKernelSetGlobalOffsetExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t offsetX, ///< [in] global offset for X dimension to use for this kernel + uint32_t offsetY, ///< [in] global offset for Y dimension to use for this kernel + uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel ) { - context.logger->log_trace("zeContextMakeMemoryResident(hContext, hDevice, ptr, size)"); + context.logger->log_trace("zeKernelSetGlobalOffsetExp(hKernel, offsetX, offsetY, offsetZ)"); - auto pfnMakeMemoryResident = context.zeDdiTable.Context.pfnMakeMemoryResident; + auto pfnSetGlobalOffsetExp = context.zeDdiTable.KernelExp.pfnSetGlobalOffsetExp; - if( nullptr == pfnMakeMemoryResident ) - return logAndPropagateResult_zeContextMakeMemoryResident(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size); + if( nullptr == pfnSetGlobalOffsetExp ) + return logAndPropagateResult_zeKernelSetGlobalOffsetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, offsetX, offsetY, offsetZ); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextMakeMemoryResidentPrologue( hContext, hDevice, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGlobalOffsetExpPrologue( hKernel, offsetX, offsetY, offsetZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); } @@ -14277,41 +16175,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextMakeMemoryResidentPrologue( hContext, hDevice, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetGlobalOffsetExpPrologue( hKernel, offsetX, offsetY, offsetZ ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); } - auto driver_result = pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + auto driver_result = pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextMakeMemoryResidentEpilogue( hContext, hDevice, ptr, size ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeMemoryResident(result, hContext, hDevice, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGlobalOffsetExpEpilogue( hKernel, offsetX, offsetY, offsetZ ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); } - return logAndPropagateResult_zeContextMakeMemoryResident(driver_result, hContext, hDevice, ptr, size); + return logAndPropagateResult_zeKernelSetGlobalOffsetExp(driver_result, hKernel, offsetX, offsetY, offsetZ); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextEvictMemory + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeContextEvictMemory( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - void* ptr, ///< [in] pointer to memory to evict - size_t size ///< [in] size in bytes to evict + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { - context.logger->log_trace("zeContextEvictMemory(hContext, hDevice, ptr, size)"); + context.logger->log_trace("zeKernelGetBinaryExp(hKernel, pSize, pKernelBinary)"); - auto pfnEvictMemory = context.zeDdiTable.Context.pfnEvictMemory; + auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; - if( nullptr == pfnEvictMemory ) - return logAndPropagateResult_zeContextEvictMemory(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, ptr, size); + if( nullptr == pfnGetBinaryExp ) + return logAndPropagateResult_zeKernelGetBinaryExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pKernelBinary); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextEvictMemoryPrologue( hContext, hDevice, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } @@ -14321,40 +16218,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextEvictMemoryPrologue( hContext, hDevice, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } - auto driver_result = pfnEvictMemory( hContext, hDevice, ptr, size ); + auto driver_result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextEvictMemoryEpilogue( hContext, hDevice, ptr, size ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictMemory(result, hContext, hDevice, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpEpilogue( hKernel, pSize, pKernelBinary ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } - return logAndPropagateResult_zeContextEvictMemory(driver_result, hContext, hDevice, ptr, size); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeKernelGetBinaryExp(driver_result, hKernel, pSize, pKernelBinary); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextMakeImageResident + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeContextMakeImageResident( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_image_handle_t hImage ///< [in] handle of image to make resident + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { - context.logger->log_trace("zeContextMakeImageResident(hContext, hDevice, hImage)"); + context.logger->log_trace("zeDeviceImportExternalSemaphoreExt(hDevice, desc, phSemaphore)"); - auto pfnMakeImageResident = context.zeDdiTable.Context.pfnMakeImageResident; + auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnMakeImageResident ) - return logAndPropagateResult_zeContextMakeImageResident(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, hImage); + if( nullptr == pfnImportExternalSemaphoreExt ) + return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, phSemaphore); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextMakeImageResidentPrologue( hContext, hDevice, hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } @@ -14364,40 +16265,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextMakeImageResidentPrologue( hContext, hDevice, hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } - auto driver_result = pfnMakeImageResident( hContext, hDevice, hImage ); + auto driver_result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextMakeImageResidentEpilogue( hContext, hDevice, hImage ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextMakeImageResident(result, hContext, hDevice, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtEpilogue( hDevice, desc, phSemaphore ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } - return logAndPropagateResult_zeContextMakeImageResident(driver_result, hContext, hDevice, hImage); + return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(driver_result, hDevice, desc, phSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeContextEvictImage + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeContextEvictImage( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_image_handle_t hImage ///< [in] handle of image to make evict + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { - context.logger->log_trace("zeContextEvictImage(hContext, hDevice, hImage)"); + context.logger->log_trace("zeDeviceReleaseExternalSemaphoreExt(hSemaphore)"); - auto pfnEvictImage = context.zeDdiTable.Context.pfnEvictImage; + auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnEvictImage ) - return logAndPropagateResult_zeContextEvictImage(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, hImage); + if( nullptr == pfnReleaseExternalSemaphoreExt ) + return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSemaphore); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextEvictImagePrologue( hContext, hDevice, hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } @@ -14407,41 +16306,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeContextEvictImagePrologue( hContext, hDevice, hImage ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } - auto driver_result = pfnEvictImage( hContext, hDevice, hImage ); + auto driver_result = pfnReleaseExternalSemaphoreExt( hSemaphore ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeContextEvictImageEpilogue( hContext, hDevice, hImage ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeContextEvictImage(result, hContext, hDevice, hImage); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtEpilogue( hSemaphore ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } - return logAndPropagateResult_zeContextEvictImage(driver_result, hContext, hDevice, hImage); + return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(driver_result, hSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeSamplerCreate + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeSamplerCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_sampler_desc_t* desc, ///< [in] pointer to sampler descriptor - ze_sampler_handle_t* phSampler ///< [out] handle of the sampler + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeSamplerCreate(hContext, hDevice, desc, phSampler)"); + context.logger->log_trace("zeCommandListAppendSignalExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreate = context.zeDdiTable.Sampler.pfnCreate; + auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zeSamplerCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phSampler); + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) + return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeSamplerCreatePrologue( hContext, hDevice, desc, phSampler ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -14451,47 +16357,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeSamplerCreatePrologue( hContext, hDevice, desc, phSampler ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); - } - - auto driver_result = pfnCreate( hContext, hDevice, desc, phSampler ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeSamplerCreateEpilogue( hContext, hDevice, desc, phSampler ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerCreate(result, hContext, hDevice, desc, phSampler); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } + auto driver_result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phSampler){ - context.handleLifetime->addHandle( *phSampler ); - context.handleLifetime->addDependent( hContext, *phSampler ); - - } + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeSamplerCreate(driver_result, hContext, hDevice, desc, phSampler); + + return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeSamplerDestroy + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeSamplerDestroy( - ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeSamplerDestroy(hSampler)"); + context.logger->log_trace("zeCommandListAppendWaitExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnDestroy = context.zeDdiTable.Sampler.pfnDestroy; + auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zeSamplerDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSampler); + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) + return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeSamplerDestroyPrologue( hSampler ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -14501,42 +16408,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeSamplerDestroyPrologue( hSampler ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnDestroy( hSampler ); + auto driver_result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeSamplerDestroyEpilogue( hSampler ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeSamplerDestroy(result, hSampler); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeSamplerDestroy(driver_result, hSampler); + return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemReserve + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemReserve( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* pStart, ///< [in][optional] pointer to start of region to reserve. If nullptr then - ///< implementation will choose a start address. - size_t size, ///< [in] size in bytes to reserve; must be page aligned. - void** pptr ///< [out] pointer to virtual reservation. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { - context.logger->log_trace("zeVirtualMemReserve(hContext, pStart, size, pptr)"); + context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); - auto pfnReserve = context.zeDdiTable.VirtualMem.pfnReserve; + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - if( nullptr == pfnReserve ) - return logAndPropagateResult_zeVirtualMemReserve(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pStart, size, pptr); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeRTASBuilderCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemReservePrologue( hContext, pStart, size, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } @@ -14546,40 +16451,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemReservePrologue( hContext, pStart, size, pptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } - auto driver_result = pfnReserve( hContext, pStart, size, pptr ); + auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemReserveEpilogue( hContext, pStart, size, pptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemReserve(result, hContext, pStart, size, pptr); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } - return logAndPropagateResult_zeVirtualMemReserve(driver_result, hContext, pStart, size, pptr); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phBuilder){ + context.handleLifetime->addHandle( *phBuilder ); + context.handleLifetime->addDependent( hDriver, *phBuilder ); + + } + } + return logAndPropagateResult_zeRTASBuilderCreateExt(driver_result, hDriver, pDescriptor, phBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemFree + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemFree( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of region to free. - size_t size ///< [in] size in bytes to free; must be page aligned. + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { - context.logger->log_trace("zeVirtualMemFree(hContext, ptr, size)"); + context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); - auto pfnFree = context.zeDdiTable.VirtualMem.pfnFree; + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnFree ) - return logAndPropagateResult_zeVirtualMemFree(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size); + if( nullptr == pfnGetBuildPropertiesExt ) + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemFreePrologue( hContext, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } @@ -14589,42 +16503,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemFreePrologue( hContext, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } - auto driver_result = pfnFree( hContext, ptr, size ); + auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemFreeEpilogue( hContext, ptr, size ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemFree(result, hContext, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } - return logAndPropagateResult_zeVirtualMemFree(driver_result, hContext, ptr, size); + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(driver_result, hBuilder, pBuildOpDescriptor, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemQueryPageSize + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemQueryPageSize( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t size, ///< [in] unaligned allocation size in bytes - size_t* pagesize ///< [out] pointer to page size to use for start address and size - ///< alignments. + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { - context.logger->log_trace("zeVirtualMemQueryPageSize(hContext, hDevice, size, pagesize)"); + context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); - auto pfnQueryPageSize = context.zeDdiTable.VirtualMem.pfnQueryPageSize; + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnQueryPageSize ) - return logAndPropagateResult_zeVirtualMemQueryPageSize(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, size, pagesize); + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemQueryPageSizePrologue( hContext, hDevice, size, pagesize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } @@ -14634,40 +16546,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemQueryPageSizePrologue( hContext, hDevice, size, pagesize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); + auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } - auto driver_result = pfnQueryPageSize( hContext, hDevice, size, pagesize ); + auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemQueryPageSizeEpilogue( hContext, hDevice, size, pagesize ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemQueryPageSize(result, hContext, hDevice, size, pagesize); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } - return logAndPropagateResult_zeVirtualMemQueryPageSize(driver_result, hContext, hDevice, size, pagesize); + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(driver_result, hDriver, rtasFormatA, rtasFormatB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zePhysicalMemGetProperties + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zePhysicalMemGetProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object - ze_physical_mem_properties_t* pMemProperties ///< [in,out] pointer to physical memory properties structure. + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - context.logger->log_trace("zePhysicalMemGetProperties(hContext, hPhysicalMem, pMemProperties)"); + context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); - auto pfnGetProperties = context.zeDdiTable.PhysicalMem.pfnGetProperties; + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - if( nullptr == pfnGetProperties ) - return logAndPropagateResult_zePhysicalMemGetProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hPhysicalMem, pMemProperties); + if( nullptr == pfnBuildExt ) + return logAndPropagateResult_zeRTASBuilderBuildExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemGetPropertiesPrologue( hContext, hPhysicalMem, pMemProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } @@ -14677,42 +16599,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemGetPropertiesPrologue( hContext, hPhysicalMem, pMemProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - auto driver_result = pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); + auto driver_result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemGetPropertiesEpilogue( hContext, hPhysicalMem, pMemProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemGetProperties(result, hContext, hPhysicalMem, pMemProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - return logAndPropagateResult_zePhysicalMemGetProperties(driver_result, hContext, hPhysicalMem, pMemProperties); + return logAndPropagateResult_zeRTASBuilderBuildExt(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zePhysicalMemCreate + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zePhysicalMemCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating - ///< physical host memory. - ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. - ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zePhysicalMemCreate(hContext, hDevice, desc, phPhysicalMemory)"); + context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreate = context.zeDdiTable.PhysicalMem.pfnCreate; + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCreate ) - return logAndPropagateResult_zePhysicalMemCreate(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, phPhysicalMemory); + if( nullptr == pfnCommandListAppendCopyExt ) + return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemCreatePrologue( hContext, hDevice, desc, phPhysicalMemory ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -14722,48 +16650,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemCreatePrologue( hContext, hDevice, desc, phPhysicalMemory ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); - } - - auto driver_result = pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemCreateEpilogue( hContext, hDevice, desc, phPhysicalMemory ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemCreate(result, hContext, hDevice, desc, phPhysicalMemory); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phPhysicalMemory){ - context.handleLifetime->addHandle( *phPhysicalMemory ); - context.handleLifetime->addDependent( hContext, *phPhysicalMemory ); - - } + auto driver_result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zePhysicalMemCreate(driver_result, hContext, hDevice, desc, phPhysicalMemory); + + return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zePhysicalMemDestroy + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zePhysicalMemDestroy( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - context.logger->log_trace("zePhysicalMemDestroy(hContext, hPhysicalMemory)"); + context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); - auto pfnDestroy = context.zeDdiTable.PhysicalMem.pfnDestroy; + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroy ) - return logAndPropagateResult_zePhysicalMemDestroy(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hPhysicalMemory); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeRTASBuilderDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemDestroyPrologue( hContext, hPhysicalMemory ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } @@ -14773,46 +16691,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zePhysicalMemDestroyPrologue( hContext, hPhysicalMemory ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } - auto driver_result = pfnDestroy( hContext, hPhysicalMemory ); + auto driver_result = pfnDestroyExt( hBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zePhysicalMemDestroyEpilogue( hContext, hPhysicalMemory ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zePhysicalMemDestroy(result, hContext, hPhysicalMemory); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtEpilogue( hBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } - return logAndPropagateResult_zePhysicalMemDestroy(driver_result, hContext, hPhysicalMemory); + return logAndPropagateResult_zeRTASBuilderDestroyExt(driver_result, hBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemMap + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemMap( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of virtual address range to map. - size_t size, ///< [in] size in bytes of virtual address range to map; must be page - ///< aligned. - ze_physical_mem_handle_t hPhysicalMemory, ///< [in] handle to physical memory object. - size_t offset, ///< [in] offset into physical memory allocation object; must be page - ///< aligned. - ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address - ///< range. + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - context.logger->log_trace("zeVirtualMemMap(hContext, ptr, size, hPhysicalMemory, offset, access)"); + context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); - auto pfnMap = context.zeDdiTable.VirtualMem.pfnMap; + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnMap ) - return logAndPropagateResult_zeVirtualMemMap(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, hPhysicalMemory, offset, access); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeRTASParallelOperationCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemMapPrologue( hContext, ptr, size, hPhysicalMemory, offset, access ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } @@ -14822,40 +16733,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemMapPrologue( hContext, ptr, size, hPhysicalMemory, offset, access ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } - auto driver_result = pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemMapEpilogue( hContext, ptr, size, hPhysicalMemory, offset, access ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemMap(result, hContext, ptr, size, hPhysicalMemory, offset, access); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtEpilogue( hDriver, phParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } - return logAndPropagateResult_zeVirtualMemMap(driver_result, hContext, ptr, size, hPhysicalMemory, offset, access); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phParallelOperation){ + context.handleLifetime->addHandle( *phParallelOperation ); + context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + + } + } + return logAndPropagateResult_zeRTASParallelOperationCreateExt(driver_result, hDriver, phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemUnmap + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemUnmap( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of region to unmap. - size_t size ///< [in] size in bytes to unmap; must be page aligned. + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - context.logger->log_trace("zeVirtualMemUnmap(hContext, ptr, size)"); + context.logger->log_trace("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); - auto pfnUnmap = context.zeDdiTable.VirtualMem.pfnUnmap; + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnUnmap ) - return logAndPropagateResult_zeVirtualMemUnmap(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size); + if( nullptr == pfnGetPropertiesExt ) + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemUnmapPrologue( hContext, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } @@ -14865,42 +16784,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemUnmapPrologue( hContext, ptr, size ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } - auto driver_result = pfnUnmap( hContext, ptr, size ); + auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemUnmapEpilogue( hContext, ptr, size ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemUnmap(result, hContext, ptr, size); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtEpilogue( hParallelOperation, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } - return logAndPropagateResult_zeVirtualMemUnmap(driver_result, hContext, ptr, size); + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(driver_result, hParallelOperation, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemSetAccessAttribute + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemSetAccessAttribute( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of reserved virtual address region. - size_t size, ///< [in] size in bytes; must be page aligned. - ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address - ///< range. + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - context.logger->log_trace("zeVirtualMemSetAccessAttribute(hContext, ptr, size, access)"); + context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); - auto pfnSetAccessAttribute = context.zeDdiTable.VirtualMem.pfnSetAccessAttribute; + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnSetAccessAttribute ) - return logAndPropagateResult_zeVirtualMemSetAccessAttribute(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, access); + if( nullptr == pfnJoinExt ) + return logAndPropagateResult_zeRTASParallelOperationJoinExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemSetAccessAttributePrologue( hContext, ptr, size, access ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } @@ -14910,43 +16825,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemSetAccessAttributePrologue( hContext, ptr, size, access ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } - auto driver_result = pfnSetAccessAttribute( hContext, ptr, size, access ); + auto driver_result = pfnJoinExt( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemSetAccessAttributeEpilogue( hContext, ptr, size, access ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemSetAccessAttribute(result, hContext, ptr, size, access); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } - return logAndPropagateResult_zeVirtualMemSetAccessAttribute(driver_result, hContext, ptr, size, access); + return logAndPropagateResult_zeRTASParallelOperationJoinExt(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeVirtualMemGetAccessAttribute + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeVirtualMemGetAccessAttribute( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of virtual address region for query. - size_t size, ///< [in] size in bytes; must be page aligned. - ze_memory_access_attribute_t* access, ///< [out] query result for page access attribute. - size_t* outSize ///< [out] query result for size of virtual address range, starting at ptr, - ///< that shares same access attribute. + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - context.logger->log_trace("zeVirtualMemGetAccessAttribute(hContext, ptr, size, access, outSize)"); + context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); - auto pfnGetAccessAttribute = context.zeDdiTable.VirtualMem.pfnGetAccessAttribute; + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnGetAccessAttribute ) - return logAndPropagateResult_zeVirtualMemGetAccessAttribute(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, size, access, outSize); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeRTASParallelOperationDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemGetAccessAttributePrologue( hContext, ptr, size, access, outSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } @@ -14956,41 +16866,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeVirtualMemGetAccessAttributePrologue( hContext, ptr, size, access, outSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } - auto driver_result = pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); + auto driver_result = pfnDestroyExt( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeVirtualMemGetAccessAttributeEpilogue( hContext, ptr, size, access, outSize ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeVirtualMemGetAccessAttribute(result, hContext, ptr, size, access, outSize); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } - return logAndPropagateResult_zeVirtualMemGetAccessAttribute(driver_result, hContext, ptr, size, access, outSize); + return logAndPropagateResult_zeRTASParallelOperationDestroyExt(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSetGlobalOffsetExp + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeKernelSetGlobalOffsetExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t offsetX, ///< [in] global offset for X dimension to use for this kernel - uint32_t offsetY, ///< [in] global offset for Y dimension to use for this kernel - uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { - context.logger->log_trace("zeKernelSetGlobalOffsetExp(hKernel, offsetX, offsetY, offsetZ)"); + context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); - auto pfnSetGlobalOffsetExp = context.zeDdiTable.KernelExp.pfnSetGlobalOffsetExp; + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnSetGlobalOffsetExp ) - return logAndPropagateResult_zeKernelSetGlobalOffsetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, offsetX, offsetY, offsetZ); + if( nullptr == pfnGetVectorWidthPropertiesExt ) + return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pVectorWidthProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGlobalOffsetExpPrologue( hKernel, offsetX, offsetY, offsetZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } @@ -15000,40 +16916,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSetGlobalOffsetExpPrologue( hKernel, offsetX, offsetY, offsetZ ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } - auto driver_result = pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); + auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSetGlobalOffsetExpEpilogue( hKernel, offsetX, offsetY, offsetZ ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSetGlobalOffsetExp(result, hKernel, offsetX, offsetY, offsetZ); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtEpilogue( hDevice, pCount, pVectorWidthProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } - return logAndPropagateResult_zeKernelSetGlobalOffsetExp(driver_result, hKernel, offsetX, offsetY, offsetZ); + return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(driver_result, hDevice, pCount, pVectorWidthProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( + zeKernelGetAllocationPropertiesExp( ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { - context.logger->log_trace("zeKernelGetBinaryExp(hKernel, pSize, pKernelBinary)"); + context.logger->log_trace("zeKernelGetAllocationPropertiesExp(hKernel, pCount, pAllocationProperties)"); - auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; + auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetBinaryExp ) - return logAndPropagateResult_zeKernelGetBinaryExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pKernelBinary); + if( nullptr == pfnGetAllocationPropertiesExp ) + return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pCount, pAllocationProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } @@ -15043,44 +16967,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } - auto driver_result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + auto driver_result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpEpilogue( hKernel, pSize, pKernelBinary ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpEpilogue( hKernel, pCount, pAllocationProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ } - return logAndPropagateResult_zeKernelGetBinaryExp(driver_result, hKernel, pSize, pKernelBinary); + return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(driver_result, hKernel, pCount, pAllocationProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - context.logger->log_trace("zeDeviceImportExternalSemaphoreExt(hDevice, desc, phSemaphore)"); + context.logger->log_trace("zeMemGetIpcHandleWithProperties(hContext, ptr, pNext, pIpcHandle)"); - auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; + auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnImportExternalSemaphoreExt ) - return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, phSemaphore); + if( nullptr == pfnGetIpcHandleWithProperties ) + return logAndPropagateResult_zeMemGetIpcHandleWithProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pNext, pIpcHandle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } @@ -15090,38 +17015,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } - auto driver_result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + auto driver_result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtEpilogue( hDevice, desc, phSemaphore ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesEpilogue( hContext, ptr, pNext, pIpcHandle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } - return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(driver_result, hDevice, desc, phSemaphore); + return logAndPropagateResult_zeMemGetIpcHandleWithProperties(driver_result, hContext, ptr, pNext, pIpcHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - context.logger->log_trace("zeDeviceReleaseExternalSemaphoreExt(hSemaphore)"); + context.logger->log_trace("zeGraphCreateExt(hContext, pNext, phGraph)"); - auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) - return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSemaphore); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeGraphCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pNext, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtPrologue( hContext, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } @@ -15131,48 +17059,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphCreateExtPrologue( hContext, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } - auto driver_result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + auto driver_result = pfnCreateExt( hContext, pNext, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtEpilogue( hSemaphore ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtEpilogue( hContext, pNext, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } - return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(driver_result, hSemaphore); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phGraph){ + context.handleLifetime->addHandle( *phGraph ); + context.handleLifetime->addDependent( hContext, *phGraph ); + + } + } + return logAndPropagateResult_zeGraphCreateExt(driver_result, hContext, pNext, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeCommandListAppendSignalExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListBeginGraphCaptureExt(hCommandList, pNext)"); - auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) - return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnBeginGraphCaptureExt ) + return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } @@ -15182,48 +17111,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } - auto driver_result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnBeginGraphCaptureExt( hCommandList, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtEpilogue( hCommandList, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } - return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(driver_result, hCommandList, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeCommandListAppendWaitExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListBeginCaptureIntoGraphExt(hCommandList, hGraph, pNext)"); - auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) - return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnBeginCaptureIntoGraphExt ) + return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } @@ -15233,40 +17155,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } - auto driver_result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtEpilogue( hCommandList, hGraph, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } - return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(driver_result, hCommandList, hGraph, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); + context.logger->log_trace("zeCommandListIsGraphCaptureEnabledExt(hCommandList)"); - auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnCreateExt ) - return logAndPropagateResult_zeRTASBuilderCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); + if( nullptr == pfnIsGraphCaptureEnabledExt ) + return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } @@ -15276,49 +17196,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } - auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + auto driver_result = pfnIsGraphCaptureEnabledExt( hCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtEpilogue( hCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phBuilder){ - context.handleLifetime->addHandle( *phBuilder ); - context.handleLifetime->addDependent( hDriver, *phBuilder ); - - } - } - return logAndPropagateResult_zeRTASBuilderCreateExt(driver_result, hDriver, pDescriptor, phBuilder); + return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(driver_result, hCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { - context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); + context.logger->log_trace("zeCommandListEndGraphCaptureExt(hCommandList, pNext, phGraph)"); - auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnGetBuildPropertiesExt ) - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); + if( nullptr == pfnEndGraphCaptureExt ) + return logAndPropagateResult_zeCommandListEndGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } @@ -15328,40 +17240,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } - auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + auto driver_result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtEpilogue( hCommandList, pNext, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(driver_result, hBuilder, pBuildOpDescriptor, pProperties); + return logAndPropagateResult_zeCommandListEndGraphCaptureExt(driver_result, hCommandList, pNext, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { - context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); + context.logger->log_trace("zeCommandListGetGraphExt(hCommandList, phGraph)"); - auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); + if( nullptr == pfnGetGraphExt ) + return logAndPropagateResult_zeCommandListGetGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } @@ -15371,50 +17282,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } - auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + auto driver_result = pfnGetGraphExt( hCommandList, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtEpilogue( hCommandList, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(driver_result, hDriver, rtasFormatA, rtasFormatB); + return logAndPropagateResult_zeCommandListGetGraphExt(driver_result, hCommandList, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { - context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); + context.logger->log_trace("zeGraphGetPrimaryCommandListExt(hGraph, phCommandList)"); - auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnBuildExt ) - return logAndPropagateResult_zeRTASBuilderBuildExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + if( nullptr == pfnGetPrimaryCommandListExt ) + return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } @@ -15424,48 +17325,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } - auto driver_result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + auto driver_result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtEpilogue( hGraph, phCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } - return logAndPropagateResult_zeRTASBuilderBuildExt(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(driver_result, hGraph, phCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeGraphSetDestructionCallbackExt(hGraph, pfnCallback, pUserData, pNext)"); - auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnCommandListAppendCopyExt ) - return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnSetDestructionCallbackExt ) + return logAndPropagateResult_zeGraphSetDestructionCallbackExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pfnCallback, pUserData, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } @@ -15475,38 +17370,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } - auto driver_result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtEpilogue( hGraph, pfnCallback, pUserData, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } - return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeGraphSetDestructionCallbackExt(driver_result, hGraph, pfnCallback, pUserData, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { - context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); + context.logger->log_trace("zeGraphInstantiateExt(hGraph, pNext, phExecutableGraph)"); - auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeRTASBuilderDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); + if( nullptr == pfnInstantiateExt ) + return logAndPropagateResult_zeGraphInstantiateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pNext, phExecutableGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } @@ -15516,39 +17414,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } - auto driver_result = pfnDestroyExt( hBuilder ); + auto driver_result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtEpilogue( hBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtEpilogue( hGraph, pNext, phExecutableGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } - return logAndPropagateResult_zeRTASBuilderDestroyExt(driver_result, hBuilder); + return logAndPropagateResult_zeGraphInstantiateExt(driver_result, hGraph, pNext, phExecutableGraph); } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); + context.logger->log_trace("zeCommandListAppendGraphExt(hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; - if( nullptr == pfnCreateExt ) - return logAndPropagateResult_zeRTASParallelOperationCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); + if( nullptr == pfnAppendGraphExt ) + return logAndPropagateResult_zeCommandListAppendGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -15558,48 +17463,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); + auto driver_result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtEpilogue( hDriver, phParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtEpilogue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phParallelOperation){ - context.handleLifetime->addHandle( *phParallelOperation ); - context.handleLifetime->addDependent( hDriver, *phParallelOperation ); - - } - } - return logAndPropagateResult_zeRTASParallelOperationCreateExt(driver_result, hDriver, phParallelOperation); + return logAndPropagateResult_zeCommandListAppendGraphExt(driver_result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { - context.logger->log_trace("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); + context.logger->log_trace("zeExecutableGraphGetSourceGraphExt(hGraph, phSourceGraph)"); - auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetPropertiesExt ) - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); + if( nullptr == pfnGetSourceGraphExt ) + return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phSourceGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } @@ -15609,38 +17505,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } - auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + auto driver_result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtEpilogue( hParallelOperation, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtEpilogue( hGraph, phSourceGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(driver_result, hParallelOperation, pProperties); + return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(driver_result, hGraph, phSourceGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { - context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); + context.logger->log_trace("zeGraphIsEmptyExt(hGraph)"); - auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; - if( nullptr == pfnJoinExt ) - return logAndPropagateResult_zeRTASParallelOperationJoinExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnIsEmptyExt ) + return logAndPropagateResult_zeGraphIsEmptyExt(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->zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } @@ -15650,38 +17546,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphIsEmptyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } - auto driver_result = pfnJoinExt( hParallelOperation ); + auto driver_result = pfnIsEmptyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } - return logAndPropagateResult_zeRTASParallelOperationJoinExt(driver_result, hParallelOperation); + return logAndPropagateResult_zeGraphIsEmptyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); + context.logger->log_trace("zeGraphDumpContentsExt(hGraph, filePath, pNext)"); - auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeRTASParallelOperationDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnDumpContentsExt ) + return logAndPropagateResult_zeGraphDumpContentsExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, filePath, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } @@ -15691,47 +17590,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } - auto driver_result = pfnDestroyExt( hParallelOperation ); + auto driver_result = pfnDumpContentsExt( hGraph, filePath, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtEpilogue( hGraph, filePath, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } - return logAndPropagateResult_zeRTASParallelOperationDestroyExt(driver_result, hParallelOperation); + return logAndPropagateResult_zeGraphDumpContentsExt(driver_result, hGraph, filePath, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { - context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); + context.logger->log_trace("zeExecutableGraphDestroyExt(hGraph)"); - auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) - return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pVectorWidthProperties); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeExecutableGraphDestroyExt(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->zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } @@ -15741,48 +17631,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } - auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + auto driver_result = pfnDestroyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtEpilogue( hDevice, pCount, pVectorWidthProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } - return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(driver_result, hDevice, pCount, pVectorWidthProperties); + return logAndPropagateResult_zeExecutableGraphDestroyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { - context.logger->log_trace("zeKernelGetAllocationPropertiesExp(hKernel, pCount, pAllocationProperties)"); + context.logger->log_trace("zeGraphDestroyExt(hGraph)"); - auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; + auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; - if( nullptr == pfnGetAllocationPropertiesExp ) - return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pCount, pAllocationProperties); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeGraphDestroyExt(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->zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } @@ -15792,45 +17672,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } - auto driver_result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + auto driver_result = pfnDestroyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpEpilogue( hKernel, pCount, pAllocationProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(driver_result, hKernel, pCount, pAllocationProperties); + return logAndPropagateResult_zeGraphDestroyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + 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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeMemGetIpcHandleWithProperties(hContext, ptr, pNext, pIpcHandle)"); + context.logger->log_trace("zeCommandListAppendHostFunction(hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; + auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; - if( nullptr == pfnGetIpcHandleWithProperties ) - return logAndPropagateResult_zeMemGetIpcHandleWithProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pNext, pIpcHandle); + if( nullptr == pfnAppendHostFunction ) + return logAndPropagateResult_zeCommandListAppendHostFunction(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -15840,18 +17723,18 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + auto driver_result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesEpilogue( hContext, ptr, pNext, pIpcHandle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionEpilogue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeMemGetIpcHandleWithProperties(driver_result, hContext, ptr, pNext, pIpcHandle); + return logAndPropagateResult_zeCommandListAppendHostFunction(driver_result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// @@ -17763,6 +19646,49 @@ namespace validation_layer return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(driver_result, hCommandList, desc); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsMutableExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + context.logger->log_trace("zeCommandListIsMutableExp(hCommandList, pIsMutable)"); + + auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + + if( nullptr == pfnIsMutableExp ) + return logAndPropagateResult_zeCommandListIsMutableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pIsMutable); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + } + + auto driver_result = pfnIsMutableExp( hCommandList, pIsMutable ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpEpilogue( hCommandList, pIsMutable ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + } + + return logAndPropagateResult_zeCommandListIsMutableExp(driver_result, hCommandList, pIsMutable); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL @@ -18018,6 +19944,96 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.ExecutableGraph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (validation_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; + pDdiTable->pfnGetSourceGraphExt = validation_layer::zeExecutableGraphGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeExecutableGraphDestroyExt; + } + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.Graph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (validation_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeGraphCreateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; + pDdiTable->pfnGetPrimaryCommandListExt = validation_layer::zeGraphGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; + pDdiTable->pfnSetDestructionCallbackExt = validation_layer::zeGraphSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; + pDdiTable->pfnInstantiateExt = validation_layer::zeGraphInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; + pDdiTable->pfnIsEmptyExt = validation_layer::zeGraphIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; + pDdiTable->pfnDumpContentsExt = validation_layer::zeGraphDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeGraphDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -18404,6 +20420,10 @@ zeGetDeviceProcAddrTable( dditable.pfnValidateRuntimeRequirements = pDdiTable->pfnValidateRuntimeRequirements; pDdiTable->pfnValidateRuntimeRequirements = validation_layer::zeDeviceValidateRuntimeRequirements; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetCounterBasedEventMaxValue = pDdiTable->pfnGetCounterBasedEventMaxValue; + pDdiTable->pfnGetCounterBasedEventMaxValue = validation_layer::zeDeviceGetCounterBasedEventMaxValue; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; @@ -18557,6 +20577,18 @@ zeGetCommandQueueProcAddrTable( dditable.pfnSynchronize = pDdiTable->pfnSynchronize; pDdiTable->pfnSynchronize = validation_layer::zeCommandQueueSynchronize; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = validation_layer::zeCommandQueueGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetMode = pDdiTable->pfnGetMode; + pDdiTable->pfnGetMode = validation_layer::zeCommandQueueGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPriority = pDdiTable->pfnGetPriority; + pDdiTable->pfnGetPriority = validation_layer::zeCommandQueueGetPriority; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; @@ -18724,6 +20756,50 @@ zeGetCommandListProcAddrTable( dditable.pfnImmediateAppendCommandListsWithParameters = pDdiTable->pfnImmediateAppendCommandListsWithParameters; pDdiTable->pfnImmediateAppendCommandListsWithParameters = validation_layer::zeCommandListImmediateAppendCommandListsWithParameters; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = validation_layer::zeCommandListGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetFlags = pDdiTable->pfnImmediateGetFlags; + pDdiTable->pfnImmediateGetFlags = validation_layer::zeCommandListImmediateGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetMode = pDdiTable->pfnImmediateGetMode; + pDdiTable->pfnImmediateGetMode = validation_layer::zeCommandListImmediateGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnImmediateGetPriority = pDdiTable->pfnImmediateGetPriority; + pDdiTable->pfnImmediateGetPriority = validation_layer::zeCommandListImmediateGetPriority; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnBeginGraphCaptureExt = pDdiTable->pfnBeginGraphCaptureExt; + pDdiTable->pfnBeginGraphCaptureExt = validation_layer::zeCommandListBeginGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnBeginCaptureIntoGraphExt = pDdiTable->pfnBeginCaptureIntoGraphExt; + pDdiTable->pfnBeginCaptureIntoGraphExt = validation_layer::zeCommandListBeginCaptureIntoGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsGraphCaptureEnabledExt = pDdiTable->pfnIsGraphCaptureEnabledExt; + pDdiTable->pfnIsGraphCaptureEnabledExt = validation_layer::zeCommandListIsGraphCaptureEnabledExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnEndGraphCaptureExt = pDdiTable->pfnEndGraphCaptureExt; + pDdiTable->pfnEndGraphCaptureExt = validation_layer::zeCommandListEndGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetGraphExt = pDdiTable->pfnGetGraphExt; + pDdiTable->pfnGetGraphExt = validation_layer::zeCommandListGetGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnAppendGraphExt = pDdiTable->pfnAppendGraphExt; + pDdiTable->pfnAppendGraphExt = validation_layer::zeCommandListAppendGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnAppendHostFunction = pDdiTable->pfnAppendHostFunction; + pDdiTable->pfnAppendHostFunction = validation_layer::zeCommandListAppendHostFunction; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; @@ -18791,6 +20867,10 @@ zeGetCommandListExpProcAddrTable( dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; pDdiTable->pfnUpdateMutableCommandKernelsExp = validation_layer::zeCommandListUpdateMutableCommandKernelsExp; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsMutableExp = pDdiTable->pfnIsMutableExp; + pDdiTable->pfnIsMutableExp = validation_layer::zeCommandListIsMutableExp; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; pDdiTable->pfnCreateCloneExp = validation_layer::zeCommandListCreateCloneExp; @@ -18890,6 +20970,10 @@ zeGetEventProcAddrTable( dditable.pfnCounterBasedGetDeviceAddress = pDdiTable->pfnCounterBasedGetDeviceAddress; pDdiTable->pfnCounterBasedGetDeviceAddress = validation_layer::zeEventCounterBasedGetDeviceAddress; } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetCounterBasedFlags = pDdiTable->pfnGetCounterBasedFlags; + pDdiTable->pfnGetCounterBasedFlags = validation_layer::zeEventGetCounterBasedFlags; + } if (version >= ZE_API_VERSION_1_6) { dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; pDdiTable->pfnQueryKernelTimestampsExt = validation_layer::zeEventQueryKernelTimestampsExt; diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 08e8f85b..cd1406e0 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -1789,9 +1789,11 @@ namespace validation_layer VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp( ze_result_t result, zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -4946,9 +4948,11 @@ namespace validation_layer __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { context.logger->log_trace("zetMetricGroupGetGlobalTimestampsExp(hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp)"); diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index e3d562ef..1796d71f 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -296,6 +296,9 @@ zeInitDrivers( /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. +/// - Starting from API version 1.17, any driver reporting version 1.17 or +/// later is assumed to support the ::ZE_DRIVER_DDI_HANDLES_EXT_NAME +/// extension; see ::ze_driver_ddi_handles_ext_properties_t for details. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -1841,6 +1844,11 @@ zeDeviceGetStatus( /// - The application may call this function from simultaneous threads with /// the same device handle. /// - The implementation of this function must be thread-safe. +/// - The hostTimestamp value needs to return a sample from a +/// RAW_MONOTONIC_CLOCK source that is not affected by system time changes +/// or by software adjustments to the clock. +/// - The hostTimestamp and deviceTimestamp values should be coordinated to +/// be sampled at the same time/close together /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -1865,10 +1873,15 @@ zeDeviceGetStatus( ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -2039,6 +2052,88 @@ zeDeviceGetAggregatedCopyOffloadIncrementValue( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns maximum value supported by the driver for Counter Based Events +/// created with externally managed counter storage (see +/// ::ze_event_counter_based_external_sync_allocation_desc_t and +/// ::ze_event_counter_based_external_aggregate_storage_desc_t). +/// +/// @details +/// - Value is applicable only to this specific device. +/// - User must query this value before creating a Counter Based Event with +/// externally managed counter storage and ensure that `completionValue` +/// provided in the descriptor does not exceed it. +/// - User must also ensure that any value written by the application to +/// `deviceAddress` or `hostAddress` of an externally managed counter +/// storage (including values aggregated under `deviceAddress` of +/// ::ze_event_counter_based_external_aggregate_storage_desc_t) does not +/// exceed this maximum at any point in time. +/// - Driver does not validate values written by the user to externally +/// managed memory; exceeding this maximum results in undefined behavior. +/// - ::zeEventCounterBasedCreate returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// if the descriptor specifies a value greater than the value returned by +/// this query. +/// +/// @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 == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == maxValue` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Provided invalid hDevice or maxValue pointer +ze_result_t ZE_APICALL +zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based 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_pfnDeviceGetCounterBasedEventMaxValue_t pfnGetCounterBasedEventMaxValue = [&result] { + auto pfnGetCounterBasedEventMaxValue = ze_lib::context->zeDdiTable.load()->Device.pfnGetCounterBasedEventMaxValue; + if( nullptr == pfnGetCounterBasedEventMaxValue ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetCounterBasedEventMaxValue; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetCounterBasedEventMaxValue = ze_lib::context->zeDdiTable.load()->Device.pfnGetCounterBasedEventMaxValue; + if( nullptr == pfnGetCounterBasedEventMaxValue ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Gathers null-terminated plain text representation of runtime /// requirements for provided object. @@ -2988,6 +3083,198 @@ zeCommandQueueGetIndex( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue creation flags. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +ze_result_t ZE_APICALL +zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandQueueGetFlags_t pfnGetFlags = [&result] { + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetFlags; + if( nullptr == pfnGetFlags ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetFlags; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetFlags( hCmdQueue, pFlags ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetFlags; + if( nullptr == pfnGetFlags ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetFlags( hCmdQueue, pFlags ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue operation mode. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMode` +ze_result_t ZE_APICALL +zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandQueueGetMode_t pfnGetMode = [&result] { + auto pfnGetMode = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetMode; + if( nullptr == pfnGetMode ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetMode; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetMode( hCmdQueue, pMode ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetMode = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetMode; + if( nullptr == pfnGetMode ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetMode( hCmdQueue, pMode ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets command queue priority. +/// +/// @details +/// - 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 == hCmdQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pPriority` +ze_result_t ZE_APICALL +zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandQueueGetPriority_t pfnGetPriority = [&result] { + auto pfnGetPriority = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetPriority; + if( nullptr == pfnGetPriority ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetPriority; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetPriority( hCmdQueue, pPriority ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetPriority = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnGetPriority; + if( nullptr == pfnGetPriority ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetPriority( hCmdQueue, pPriority ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Creates a command list on the context. /// @@ -3833,27 +4120,12 @@ zeCommandListIsImmediate( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends an execution and global memory barrier into a command list. +/// @brief Gets command list creation flags. /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - If numWaitEvents is zero, then all previous commands, enqueued on same -/// command queue, must complete prior to the execution of the barrier. -/// This is not the case when numWaitEvents is non-zero. -/// - If numWaitEvents is non-zero, then only all phWaitEvents must be -/// signaled prior to the execution of the barrier. -/// - This command blocks all following commands from beginning until the -/// execution of the barrier completes. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **vkCmdPipelineBarrier** -/// - clEnqueueBarrierWithWaitList -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -3870,17 +4142,12 @@ zeCommandListIsImmediate( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` ze_result_t ZE_APICALL -zeCommandListAppendBarrier( +zeCommandListGetFlags( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3888,49 +4155,42 @@ zeCommandListAppendBarrier( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendBarrier_t pfnAppendBarrier = [&result] { - auto pfnAppendBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendBarrier; - if( nullptr == pfnAppendBarrier ) { + static const ze_pfnCommandListGetFlags_t pfnGetFlags = [&result] { + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetFlags; + if( nullptr == pfnGetFlags ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendBarrier; + return pfnGetFlags; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetFlags( hCommandList, pFlags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendBarrier; - if( nullptr == pfnAppendBarrier ) { + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetFlags; + if( nullptr == pfnGetFlags ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetFlags( hCommandList, pFlags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a global memory ranges barrier into a command list. +/// @brief Gets immediate command list command queue flags. /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - If numWaitEvents is zero, then all previous commands are completed -/// prior to the execution of the barrier. -/// - If numWaitEvents is non-zero, then then all phWaitEvents must be -/// signaled prior to the execution of the barrier. -/// - This command blocks all following commands from beginning until the -/// execution of the barrier completes. -/// - 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 application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3938,7 +4198,6 @@ zeCommandListAppendBarrier( /// - ::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 @@ -3949,22 +4208,13 @@ zeCommandListAppendBarrier( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRangeSizes` -/// + `nullptr == pRanges` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pFlags` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeCommandListAppendMemoryRangesBarrier( +zeCommandListImmediateGetFlags( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numRanges, ///< [in] number of memory ranges - const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range - const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3972,44 +4222,40 @@ zeCommandListAppendMemoryRangesBarrier( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryRangesBarrier_t pfnAppendMemoryRangesBarrier = [&result] { - auto pfnAppendMemoryRangesBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryRangesBarrier; - if( nullptr == pfnAppendMemoryRangesBarrier ) { + static const ze_pfnCommandListImmediateGetFlags_t pfnImmediateGetFlags = [&result] { + auto pfnImmediateGetFlags = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetFlags; + if( nullptr == pfnImmediateGetFlags ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryRangesBarrier; + return pfnImmediateGetFlags; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnImmediateGetFlags( hCommandList, pFlags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryRangesBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryRangesBarrier; - if( nullptr == pfnAppendMemoryRangesBarrier ) { + auto pfnImmediateGetFlags = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetFlags; + if( nullptr == pfnImmediateGetFlags ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnImmediateGetFlags( hCommandList, pFlags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Ensures in-bound writes to the device are globally observable. +/// @brief Gets immediate command list command queue mode. /// /// @details -/// - This is a special-case system level barrier that can be used to ensure -/// global observability of writes; -/// typically needed after a producer (e.g., NIC) performs direct writes -/// to the device's memory (e.g., Direct RDMA writes). -/// This is typically required when the memory corresponding to the writes -/// is subsequently accessed from a remote device. +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -4019,7 +4265,6 @@ zeCommandListAppendMemoryRangesBarrier( /// - ::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 @@ -4028,12 +4273,15 @@ zeCommandListAppendMemoryRangesBarrier( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMode` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeContextSystemBarrier( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice ///< [in] handle of the device +zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4041,65 +4289,49 @@ zeContextSystemBarrier( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnContextSystemBarrier_t pfnSystemBarrier = [&result] { - auto pfnSystemBarrier = ze_lib::context->zeDdiTable.load()->Context.pfnSystemBarrier; - if( nullptr == pfnSystemBarrier ) { + static const ze_pfnCommandListImmediateGetMode_t pfnImmediateGetMode = [&result] { + auto pfnImmediateGetMode = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetMode; + if( nullptr == pfnImmediateGetMode ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSystemBarrier; + return pfnImmediateGetMode; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSystemBarrier( hContext, hDevice ); + return pfnImmediateGetMode( hCommandList, pMode ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSystemBarrier = ze_lib::context->zeDdiTable.load()->Context.pfnSystemBarrier; - if( nullptr == pfnSystemBarrier ) { + auto pfnImmediateGetMode = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetMode; + if( nullptr == pfnImmediateGetMode ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSystemBarrier( hContext, hDevice ); + return pfnImmediateGetMode( hCommandList, pMode ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies host, device, or shared memory. +/// @brief Gets immediate command list command queue priority. /// /// @details -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. -/// - 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, -/// and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **clEnqueueCopyBuffer** -/// - **clEnqueueReadBuffer** -/// - **clEnqueueWriteBuffer** -/// - **clEnqueueSVMMemcpy** -/// /// @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 @@ -4110,22 +4342,13 @@ zeContextSystemBarrier( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pPriority` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeCommandListAppendMemoryCopy( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4133,57 +4356,55 @@ zeCommandListAppendMemoryCopy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryCopy_t pfnAppendMemoryCopy = [&result] { - auto pfnAppendMemoryCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopy; - if( nullptr == pfnAppendMemoryCopy ) { + static const ze_pfnCommandListImmediateGetPriority_t pfnImmediateGetPriority = [&result] { + auto pfnImmediateGetPriority = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetPriority; + if( nullptr == pfnImmediateGetPriority ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopy; + return pfnImmediateGetPriority; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnImmediateGetPriority( hCommandList, pPriority ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopy; - if( nullptr == pfnAppendMemoryCopy ) { + auto pfnImmediateGetPriority = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateGetPriority; + if( nullptr == pfnImmediateGetPriority ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnImmediateGetPriority( hCommandList, pPriority ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies host, device, or shared memory with additional parameters. +/// @brief Appends an execution and global memory barrier into a command list. /// /// @details -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. /// - 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, -/// and the memory was allocated, on the same context. +/// - If numWaitEvents is zero, then all previous commands, enqueued on same +/// command queue, must complete prior to the execution of the barrier. +/// This is not the case when numWaitEvents is non-zero. +/// - If numWaitEvents is non-zero, then only all phWaitEvents must be +/// signaled prior to the execution of the barrier. +/// - This command blocks all following commands from beginning until the +/// execution of the barrier completes. /// - 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. /// /// @remarks /// _Analogues_ -/// - **clEnqueueCopyBuffer** -/// - **clEnqueueReadBuffer** -/// - **clEnqueueWriteBuffer** -/// - **clEnqueueSVMMemcpy** +/// - **vkCmdPipelineBarrier** +/// - clEnqueueBarrierWithWaitList /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4192,6 +4413,7 @@ zeCommandListAppendMemoryCopy( /// - ::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 @@ -4200,26 +4422,17 @@ zeCommandListAppendMemoryCopy( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` -/// + `nullptr == srcptr` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeCommandListAppendMemoryCopyWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - size_t size, ///< [in] size in bytes to copy - const void* pNext, ///< [in][optional] additional extensions passed to the function +zeCommandListAppendBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ///< on before executing barrier ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4227,62 +4440,50 @@ zeCommandListAppendMemoryCopyWithParameters( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryCopyWithParameters_t pfnAppendMemoryCopyWithParameters = [&result] { - auto pfnAppendMemoryCopyWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyWithParameters; - if( nullptr == pfnAppendMemoryCopyWithParameters ) { + static const ze_pfnCommandListAppendBarrier_t pfnAppendBarrier = [&result] { + auto pfnAppendBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendBarrier; + if( nullptr == pfnAppendBarrier ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyWithParameters; + return pfnAppendBarrier; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryCopyWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyWithParameters; - if( nullptr == pfnAppendMemoryCopyWithParameters ) { + auto pfnAppendBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendBarrier; + if( nullptr == pfnAppendBarrier ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Initializes host, device, or shared memory. +/// @brief Appends a global memory ranges barrier into a command list. /// /// @details -/// - The application must ensure the memory pointed to by ptr is accessible -/// by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by ptr as it -/// is free to be modified by either the Host or device up until -/// execution. -/// - The ptr must be aligned to pattern_size -/// - The value to initialize memory to is described by the pattern and the -/// pattern size. -/// - The pattern size must be a power-of-two and less than or equal to the -/// `maxMemoryFillPatternSize` member of -/// ::ze_command_queue_group_properties_t. /// - 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, -/// and the memory was allocated, on the same context. +/// - If numWaitEvents is zero, then all previous commands are completed +/// prior to the execution of the barrier. +/// - If numWaitEvents is non-zero, then then all phWaitEvents must be +/// signaled prior to the execution of the barrier. +/// - This command blocks all following commands from beginning until the +/// execution of the barrier completes. /// - 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. /// -/// @remarks -/// _Analogues_ -/// - **clEnqueueFillBuffer** -/// - **clEnqueueSVMMemFill** -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4300,24 +4501,22 @@ zeCommandListAppendMemoryCopyWithParameters( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pattern` +/// + `nullptr == pRangeSizes` +/// + `nullptr == pRanges` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendMemoryFill( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* ptr, ///< [in] pointer to memory to initialize - const void* pattern, ///< [in] pointer to value to initialize memory to - size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to - size_t size, ///< [in] size in bytes to initialize +zeCommandListAppendMemoryRangesBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numRanges, ///< [in] number of memory ranges + const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range + const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ///< on before executing barrier ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4325,62 +4524,47 @@ zeCommandListAppendMemoryFill( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryFill_t pfnAppendMemoryFill = [&result] { - auto pfnAppendMemoryFill = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFill; - if( nullptr == pfnAppendMemoryFill ) { + static const ze_pfnCommandListAppendMemoryRangesBarrier_t pfnAppendMemoryRangesBarrier = [&result] { + auto pfnAppendMemoryRangesBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryRangesBarrier; + if( nullptr == pfnAppendMemoryRangesBarrier ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryFill; + return pfnAppendMemoryRangesBarrier; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryFill = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFill; - if( nullptr == pfnAppendMemoryFill ) { + auto pfnAppendMemoryRangesBarrier = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryRangesBarrier; + if( nullptr == pfnAppendMemoryRangesBarrier ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Initializes host, device, or shared memory with additional parameters. +/// @brief Ensures in-bound writes to the device are globally observable. /// /// @details -/// - The application must ensure the memory pointed to by ptr is accessible -/// by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by ptr as it -/// is free to be modified by either the Host or device up until -/// execution. -/// - The ptr must be aligned to pattern_size. -/// - The value to initialize memory to is described by the pattern and the -/// pattern size. -/// - The pattern size must be a power-of-two and less than or equal to the -/// `maxMemoryFillPatternSize` member of -/// ::ze_command_queue_group_properties_t. -/// - 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, -/// and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - This is a special-case system level barrier that can be used to ensure +/// global observability of writes; +/// typically needed after a producer (e.g., NIC) performs direct writes +/// to the device's memory (e.g., Direct RDMA writes). +/// This is typically required when the memory corresponding to the writes +/// is subsequently accessed from a remote device. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **clEnqueueFillBuffer** -/// - **clEnqueueSVMMemFill** -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4388,6 +4572,7 @@ zeCommandListAppendMemoryFill( /// - ::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 @@ -4395,29 +4580,12 @@ zeCommandListAppendMemoryFill( /// - ::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 == ptr` -/// + `nullptr == pattern` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported +/// + `nullptr == hContext` +/// + `nullptr == hDevice` ze_result_t ZE_APICALL -zeCommandListAppendMemoryFillWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* ptr, ///< [in] pointer to memory to initialize - const void* pattern, ///< [in] pointer to value to initialize memory to - size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to - size_t size, ///< [in] size in bytes to initialize - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeContextSystemBarrier( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice ///< [in] handle of the device ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4425,37 +4593,36 @@ zeCommandListAppendMemoryFillWithParameters( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryFillWithParameters_t pfnAppendMemoryFillWithParameters = [&result] { - auto pfnAppendMemoryFillWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFillWithParameters; - if( nullptr == pfnAppendMemoryFillWithParameters ) { + static const ze_pfnContextSystemBarrier_t pfnSystemBarrier = [&result] { + auto pfnSystemBarrier = ze_lib::context->zeDdiTable.load()->Context.pfnSystemBarrier; + if( nullptr == pfnSystemBarrier ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryFillWithParameters; + return pfnSystemBarrier; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSystemBarrier( hContext, hDevice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryFillWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFillWithParameters; - if( nullptr == pfnAppendMemoryFillWithParameters ) { + auto pfnSystemBarrier = ze_lib::context->zeDdiTable.load()->Context.pfnSystemBarrier; + if( nullptr == pfnSystemBarrier ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSystemBarrier( hContext, hDevice ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a region from a 2D or 3D array of host, device, or shared -/// memory. +/// @brief Copies host, device, or shared memory. /// /// @details /// - The application must ensure the memory pointed to by dstptr and srcptr @@ -4463,9 +4630,6 @@ zeCommandListAppendMemoryFillWithParameters( /// - The implementation must not access the memory pointed to by dstptr and /// srcptr as they are free to be modified by either the Host or device up /// until execution. -/// - The region width, height, and depth for both src and dst must be same. -/// The origins can be different. -/// - The src and dst regions cannot be overlapping. /// - 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, @@ -4474,6 +4638,13 @@ zeCommandListAppendMemoryFillWithParameters( /// threads with the same command list handle. /// - The implementation of this function should be lock-free. /// +/// @remarks +/// _Analogues_ +/// - **clEnqueueCopyBuffer** +/// - **clEnqueueReadBuffer** +/// - **clEnqueueWriteBuffer** +/// - **clEnqueueSVMMemcpy** +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4492,28 +4663,16 @@ zeCommandListAppendMemoryFillWithParameters( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == dstptr` -/// + `nullptr == dstRegion` /// + `nullptr == srcptr` -/// + `nullptr == srcRegion` -/// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendMemoryCopyRegion( +zeCommandListAppendMemoryCopy( ze_command_list_handle_t hCommandList, ///< [in] handle of command list void* dstptr, ///< [in] pointer to destination memory to copy to - const ze_copy_region_t* dstRegion, ///< [in] pointer to destination region to copy to - uint32_t dstPitch, ///< [in] destination pitch in bytes - uint32_t dstSlicePitch, ///< [in] destination slice pitch in bytes. This is required for 3D region - ///< copies where the `depth` member of ::ze_copy_region_t is not 0, - ///< otherwise it's ignored. const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_copy_region_t* srcRegion, ///< [in] pointer to source region to copy from - uint32_t srcPitch, ///< [in] source pitch in bytes - uint32_t srcSlicePitch, ///< [in] source slice pitch in bytes. This is required for 3D region - ///< copies where the `depth` member of ::ze_copy_region_t is not 0, - ///< otherwise it's ignored. + size_t size, ///< [in] size in bytes to copy ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4526,39 +4685,38 @@ zeCommandListAppendMemoryCopyRegion( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryCopyRegion_t pfnAppendMemoryCopyRegion = [&result] { - auto pfnAppendMemoryCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyRegion; - if( nullptr == pfnAppendMemoryCopyRegion ) { + static const ze_pfnCommandListAppendMemoryCopy_t pfnAppendMemoryCopy = [&result] { + auto pfnAppendMemoryCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopy; + if( nullptr == pfnAppendMemoryCopy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyRegion; + return pfnAppendMemoryCopy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyRegion; - if( nullptr == pfnAppendMemoryCopyRegion ) { + auto pfnAppendMemoryCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopy; + if( nullptr == pfnAppendMemoryCopy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies host, device, or shared memory from another context. +/// @brief Copies host, device, or shared memory with additional parameters. /// /// @details -/// - The current active and source context must be from the same driver. /// - The application must ensure the memory pointed to by dstptr and srcptr /// is accessible by the device on which the command list was created. /// - The implementation must not access the memory pointed to by dstptr and @@ -4572,6 +4730,13 @@ zeCommandListAppendMemoryCopyRegion( /// threads with the same command list handle. /// - The implementation of this function should be lock-free. /// +/// @remarks +/// _Analogues_ +/// - **clEnqueueCopyBuffer** +/// - **clEnqueueReadBuffer** +/// - **clEnqueueWriteBuffer** +/// - **clEnqueueSVMMemcpy** +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4579,7 +4744,6 @@ zeCommandListAppendMemoryCopyRegion( /// - ::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 @@ -4588,20 +4752,21 @@ zeCommandListAppendMemoryCopyRegion( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hContextSrc` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == dstptr` /// + `nullptr == srcptr` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeCommandListAppendMemoryCopyFromContext( +zeCommandListAppendMemoryCopyWithParameters( ze_command_list_handle_t hCommandList, ///< [in] handle of command list void* dstptr, ///< [in] pointer to destination memory to copy to - ze_context_handle_t hContextSrc, ///< [in] handle of source context object const void* srcptr, ///< [in] pointer to source memory to copy from size_t size, ///< [in] size in bytes to copy + const void* pNext, ///< [in][optional] additional extensions passed to the function ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4614,51 +4779,62 @@ zeCommandListAppendMemoryCopyFromContext( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryCopyFromContext_t pfnAppendMemoryCopyFromContext = [&result] { - auto pfnAppendMemoryCopyFromContext = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyFromContext; - if( nullptr == pfnAppendMemoryCopyFromContext ) { + static const ze_pfnCommandListAppendMemoryCopyWithParameters_t pfnAppendMemoryCopyWithParameters = [&result] { + auto pfnAppendMemoryCopyWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyWithParameters; + if( nullptr == pfnAppendMemoryCopyWithParameters ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyFromContext; + return pfnAppendMemoryCopyWithParameters; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryCopyFromContext = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyFromContext; - if( nullptr == pfnAppendMemoryCopyFromContext ) { + auto pfnAppendMemoryCopyWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyWithParameters; + if( nullptr == pfnAppendMemoryCopyWithParameters ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyWithParameters( hCommandList, dstptr, srcptr, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies an image. +/// @brief Initializes host, device, or shared memory. /// /// @details -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptors for both -/// source and destination images are the same. -/// - The application must ensure the command list, images and events were -/// created on the same context. +/// - The application must ensure the memory pointed to by ptr is accessible +/// by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by ptr as it +/// is free to be modified by either the Host or device up until +/// execution. +/// - The ptr must be aligned to pattern_size +/// - The value to initialize memory to is described by the pattern and the +/// pattern size. +/// - The pattern size must be a power-of-two and less than or equal to the +/// `maxMemoryFillPatternSize` member of +/// ::ze_command_queue_group_properties_t. +/// - The size must be a multiple of pattern size. +/// - 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, +/// and the memory was allocated, 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. /// /// @remarks /// _Analogues_ -/// - **clEnqueueCopyImage** +/// - **clEnqueueFillBuffer** +/// - **clEnqueueSVMMemFill** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4676,16 +4852,21 @@ zeCommandListAppendMemoryCopyFromContext( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` -/// + `nullptr == hSrcImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == pattern` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `size % pattern_size != 0` ze_result_t ZE_APICALL -zeCommandListAppendImageCopy( +zeCommandListAppendMemoryFill( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + void* ptr, ///< [in] pointer to memory to initialize + const void* pattern, ///< [in] pointer to value to initialize memory to + size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to + size_t size, ///< [in] size in bytes to initialize ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4698,51 +4879,63 @@ zeCommandListAppendImageCopy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopy_t pfnAppendImageCopy = [&result] { - auto pfnAppendImageCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopy; - if( nullptr == pfnAppendImageCopy ) { + static const ze_pfnCommandListAppendMemoryFill_t pfnAppendMemoryFill = [&result] { + auto pfnAppendMemoryFill = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFill; + if( nullptr == pfnAppendMemoryFill ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopy; + return pfnAppendMemoryFill; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopy; - if( nullptr == pfnAppendImageCopy ) { + auto pfnAppendMemoryFill = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFill; + if( nullptr == pfnAppendMemoryFill ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a region of an image to another image. +/// @brief Initializes host, device, or shared memory with additional parameters. /// /// @details -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The region width and height for both src and dst must be same. The -/// origins can be different. -/// - The src and dst regions cannot be overlapping. -/// - The application must ensure the image format descriptors for both -/// source and destination images are the same. -/// - The application must ensure the command list, images and events were -/// created, and the memory was allocated, on the same context. +/// - The application must ensure the memory pointed to by ptr is accessible +/// by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by ptr as it +/// is free to be modified by either the Host or device up until +/// execution. +/// - The ptr must be aligned to pattern_size. +/// - The value to initialize memory to is described by the pattern and the +/// pattern size. +/// - The pattern size must be a power-of-two and less than or equal to the +/// `maxMemoryFillPatternSize` member of +/// ::ze_command_queue_group_properties_t. +/// - The size must be a multiple of pattern size. +/// - 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, +/// and the memory was allocated, 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. /// +/// @remarks +/// _Analogues_ +/// - **clEnqueueFillBuffer** +/// - **clEnqueueSVMMemFill** +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4750,7 +4943,6 @@ zeCommandListAppendImageCopy( /// - ::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 @@ -4759,19 +4951,24 @@ zeCommandListAppendImageCopy( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` -/// + `nullptr == hSrcImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == pattern` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `size % pattern_size != 0` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeCommandListAppendImageCopyRegion( +zeCommandListAppendMemoryFillWithParameters( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + void* ptr, ///< [in] pointer to memory to initialize + const void* pattern, ///< [in] pointer to value to initialize memory to + size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to + size_t size, ///< [in] size in bytes to initialize + const void* pNext, ///< [in][optional] additional extensions passed to the function ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4784,57 +4981,55 @@ zeCommandListAppendImageCopyRegion( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopyRegion_t pfnAppendImageCopyRegion = [&result] { - auto pfnAppendImageCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyRegion; - if( nullptr == pfnAppendImageCopyRegion ) { + static const ze_pfnCommandListAppendMemoryFillWithParameters_t pfnAppendMemoryFillWithParameters = [&result] { + auto pfnAppendMemoryFillWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFillWithParameters; + if( nullptr == pfnAppendMemoryFillWithParameters ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyRegion; + return pfnAppendMemoryFillWithParameters; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyRegion; - if( nullptr == pfnAppendImageCopyRegion ) { + auto pfnAppendMemoryFillWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryFillWithParameters; + if( nullptr == pfnAppendMemoryFillWithParameters ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryFillWithParameters( hCommandList, ptr, pattern, pattern_size, size, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies from an image to device or shared memory. +/// @brief Copies a region from a 2D or 3D array of host, device, or shared +/// memory. /// /// @details -/// - The application must ensure the memory pointed to by dstptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the source -/// image is a single-planar format. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, on the same context. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - The region width, height, and depth for both src and dst must be same. +/// The origins can be different. +/// - The src and dst regions cannot be overlapping. +/// - 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, +/// and the memory was allocated, 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. /// -/// @remarks -/// _Analogues_ -/// - clEnqueueReadImage -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4851,18 +5046,30 @@ zeCommandListAppendImageCopyRegion( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hSrcImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == dstptr` +/// + `nullptr == dstRegion` +/// + `nullptr == srcptr` +/// + `nullptr == srcRegion` +/// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendImageCopyToMemory( +zeCommandListAppendMemoryCopyRegion( ze_command_list_handle_t hCommandList, ///< [in] handle of command list void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + const ze_copy_region_t* dstRegion, ///< [in] pointer to destination region to copy to + uint32_t dstPitch, ///< [in] destination pitch in bytes + uint32_t dstSlicePitch, ///< [in] destination slice pitch in bytes. This is required for 3D region + ///< copies where the `depth` member of ::ze_copy_region_t is not 0, + ///< otherwise it's ignored. + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_copy_region_t* srcRegion, ///< [in] pointer to source region to copy from + uint32_t srcPitch, ///< [in] source pitch in bytes + uint32_t srcSlicePitch, ///< [in] source slice pitch in bytes. This is required for 3D region + ///< copies where the `depth` member of ::ze_copy_region_t is not 0, + ///< otherwise it's ignored. ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4875,57 +5082,52 @@ zeCommandListAppendImageCopyToMemory( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopyToMemory_t pfnAppendImageCopyToMemory = [&result] { - auto pfnAppendImageCopyToMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemory; - if( nullptr == pfnAppendImageCopyToMemory ) { + static const ze_pfnCommandListAppendMemoryCopyRegion_t pfnAppendMemoryCopyRegion = [&result] { + auto pfnAppendMemoryCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyRegion; + if( nullptr == pfnAppendMemoryCopyRegion ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyToMemory; + return pfnAppendMemoryCopyRegion; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyToMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemory; - if( nullptr == pfnAppendImageCopyToMemory ) { + auto pfnAppendMemoryCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyRegion; + if( nullptr == pfnAppendMemoryCopyRegion ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies to an image from device or shared memory. +/// @brief Copies host, device, or shared memory from another context. /// /// @details -/// - The application must ensure the memory pointed to by srcptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by srcptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the -/// destination image is a single-planar format. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, on the same context. +/// - The current active and source context must be from the same driver. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - 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, +/// and the memory was allocated, 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. /// -/// @remarks -/// _Analogues_ -/// - clEnqueueWriteImage -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -4942,18 +5144,20 @@ zeCommandListAppendImageCopyToMemory( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` +/// + `nullptr == hContextSrc` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == dstptr` /// + `nullptr == srcptr` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendImageCopyFromMemory( +zeCommandListAppendMemoryCopyFromContext( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_context_handle_t hContextSrc, ///< [in] handle of source context object const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + size_t size, ///< [in] size in bytes to copy ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -4966,62 +5170,51 @@ zeCommandListAppendImageCopyFromMemory( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopyFromMemory_t pfnAppendImageCopyFromMemory = [&result] { - auto pfnAppendImageCopyFromMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemory; - if( nullptr == pfnAppendImageCopyFromMemory ) { + static const ze_pfnCommandListAppendMemoryCopyFromContext_t pfnAppendMemoryCopyFromContext = [&result] { + auto pfnAppendMemoryCopyFromContext = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyFromContext; + if( nullptr == pfnAppendMemoryCopyFromContext ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyFromMemory; + return pfnAppendMemoryCopyFromContext; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyFromMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemory; - if( nullptr == pfnAppendImageCopyFromMemory ) { + auto pfnAppendMemoryCopyFromContext = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryCopyFromContext; + if( nullptr == pfnAppendMemoryCopyFromContext ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Asynchronously prefetches shared memory to the device associated with -/// the specified command list +/// @brief Copies an image. /// /// @details -/// - This is a hint to improve performance only and is not required for -/// correctness. -/// - Only prefetching to the device associated with the specified command -/// list is supported. -/// Prefetching to the host or to a peer device is not supported. -/// - Prefetching may not be supported for all allocation types for all devices. -/// If memory prefetching is not supported for the specified memory range -/// the prefetch hint may be ignored. -/// - Prefetching may only be supported at a device-specific granularity, -/// such as at a page boundary. -/// In this case, the memory range may be expanded such that the start and -/// end of the range satisfy granularity requirements. -/// - The application must ensure the memory pointed to by ptr is accessible -/// by the device on which the command list was created. -/// - The application must ensure the command list was created, and the -/// memory was allocated, on the same context. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptors for both +/// source and destination images are the same. +/// - The application must ensure the command list, images 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. /// /// @remarks /// _Analogues_ -/// - clEnqueueSVMMigrateMem +/// - **clEnqueueCopyImage** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5039,13 +5232,21 @@ zeCommandListAppendImageCopyFromMemory( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` +/// + `nullptr == hDstImage` +/// + `nullptr == hSrcImage` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendMemoryPrefetch( +zeCommandListAppendImageCopy( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - const void* ptr, ///< [in] pointer to start of the memory range to prefetch - size_t size ///< [in] size in bytes of the memory range to prefetch + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5053,56 +5254,49 @@ zeCommandListAppendMemoryPrefetch( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemoryPrefetch_t pfnAppendMemoryPrefetch = [&result] { - auto pfnAppendMemoryPrefetch = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryPrefetch; - if( nullptr == pfnAppendMemoryPrefetch ) { + static const ze_pfnCommandListAppendImageCopy_t pfnAppendImageCopy = [&result] { + auto pfnAppendImageCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopy; + if( nullptr == pfnAppendImageCopy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryPrefetch; + return pfnAppendImageCopy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemoryPrefetch( hCommandList, ptr, size ); + return pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemoryPrefetch = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryPrefetch; - if( nullptr == pfnAppendMemoryPrefetch ) { + auto pfnAppendImageCopy = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopy; + if( nullptr == pfnAppendImageCopy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemoryPrefetch( hCommandList, ptr, size ); + return pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Provides advice about the use of a shared memory range +/// @brief Copies a region of an image to another image. /// /// @details -/// - Memory advice is a performance hint only and is not required for -/// functional correctness. -/// - Memory advice can be used to override driver heuristics to explicitly -/// control shared memory behavior. -/// - Not all memory advice hints may be supported for all allocation types -/// for all devices. -/// If a memory advice hint is not supported by the device it will be ignored. -/// - Memory advice may only be supported at a device-specific granularity, -/// such as at a page boundary. -/// In this case, the memory range may be expanded such that the start and -/// end of the range satisfy granularity requirements. -/// - The application must ensure the memory pointed to by ptr is accessible -/// by the device on which the command list was created. -/// - The application must ensure the command list was created, and memory -/// was allocated, on the same context. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The region width and height for both src and dst must be same. The +/// origins can be different. +/// - The src and dst regions cannot be overlapping. +/// - The application must ensure the image format descriptors for both +/// source and destination images are the same. +/// - The application must ensure the command list, images and events were +/// created, and the memory was allocated, on the same context. /// - The application must **not** call this function from simultaneous -/// threads with the same command list handle, and the memory was -/// allocated. +/// threads with the same command list handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -5121,19 +5315,24 @@ zeCommandListAppendMemoryPrefetch( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION < advice` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hDstImage` +/// + `nullptr == hSrcImage` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendMemAdvise( +zeCommandListAppendImageCopyRegion( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_advice_t advice ///< [in] Memory advice for the memory range + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5141,45 +5340,59 @@ zeCommandListAppendMemAdvise( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendMemAdvise_t pfnAppendMemAdvise = [&result] { - auto pfnAppendMemAdvise = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemAdvise; - if( nullptr == pfnAppendMemAdvise ) { + static const ze_pfnCommandListAppendImageCopyRegion_t pfnAppendImageCopyRegion = [&result] { + auto pfnAppendImageCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyRegion; + if( nullptr == pfnAppendImageCopyRegion ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemAdvise; + return pfnAppendImageCopyRegion; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); + return pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMemAdvise = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemAdvise; - if( nullptr == pfnAppendMemAdvise ) { + auto pfnAppendImageCopyRegion = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyRegion; + if( nullptr == pfnAppendImageCopyRegion ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); + return pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a pool of events on the context. +/// @brief Copies from an image to device or shared memory. /// /// @details -/// - The application must only use events within the pool for the -/// device(s), or their sub-devices, which were provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS +/// - The application must ensure the memory pointed to by dstptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the source +/// image is a single-planar format. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, 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. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueReadImage +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -5193,27 +5406,24 @@ zeCommandListAppendMemAdvise( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hCommandList` +/// + `nullptr == hSrcImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phEventPool` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xf < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `0 == desc->count` -/// + `(nullptr == phDevices) && (0 < numDevices)` +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeEventPoolCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_event_pool_desc_t* desc, ///< [in] pointer to event pool descriptor - uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == - ///< phDevices` - ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which - ///< have visibility to the event pool. - ///< if nullptr, then event pool is visible to all devices supported by the - ///< driver instance. - ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created +zeCommandListAppendImageCopyToMemory( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5221,47 +5431,56 @@ zeEventPoolCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->EventPool.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnCommandListAppendImageCopyToMemory_t pfnAppendImageCopyToMemory = [&result] { + auto pfnAppendImageCopyToMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemory; + if( nullptr == pfnAppendImageCopyToMemory ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnAppendImageCopyToMemory; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); + return pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->EventPool.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnAppendImageCopyToMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemory; + if( nullptr == pfnAppendImageCopyToMemory ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); + return pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Deletes an event pool object. +/// @brief Copies to an image from device or shared memory. /// /// @details -/// - The application must destroy all event handles created from the pool -/// before destroying the pool itself. -/// - The application must ensure the device is not currently referencing -/// the any event within the pool before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this event pool. +/// - The application must ensure the memory pointed to by srcptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by srcptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the +/// destination image is a single-planar format. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, on the same context. /// - The application must **not** call this function from simultaneous -/// threads with the same event pool handle. -/// - The implementation of this function must be thread-safe. +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueWriteImage /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5278,11 +5497,24 @@ zeEventPoolCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEventPool` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hCommandList` +/// + `nullptr == hDstImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeEventPoolDestroy( - ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy +zeCommandListAppendImageCopyFromMemory( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5290,50 +5522,62 @@ zeEventPoolDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->EventPool.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnCommandListAppendImageCopyFromMemory_t pfnAppendImageCopyFromMemory = [&result] { + auto pfnAppendImageCopyFromMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemory; + if( nullptr == pfnAppendImageCopyFromMemory ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnAppendImageCopyFromMemory; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hEventPool ); + return pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->EventPool.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnAppendImageCopyFromMemory = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemory; + if( nullptr == pfnAppendImageCopyFromMemory ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hEventPool ); + return pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an event from the pool. +/// @brief Asynchronously prefetches shared memory to the device associated with +/// the specified command list /// /// @details -/// - An event is used to communicate fine-grain host-to-device, -/// device-to-host or device-to-device dependencies have completed. -/// - The application must ensure the location in the pool is not being used -/// by another event. +/// - This is a hint to improve performance only and is not required for +/// correctness. +/// - Only prefetching to the device associated with the specified command +/// list is supported. +/// Prefetching to the host or to a peer device is not supported. +/// - Prefetching may not be supported for all allocation types for all devices. +/// If memory prefetching is not supported for the specified memory range +/// the prefetch hint may be ignored. +/// - Prefetching may only be supported at a device-specific granularity, +/// such as at a page boundary. +/// In this case, the memory range may be expanded such that the start and +/// end of the range satisfy granularity requirements. +/// - The application must ensure the memory pointed to by ptr is accessible +/// by the device on which the command list was created. +/// - The application must ensure the command list was created, and the +/// memory was allocated, on the same context. /// - The application must **not** call this function from simultaneous -/// threads with the same event pool handle. +/// threads with the same command list handle. /// - The implementation of this function should be lock-free. /// /// @remarks /// _Analogues_ -/// - **clCreateUserEvent** -/// - vkCreateEvent +/// - clEnqueueSVMMigrateMem /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5350,19 +5594,14 @@ zeEventPoolDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEventPool` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phEvent` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < desc->signal` -/// + `0x7 < desc->wait` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == ptr` ze_result_t ZE_APICALL -zeEventCreate( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - const ze_event_desc_t* desc, ///< [in] pointer to event descriptor - ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created +zeCommandListAppendMemoryPrefetch( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + const void* ptr, ///< [in] pointer to start of the memory range to prefetch + size_t size ///< [in] size in bytes of the memory range to prefetch ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5370,36 +5609,57 @@ zeEventCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnCommandListAppendMemoryPrefetch_t pfnAppendMemoryPrefetch = [&result] { + auto pfnAppendMemoryPrefetch = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryPrefetch; + if( nullptr == pfnAppendMemoryPrefetch ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnAppendMemoryPrefetch; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hEventPool, desc, phEvent ); + return pfnAppendMemoryPrefetch( hCommandList, ptr, size ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnAppendMemoryPrefetch = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemoryPrefetch; + if( nullptr == pfnAppendMemoryPrefetch ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hEventPool, desc, phEvent ); + return pfnAppendMemoryPrefetch( hCommandList, ptr, size ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates Counter Based Event +/// @brief Provides advice about the use of a shared memory range +/// +/// @details +/// - Memory advice is a performance hint only and is not required for +/// functional correctness. +/// - Memory advice can be used to override driver heuristics to explicitly +/// control shared memory behavior. +/// - Not all memory advice hints may be supported for all allocation types +/// for all devices. +/// If a memory advice hint is not supported by the device it will be ignored. +/// - Memory advice may only be supported at a device-specific granularity, +/// such as at a page boundary. +/// In this case, the memory range may be expanded such that the start and +/// end of the range satisfy granularity requirements. +/// - The application must ensure the memory pointed to by ptr is accessible +/// by the device on which the command list was created. +/// - The application must ensure the command list was created, and memory +/// was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle, and the memory was +/// allocated. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5407,6 +5667,7 @@ zeEventCreate( /// - ::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 @@ -5415,23 +5676,20 @@ zeEventCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hCommandList` /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phEvent` +/// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3f < desc->flags` -/// + `0x7 < desc->signal` -/// + `0x7 < desc->wait` +/// + `::ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION < advice` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT ze_result_t ZE_APICALL -zeEventCounterBasedCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - const ze_event_counter_based_desc_t* desc, ///< [in] pointer to counter based event descriptor - ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created +zeCommandListAppendMemAdvise( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_advice_t advice ///< [in] Memory advice for the memory range ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5439,50 +5697,42 @@ zeEventCounterBasedCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCounterBasedCreate_t pfnCounterBasedCreate = [&result] { - auto pfnCounterBasedCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCreate; - if( nullptr == pfnCounterBasedCreate ) { + static const ze_pfnCommandListAppendMemAdvise_t pfnAppendMemAdvise = [&result] { + auto pfnAppendMemAdvise = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemAdvise; + if( nullptr == pfnAppendMemAdvise ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedCreate; + return pfnAppendMemAdvise; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); + return pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCounterBasedCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCreate; - if( nullptr == pfnCounterBasedCreate ) { + auto pfnAppendMemAdvise = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendMemAdvise; + if( nullptr == pfnAppendMemAdvise ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); + return pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Deletes an event object. +/// @brief Creates a pool of events on the context. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the event before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this event. -/// - The application must **not** call this function from simultaneous -/// threads with the same event handle. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - **clReleaseEvent** -/// - vkDestroyEvent +/// - The application must only use events within the pool for the +/// device(s), or their sub-devices, which were provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5499,11 +5749,27 @@ zeEventCounterBasedCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xf < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `0 == desc->count` +/// + `(nullptr == phDevices) && (0 < numDevices)` ze_result_t ZE_APICALL -zeEventDestroy( - ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy +zeEventPoolCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_event_pool_desc_t* desc, ///< [in] pointer to event pool descriptor + uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == + ///< phDevices` + ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which + ///< have visibility to the event pool. + ///< if nullptr, then event pool is visible to all devices supported by the + ///< driver instance. + ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5511,41 +5777,47 @@ zeEventDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Event.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnEventPoolCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->EventPool.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hEvent ); + return pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Event.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->EventPool.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hEvent ); + return pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets an IPC event pool handle for the specified event handle that can -/// be shared with another process. +/// @brief Deletes an event pool object. /// /// @details -/// - Event pool must have been created with ::ZE_EVENT_POOL_FLAG_IPC. -/// - The application may call this function from simultaneous threads. +/// - The application must destroy all event handles created from the pool +/// before destroying the pool itself. +/// - The application must ensure the device is not currently referencing +/// the any event within the pool before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this event pool. +/// - The application must **not** call this function from simultaneous +/// threads with the same event pool handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5563,13 +5835,10 @@ zeEventDestroy( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEventPool` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phIpc` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeEventPoolGetIpcHandle( - ze_event_pool_handle_t hEventPool, ///< [in] handle of event pool object - ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle +zeEventPoolDestroy( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5577,50 +5846,51 @@ zeEventPoolGetIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolGetIpcHandle_t pfnGetIpcHandle = [&result] { - auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetIpcHandle; - if( nullptr == pfnGetIpcHandle ) { + static const ze_pfnEventPoolDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->EventPool.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandle; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIpcHandle( hEventPool, phIpc ); + return pfnDestroy( hEventPool ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetIpcHandle; - if( nullptr == pfnGetIpcHandle ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->EventPool.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandle( hEventPool, phIpc ); + return pfnDestroy( hEventPool ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns an IPC event pool handle to the driver +/// @brief Creates an event from the pool. /// /// @details -/// - This call must be used for IPC handles previously obtained with -/// ::zeEventPoolGetIpcHandle. -/// - Upon call, driver may release any underlying resources associated with -/// 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. -/// - This call does not destroy the original event pool for which the IPC -/// handle was created. -/// - This function may **not** be called from simultaneous threads with the -/// same IPC handle. +/// - An event is used to communicate fine-grain host-to-device, +/// device-to-host or device-to-device dependencies have completed. +/// - The application must ensure the location in the pool is not being used +/// by another event. +/// - The application must **not** call this function from simultaneous +/// threads with the same event pool handle. /// - The implementation of this function should be lock-free. /// +/// @remarks +/// _Analogues_ +/// - **clCreateUserEvent** +/// - vkCreateEvent +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -5636,12 +5906,19 @@ zeEventPoolGetIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phEvent` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < desc->signal` +/// + `0x7 < desc->wait` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeEventPoolPutIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object associated with the IPC event pool - ///< handle - ze_ipc_event_pool_handle_t hIpc ///< [in] IPC event pool handle +zeEventCreate( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + const ze_event_desc_t* desc, ///< [in] pointer to event descriptor + ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5649,56 +5926,36 @@ zeEventPoolPutIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolPutIpcHandle_t pfnPutIpcHandle = [&result] { - auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnPutIpcHandle; - if( nullptr == pfnPutIpcHandle ) { + static const ze_pfnEventCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPutIpcHandle; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnPutIpcHandle( hContext, hIpc ); + return pfnCreate( hEventPool, desc, phEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnPutIpcHandle; - if( nullptr == pfnPutIpcHandle ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPutIpcHandle( hContext, hIpc ); + return pfnCreate( hEventPool, desc, phEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Opens an IPC event pool handle to retrieve an event pool handle from -/// another process. -/// -/// @details -/// - Multiple calls to this function with the same IPC handle will return -/// unique event pool handles. -/// - The event handle in this process should not be freed with -/// ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle. -/// - If the original event pool has been created for a device containing a -/// number of sub-devices, then the event pool -/// returned by this call may be used on a device containing the same -/// number of sub-devices, or on any of -/// those sub-devices. -/// - However, if the original event pool has been created for a sub-device, -/// then the event pool returned by this call -/// cannot be used on a device containing any number of sub-devices, and -/// must be used only in a sub-device. This ensures -/// functional correctness for any implementation or optimizations the -/// underlying Level Zero driver may do on -/// event pools and events. -/// - The application may call this function from simultaneous threads. +/// @brief Creates Counter Based Event /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5706,7 +5963,6 @@ zeEventPoolPutIpcHandle( /// - ::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 @@ -5716,14 +5972,23 @@ zeEventPoolPutIpcHandle( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phEventPool` +/// + `nullptr == desc` +/// + `nullptr == phEvent` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7f < 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_result_t ZE_APICALL -zeEventPoolOpenIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event pool - ///< handle - ze_ipc_event_pool_handle_t hIpc, ///< [in] IPC event pool handle - ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created +zeEventCounterBasedCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + const ze_event_counter_based_desc_t* desc, ///< [in] pointer to counter based event descriptor + ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5731,42 +5996,50 @@ zeEventPoolOpenIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolOpenIpcHandle_t pfnOpenIpcHandle = [&result] { - auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnOpenIpcHandle; - if( nullptr == pfnOpenIpcHandle ) { + static const ze_pfnEventCounterBasedCreate_t pfnCounterBasedCreate = [&result] { + auto pfnCounterBasedCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCreate; + if( nullptr == pfnCounterBasedCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnOpenIpcHandle; + return pfnCounterBasedCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnOpenIpcHandle( hContext, hIpc, phEventPool ); + return pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnOpenIpcHandle; - if( nullptr == pfnOpenIpcHandle ) { + auto pfnCounterBasedCreate = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCreate; + if( nullptr == pfnCounterBasedCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnOpenIpcHandle( hContext, hIpc, phEventPool ); + return pfnCounterBasedCreate( hContext, hDevice, desc, phEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes an IPC event handle in the current process. +/// @brief Deletes an event object. /// /// @details -/// - Closes an IPC event handle by destroying events that were opened in -/// this process using ::zeEventPoolOpenIpcHandle. +/// - The application must ensure the device is not currently referencing +/// the event before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this event. /// - The application must **not** call this function from simultaneous -/// threads with the same event pool handle. +/// threads with the same event handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - **clReleaseEvent** +/// - vkDestroyEvent /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5783,10 +6056,11 @@ zeEventPoolOpenIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEventPool` +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeEventPoolCloseIpcHandle( - ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object +zeEventDestroy( + ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5794,44 +6068,49 @@ zeEventPoolCloseIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolCloseIpcHandle_t pfnCloseIpcHandle = [&result] { - auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnCloseIpcHandle; - if( nullptr == pfnCloseIpcHandle ) { + static const ze_pfnEventDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Event.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseIpcHandle; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCloseIpcHandle( hEventPool ); + return pfnDestroy( hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnCloseIpcHandle; - if( nullptr == pfnCloseIpcHandle ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Event.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseIpcHandle( hEventPool ); + return pfnDestroy( hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets an IPC counter based event handle that can be shared with another -/// process. +/// @brief Gets an IPC event pool handle for the specified event handle that can +/// be shared with another process. /// -/// @returns -/// - ::ZE_RESULT_SUCCESS +/// @details +/// - Event pool must have been created with ::ZE_EVENT_POOL_FLAG_IPC. +/// - 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 @@ -5840,15 +6119,14 @@ zeEventPoolCloseIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` +/// + `nullptr == hEventPool` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phIpc` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT ze_result_t ZE_APICALL -zeEventCounterBasedGetIpcHandle( - ze_event_handle_t hEvent, ///< [in] handle of event object - ze_ipc_event_counter_based_handle_t* phIpc ///< [out] Returned IPC event handle +zeEventPoolGetIpcHandle( + ze_event_pool_handle_t hEventPool, ///< [in] handle of event pool object + ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5856,36 +6134,49 @@ zeEventCounterBasedGetIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCounterBasedGetIpcHandle_t pfnCounterBasedGetIpcHandle = [&result] { - auto pfnCounterBasedGetIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetIpcHandle; - if( nullptr == pfnCounterBasedGetIpcHandle ) { + static const ze_pfnEventPoolGetIpcHandle_t pfnGetIpcHandle = [&result] { + auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedGetIpcHandle; + return pfnGetIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCounterBasedGetIpcHandle( hEvent, phIpc ); + return pfnGetIpcHandle( hEventPool, phIpc ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCounterBasedGetIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetIpcHandle; - if( nullptr == pfnCounterBasedGetIpcHandle ) { + auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedGetIpcHandle( hEvent, phIpc ); + return pfnGetIpcHandle( hEventPool, phIpc ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Opens an IPC event handle to retrieve from another process. +/// @brief Returns an IPC event pool handle to the driver +/// +/// @details +/// - This call must be used for IPC handles previously obtained with +/// ::zeEventPoolGetIpcHandle. +/// - Upon call, driver may release any underlying resources associated with +/// 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. +/// - This call does not destroy the original event pool 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5893,6 +6184,7 @@ zeEventCounterBasedGetIpcHandle( /// - ::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 @@ -5902,15 +6194,11 @@ zeEventCounterBasedGetIpcHandle( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phEvent` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT ze_result_t ZE_APICALL -zeEventCounterBasedOpenIpcHandle( - ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event +zeEventPoolPutIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object associated with the IPC event pool ///< handle - ze_ipc_event_counter_based_handle_t hIpc, ///< [in] IPC event handle - ze_event_handle_t* phEvent ///< [out] pointer handle of event object created + ze_ipc_event_pool_handle_t hIpc ///< [in] IPC event pool handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5918,36 +6206,56 @@ zeEventCounterBasedOpenIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCounterBasedOpenIpcHandle_t pfnCounterBasedOpenIpcHandle = [&result] { - auto pfnCounterBasedOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedOpenIpcHandle; - if( nullptr == pfnCounterBasedOpenIpcHandle ) { + static const ze_pfnEventPoolPutIpcHandle_t pfnPutIpcHandle = [&result] { + auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedOpenIpcHandle; + return pfnPutIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); + return pfnPutIpcHandle( hContext, hIpc ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCounterBasedOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedOpenIpcHandle; - if( nullptr == pfnCounterBasedOpenIpcHandle ) { + auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); + return pfnPutIpcHandle( hContext, hIpc ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes an IPC event handle in the current process. +/// @brief Opens an IPC event pool handle to retrieve an event pool handle from +/// another process. +/// +/// @details +/// - Multiple calls to this function with the same IPC handle will return +/// unique event pool handles. +/// - The event handle in this process should not be freed with +/// ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle. +/// - If the original event pool has been created for a device containing a +/// number of sub-devices, then the event pool +/// returned by this call may be used on a device containing the same +/// number of sub-devices, or on any of +/// those sub-devices. +/// - However, if the original event pool has been created for a sub-device, +/// then the event pool returned by this call +/// cannot be used on a device containing any number of sub-devices, and +/// must be used only in a sub-device. This ensures +/// functional correctness for any implementation or optimizations the +/// underlying Level Zero driver may do on +/// event pools and events. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5964,11 +6272,15 @@ zeEventCounterBasedOpenIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phEventPool` ze_result_t ZE_APICALL -zeEventCounterBasedCloseIpcHandle( - ze_event_handle_t hEvent ///< [in][release] handle of event object +zeEventPoolOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event pool + ///< handle + ze_ipc_event_pool_handle_t hIpc, ///< [in] IPC event pool handle + ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -5976,37 +6288,42 @@ zeEventCounterBasedCloseIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCounterBasedCloseIpcHandle_t pfnCounterBasedCloseIpcHandle = [&result] { - auto pfnCounterBasedCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCloseIpcHandle; - if( nullptr == pfnCounterBasedCloseIpcHandle ) { + static const ze_pfnEventPoolOpenIpcHandle_t pfnOpenIpcHandle = [&result] { + auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedCloseIpcHandle; + return pfnOpenIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCounterBasedCloseIpcHandle( hEvent ); + return pfnOpenIpcHandle( hContext, hIpc, phEventPool ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCounterBasedCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCloseIpcHandle; - if( nullptr == pfnCounterBasedCloseIpcHandle ) { + auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedCloseIpcHandle( hEvent ); + return pfnOpenIpcHandle( hContext, hIpc, phEventPool ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns Counter Based Event completion value (counter) and its device -/// address +/// @brief Closes an IPC event handle in the current process. +/// +/// @details +/// - Closes an IPC event handle by destroying events that were opened in +/// this process using ::zeEventPoolOpenIpcHandle. +/// - The application must **not** call this function from simultaneous +/// threads with the same event pool handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6014,6 +6331,7 @@ zeEventCounterBasedCloseIpcHandle( /// - ::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 @@ -6022,16 +6340,10 @@ zeEventCounterBasedCloseIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == completionValue` -/// + `nullptr == deviceAddress` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + `nullptr == hEventPool` ze_result_t ZE_APICALL -zeEventCounterBasedGetDeviceAddress( - ze_event_handle_t hEvent, ///< [in] handle of event object - uint64_t* completionValue, ///< [in][out] completion value - uint64_t* deviceAddress ///< [in][out] counter device address +zeEventPoolCloseIpcHandle( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6039,55 +6351,37 @@ zeEventCounterBasedGetDeviceAddress( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventCounterBasedGetDeviceAddress_t pfnCounterBasedGetDeviceAddress = [&result] { - auto pfnCounterBasedGetDeviceAddress = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetDeviceAddress; - if( nullptr == pfnCounterBasedGetDeviceAddress ) { + static const ze_pfnEventPoolCloseIpcHandle_t pfnCloseIpcHandle = [&result] { + auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedGetDeviceAddress; + return pfnCloseIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); + return pfnCloseIpcHandle( hEventPool ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCounterBasedGetDeviceAddress = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetDeviceAddress; - if( nullptr == pfnCounterBasedGetDeviceAddress ) { + auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); + return pfnCloseIpcHandle( hEventPool ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a signal of the event from the device into a command list. -/// -/// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - 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. -/// -/// @remarks -/// _Analogues_ -/// - **clSetUserEventStatus** -/// - vkCmdSetEvent +/// @brief Gets an IPC counter based event handle that can be shared with another +/// process. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6095,7 +6389,6 @@ zeEventCounterBasedGetDeviceAddress( /// - ::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 @@ -6104,13 +6397,15 @@ zeEventCounterBasedGetDeviceAddress( /// - ::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_NULL_POINTER +/// + `nullptr == phIpc` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT ze_result_t ZE_APICALL -zeCommandListAppendSignalEvent( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hEvent ///< [in] handle of the event +zeEventCounterBasedGetIpcHandle( + ze_event_handle_t hEvent, ///< [in] handle of event object + ze_ipc_event_counter_based_handle_t* phIpc ///< [out] Returned IPC event handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6118,45 +6413,53 @@ zeCommandListAppendSignalEvent( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendSignalEvent_t pfnAppendSignalEvent = [&result] { - auto pfnAppendSignalEvent = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEvent; - if( nullptr == pfnAppendSignalEvent ) { + static const ze_pfnEventCounterBasedGetIpcHandle_t pfnCounterBasedGetIpcHandle = [&result] { + auto pfnCounterBasedGetIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetIpcHandle; + if( nullptr == pfnCounterBasedGetIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalEvent; + return pfnCounterBasedGetIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendSignalEvent( hCommandList, hEvent ); + return pfnCounterBasedGetIpcHandle( hEvent, phIpc ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendSignalEvent = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEvent; - if( nullptr == pfnAppendSignalEvent ) { + auto pfnCounterBasedGetIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetIpcHandle; + if( nullptr == pfnCounterBasedGetIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalEvent( hCommandList, hEvent ); + return pfnCounterBasedGetIpcHandle( hEvent, phIpc ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends wait on event(s) on the device into a command list. +/// @brief Opens an IPC event handle to retrieve from another process. /// /// @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. +/// - 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. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6164,7 +6467,6 @@ zeCommandListAppendSignalEvent( /// - ::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 @@ -6173,16 +6475,16 @@ zeCommandListAppendSignalEvent( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phEvents` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// + `nullptr == phEvent` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT 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 - ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before - ///< continuing +zeEventCounterBasedOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event + ///< handle + ze_ipc_event_counter_based_handle_t hIpc, ///< [in] IPC event handle + ze_event_handle_t* phEvent ///< [out] pointer handle of event object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6190,49 +6492,36 @@ zeCommandListAppendWaitOnEvents( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendWaitOnEvents_t pfnAppendWaitOnEvents = [&result] { - auto pfnAppendWaitOnEvents = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEvents; - if( nullptr == pfnAppendWaitOnEvents ) { + static const ze_pfnEventCounterBasedOpenIpcHandle_t pfnCounterBasedOpenIpcHandle = [&result] { + auto pfnCounterBasedOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedOpenIpcHandle; + if( nullptr == pfnCounterBasedOpenIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitOnEvents; + return pfnCounterBasedOpenIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); + return pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendWaitOnEvents = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEvents; - if( nullptr == pfnAppendWaitOnEvents ) { + auto pfnCounterBasedOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedOpenIpcHandle; + if( nullptr == pfnCounterBasedOpenIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); + return pfnCounterBasedOpenIpcHandle( hContext, hIpc, phEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Signals a event from host. -/// -/// @details -/// - 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 may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - clSetUserEventStatus +/// @brief Closes an IPC event handle in the current process. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6252,8 +6541,8 @@ zeCommandListAppendWaitOnEvents( /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zeEventHostSignal( - ze_event_handle_t hEvent ///< [in] handle of the event +zeEventCounterBasedCloseIpcHandle( + ze_event_handle_t hEvent ///< [in][release] handle of event object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6261,44 +6550,37 @@ zeEventHostSignal( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventHostSignal_t pfnHostSignal = [&result] { - auto pfnHostSignal = ze_lib::context->zeDdiTable.load()->Event.pfnHostSignal; - if( nullptr == pfnHostSignal ) { + static const ze_pfnEventCounterBasedCloseIpcHandle_t pfnCounterBasedCloseIpcHandle = [&result] { + auto pfnCounterBasedCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCloseIpcHandle; + if( nullptr == pfnCounterBasedCloseIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSignal; + return pfnCounterBasedCloseIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnHostSignal( hEvent ); + return pfnCounterBasedCloseIpcHandle( hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnHostSignal = ze_lib::context->zeDdiTable.load()->Event.pfnHostSignal; - if( nullptr == pfnHostSignal ) { + auto pfnCounterBasedCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedCloseIpcHandle; + if( nullptr == pfnCounterBasedCloseIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSignal( hEvent ); + return pfnCounterBasedCloseIpcHandle( hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief 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. -/// -/// @remarks -/// _Analogues_ -/// - clWaitForEvents +/// @brief Returns Counter Based Event completion value (counter) and its device +/// address /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6306,7 +6588,6 @@ zeEventHostSignal( /// - ::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 @@ -6316,19 +6597,15 @@ zeEventHostSignal( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_NOT_READY -/// + timeout expired +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == completionValue` +/// + `nullptr == deviceAddress` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT ze_result_t ZE_APICALL -zeEventHostSynchronize( - ze_event_handle_t hEvent, ///< [in] handle of the event - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then operates exactly like ::zeEventQueryStatus; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. +zeEventCounterBasedGetDeviceAddress( + ze_event_handle_t hEvent, ///< [in] handle of event object + uint64_t* completionValue, ///< [in][out] completion value + uint64_t* deviceAddress ///< [in][out] counter device address ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6336,45 +6613,63 @@ zeEventHostSynchronize( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventHostSynchronize_t pfnHostSynchronize = [&result] { - auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Event.pfnHostSynchronize; - if( nullptr == pfnHostSynchronize ) { + static const ze_pfnEventCounterBasedGetDeviceAddress_t pfnCounterBasedGetDeviceAddress = [&result] { + auto pfnCounterBasedGetDeviceAddress = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetDeviceAddress; + if( nullptr == pfnCounterBasedGetDeviceAddress ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSynchronize; + return pfnCounterBasedGetDeviceAddress; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnHostSynchronize( hEvent, timeout ); + return pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Event.pfnHostSynchronize; - if( nullptr == pfnHostSynchronize ) { + auto pfnCounterBasedGetDeviceAddress = ze_lib::context->zeDdiTable.load()->Event.pfnCounterBasedGetDeviceAddress; + if( nullptr == pfnCounterBasedGetDeviceAddress ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSynchronize( hEvent, timeout ); + return pfnCounterBasedGetDeviceAddress( hEvent, completionValue, deviceAddress ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries an event object's status on the host. +/// @brief Appends a signal of the event from the device into a command list. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - 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. /// /// @remarks /// _Analogues_ -/// - **clGetEventInfo** -/// - vkGetEventStatus +/// - **clSetUserEventStatus** +/// - vkCmdSetEvent /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6391,12 +6686,12 @@ zeEventHostSynchronize( /// - ::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_NOT_READY -/// + not signaled ze_result_t ZE_APICALL -zeEventQueryStatus( +zeCommandListAppendSignalEvent( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_event_handle_t hEvent ///< [in] handle of the event ) { @@ -6405,51 +6700,50 @@ zeEventQueryStatus( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventQueryStatus_t pfnQueryStatus = [&result] { - auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Event.pfnQueryStatus; - if( nullptr == pfnQueryStatus ) { + static const ze_pfnCommandListAppendSignalEvent_t pfnAppendSignalEvent = [&result] { + auto pfnAppendSignalEvent = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEvent; + if( nullptr == pfnAppendSignalEvent ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryStatus; + return pfnAppendSignalEvent; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryStatus( hEvent ); + return pfnAppendSignalEvent( hCommandList, hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Event.pfnQueryStatus; - if( nullptr == pfnQueryStatus ) { + auto pfnAppendSignalEvent = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEvent; + if( nullptr == pfnAppendSignalEvent ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryStatus( hEvent ); + return pfnAppendSignalEvent( hCommandList, hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a reset of an event back to not signaled state into a command -/// list. +/// @brief Appends wait on event(s) on the device into a command list. /// /// @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. /// -/// @remarks -/// _Analogues_ -/// - vkResetEvent -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6466,12 +6760,15 @@ zeEventQueryStatus( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phEvents` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zeCommandListAppendEventReset( +zeCommandListAppendWaitOnEvents( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hEvent ///< [in] handle of the event + 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 @@ -6479,44 +6776,49 @@ zeCommandListAppendEventReset( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendEventReset_t pfnAppendEventReset = [&result] { - auto pfnAppendEventReset = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendEventReset; - if( nullptr == pfnAppendEventReset ) { + static const ze_pfnCommandListAppendWaitOnEvents_t pfnAppendWaitOnEvents = [&result] { + auto pfnAppendWaitOnEvents = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEvents; + if( nullptr == pfnAppendWaitOnEvents ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendEventReset; + return pfnAppendWaitOnEvents; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendEventReset( hCommandList, hEvent ); + return pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendEventReset = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendEventReset; - if( nullptr == pfnAppendEventReset ) { + auto pfnAppendWaitOnEvents = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEvents; + if( nullptr == pfnAppendWaitOnEvents ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendEventReset( hCommandList, hEvent ); + return pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief The current host thread resets an event back to not signaled state. +/// @brief Signals a event from host. /// /// @details +/// - 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 may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @remarks /// _Analogues_ -/// - vkResetEvent +/// - clSetUserEventStatus /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6536,7 +6838,7 @@ zeCommandListAppendEventReset( /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zeEventHostReset( +zeEventHostSignal( ze_event_handle_t hEvent ///< [in] handle of the event ) { @@ -6545,46 +6847,45 @@ zeEventHostReset( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventHostReset_t pfnHostReset = [&result] { - auto pfnHostReset = ze_lib::context->zeDdiTable.load()->Event.pfnHostReset; - if( nullptr == pfnHostReset ) { + static const ze_pfnEventHostSignal_t pfnHostSignal = [&result] { + auto pfnHostSignal = ze_lib::context->zeDdiTable.load()->Event.pfnHostSignal; + if( nullptr == pfnHostSignal ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostReset; + return pfnHostSignal; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnHostReset( hEvent ); + return pfnHostSignal( hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnHostReset = ze_lib::context->zeDdiTable.load()->Event.pfnHostReset; - if( nullptr == pfnHostReset ) { + auto pfnHostSignal = ze_lib::context->zeDdiTable.load()->Event.pfnHostSignal; + if( nullptr == pfnHostSignal ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostReset( hEvent ); + return pfnHostSignal( hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries an event's timestamp value on the host. +/// @brief The current host thread waits on an event to be signaled. /// /// @details -/// - The application must ensure the event was created from an event pool -/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or -/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. -/// - The destination memory will be unmodified if the event has not been -/// signaled. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// +/// @remarks +/// _Analogues_ +/// - clWaitForEvents +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6601,15 +6902,19 @@ zeEventHostReset( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_NOT_READY -/// + not signaled +/// + timeout expired ze_result_t ZE_APICALL -zeEventQueryKernelTimestamp( +zeEventHostSynchronize( ze_event_handle_t hEvent, ///< [in] handle of the event - ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then operates exactly like ::zeEventQueryStatus; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6617,55 +6922,46 @@ zeEventQueryKernelTimestamp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventQueryKernelTimestamp_t pfnQueryKernelTimestamp = [&result] { - auto pfnQueryKernelTimestamp = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestamp; - if( nullptr == pfnQueryKernelTimestamp ) { + static const ze_pfnEventHostSynchronize_t pfnHostSynchronize = [&result] { + auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Event.pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryKernelTimestamp; + return pfnHostSynchronize; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryKernelTimestamp( hEvent, dstptr ); + return pfnHostSynchronize( hEvent, timeout ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryKernelTimestamp = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestamp; - if( nullptr == pfnQueryKernelTimestamp ) { + auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Event.pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryKernelTimestamp( hEvent, dstptr ); + return pfnHostSynchronize( hEvent, timeout ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a query of an events' timestamp value(s) into a command list. +/// @brief Queries an event object's status on the 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 events were created from an event pool -/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. -/// - The application must ensure the memory pointed to by both dstptr and -/// pOffsets is accessible by the device on which the command list was -/// created. -/// - The value(s) written to the destination buffer are undefined if any -/// timestamp event has not been signaled. -/// - If pOffsets is nullptr, then multiple results will be appended -/// sequentially into memory in the same order as phEvents. -/// - The application must ensure the command list and events were created, -/// and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// +/// @remarks +/// _Analogues_ +/// - **clGetEventInfo** +/// - vkGetEventStatus +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6681,28 +6977,13 @@ zeEventQueryKernelTimestamp( /// - ::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` -/// + `nullptr == dstptr` +/// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_NOT_READY +/// + not signaled ze_result_t ZE_APICALL -zeCommandListAppendQueryKernelTimestamps( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numEvents, ///< [in] the number of timestamp events to query - ze_event_handle_t* phEvents, ///< [in][range(0, numEvents)] handles of timestamp events to query - void* dstptr, ///< [in,out] pointer to memory where ::ze_kernel_timestamp_result_t will - ///< be written; must be size-aligned. - const size_t* pOffsets, ///< [in][optional][range(0, numEvents)] offset, in bytes, to write - ///< results; address must be 4byte-aligned and offsets must be - ///< size-aligned. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing query +zeEventQueryStatus( + ze_event_handle_t hEvent ///< [in] handle of the event ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6710,41 +6991,51 @@ zeCommandListAppendQueryKernelTimestamps( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendQueryKernelTimestamps_t pfnAppendQueryKernelTimestamps = [&result] { - auto pfnAppendQueryKernelTimestamps = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendQueryKernelTimestamps; - if( nullptr == pfnAppendQueryKernelTimestamps ) { + static const ze_pfnEventQueryStatus_t pfnQueryStatus = [&result] { + auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Event.pfnQueryStatus; + if( nullptr == pfnQueryStatus ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendQueryKernelTimestamps; + return pfnQueryStatus; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnQueryStatus( hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendQueryKernelTimestamps = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendQueryKernelTimestamps; - if( nullptr == pfnAppendQueryKernelTimestamps ) { + auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Event.pfnQueryStatus; + if( nullptr == pfnQueryStatus ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnQueryStatus( hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the handle of the event pool for the event. +/// @brief Appends a reset of an event back to not signaled state into a command +/// list. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - 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. /// +/// @remarks +/// _Analogues_ +/// - vkResetEvent +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6760,13 +7051,13 @@ zeCommandListAppendQueryKernelTimestamps( /// - ::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_NULL_POINTER -/// + `nullptr == phEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zeEventGetEventPool( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event +zeCommandListAppendEventReset( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_event_handle_t hEvent ///< [in] handle of the event ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6774,41 +7065,45 @@ zeEventGetEventPool( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventGetEventPool_t pfnGetEventPool = [&result] { - auto pfnGetEventPool = ze_lib::context->zeDdiTable.load()->Event.pfnGetEventPool; - if( nullptr == pfnGetEventPool ) { + static const ze_pfnCommandListAppendEventReset_t pfnAppendEventReset = [&result] { + auto pfnAppendEventReset = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendEventReset; + if( nullptr == pfnAppendEventReset ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetEventPool; + return pfnAppendEventReset; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetEventPool( hEvent, phEventPool ); + return pfnAppendEventReset( hCommandList, hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetEventPool = ze_lib::context->zeDdiTable.load()->Event.pfnGetEventPool; - if( nullptr == pfnGetEventPool ) { + auto pfnAppendEventReset = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendEventReset; + if( nullptr == pfnAppendEventReset ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetEventPool( hEvent, phEventPool ); + return pfnAppendEventReset( hCommandList, hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the signal event scope. +/// @brief 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. /// +/// @remarks +/// _Analogues_ +/// - vkResetEvent +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6825,14 +7120,10 @@ zeEventGetEventPool( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSignalScope` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zeEventGetSignalScope( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_scope_flags_t* pSignalScope ///< [out] signal event scope. This is the scope of relevant cache - ///< hierarchies that are flushed on a signal action before the event is - ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. +zeEventHostReset( + ze_event_handle_t hEvent ///< [in] handle of the event ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6840,38 +7131,43 @@ zeEventGetSignalScope( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventGetSignalScope_t pfnGetSignalScope = [&result] { - auto pfnGetSignalScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetSignalScope; - if( nullptr == pfnGetSignalScope ) { + static const ze_pfnEventHostReset_t pfnHostReset = [&result] { + auto pfnHostReset = ze_lib::context->zeDdiTable.load()->Event.pfnHostReset; + if( nullptr == pfnHostReset ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSignalScope; + return pfnHostReset; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetSignalScope( hEvent, pSignalScope ); + return pfnHostReset( hEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSignalScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetSignalScope; - if( nullptr == pfnGetSignalScope ) { + auto pfnHostReset = ze_lib::context->zeDdiTable.load()->Event.pfnHostReset; + if( nullptr == pfnHostReset ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSignalScope( hEvent, pSignalScope ); + return pfnHostReset( hEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the wait event scope. +/// @brief Queries an event's timestamp value on the host. /// /// @details +/// - The application must ensure the event was created from an event pool +/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. +/// - The destination memory will be unmodified if the event has not been +/// signaled. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -6892,13 +7188,14 @@ zeEventGetSignalScope( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pWaitScope` +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_NOT_READY +/// + not signaled ze_result_t ZE_APICALL -zeEventGetWaitScope( +zeEventQueryKernelTimestamp( ze_event_handle_t hEvent, ///< [in] handle of the event - ze_event_scope_flags_t* pWaitScope ///< [out] wait event scope. This is the scope of relevant cache - ///< hierarchies invalidated on a wait action after the event is complete. - ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. + ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6906,39 +7203,54 @@ zeEventGetWaitScope( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventGetWaitScope_t pfnGetWaitScope = [&result] { - auto pfnGetWaitScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetWaitScope; - if( nullptr == pfnGetWaitScope ) { + static const ze_pfnEventQueryKernelTimestamp_t pfnQueryKernelTimestamp = [&result] { + auto pfnQueryKernelTimestamp = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestamp; + if( nullptr == pfnQueryKernelTimestamp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetWaitScope; + return pfnQueryKernelTimestamp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetWaitScope( hEvent, pWaitScope ); + return pfnQueryKernelTimestamp( hEvent, dstptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetWaitScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetWaitScope; - if( nullptr == pfnGetWaitScope ) { + auto pfnQueryKernelTimestamp = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestamp; + if( nullptr == pfnQueryKernelTimestamp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetWaitScope( hEvent, pWaitScope ); + return pfnQueryKernelTimestamp( hEvent, dstptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the handle of the context on which the event pool was created. +/// @brief Appends a query of an events' timestamp value(s) into a command list. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The application must ensure the events were created from an event pool +/// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. +/// - The application must ensure the memory pointed to by both dstptr and +/// pOffsets is accessible by the device on which the command list was +/// created. +/// - The value(s) written to the destination buffer are undefined if any +/// timestamp event has not been signaled. +/// - If pOffsets is nullptr, then multiple results will be appended +/// sequentially into memory in the same order as phEvents. +/// - The application must ensure the command list and events were created, +/// and the memory was allocated, 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. /// /// @returns @@ -6956,13 +7268,28 @@ zeEventGetWaitScope( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEventPool` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phContext` +/// + `nullptr == phEvents` +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeEventPoolGetContextHandle( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created +zeCommandListAppendQueryKernelTimestamps( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numEvents, ///< [in] the number of timestamp events to query + ze_event_handle_t* phEvents, ///< [in][range(0, numEvents)] handles of timestamp events to query + void* dstptr, ///< [in,out] pointer to memory where ::ze_kernel_timestamp_result_t will + ///< be written; must be size-aligned. + const size_t* pOffsets, ///< [in][optional][range(0, numEvents)] offset, in bytes, to write + ///< results; address must be 4byte-aligned and offsets must be + ///< size-aligned. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing query ) { #ifdef L0_STATIC_LOADER_BUILD @@ -6970,36 +7297,36 @@ zeEventPoolGetContextHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolGetContextHandle_t pfnGetContextHandle = [&result] { - auto pfnGetContextHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetContextHandle; - if( nullptr == pfnGetContextHandle ) { + static const ze_pfnCommandListAppendQueryKernelTimestamps_t pfnAppendQueryKernelTimestamps = [&result] { + auto pfnAppendQueryKernelTimestamps = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendQueryKernelTimestamps; + if( nullptr == pfnAppendQueryKernelTimestamps ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetContextHandle; + return pfnAppendQueryKernelTimestamps; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetContextHandle( hEventPool, phContext ); + return pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetContextHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetContextHandle; - if( nullptr == pfnGetContextHandle ) { + auto pfnAppendQueryKernelTimestamps = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendQueryKernelTimestamps; + if( nullptr == pfnAppendQueryKernelTimestamps ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetContextHandle( hEventPool, phContext ); + return pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the creation flags used to create the event pool. +/// @brief Gets the handle of the event pool for the event. /// /// @details /// - The application may call this function from simultaneous threads. @@ -7020,14 +7347,13 @@ zeEventPoolGetContextHandle( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEventPool` +/// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pFlags` +/// + `nullptr == phEventPool` ze_result_t ZE_APICALL -zeEventPoolGetFlags( - ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool - ze_event_pool_flags_t* pFlags ///< [out] creation flags used to create the event pool; may be 0 or a - ///< valid combination of ::ze_event_pool_flag_t +zeEventGetEventPool( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7035,48 +7361,40 @@ zeEventPoolGetFlags( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventPoolGetFlags_t pfnGetFlags = [&result] { - auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetFlags; - if( nullptr == pfnGetFlags ) { + static const ze_pfnEventGetEventPool_t pfnGetEventPool = [&result] { + auto pfnGetEventPool = ze_lib::context->zeDdiTable.load()->Event.pfnGetEventPool; + if( nullptr == pfnGetEventPool ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFlags; + return pfnGetEventPool; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetFlags( hEventPool, pFlags ); + return pfnGetEventPool( hEvent, phEventPool ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetFlags; - if( nullptr == pfnGetFlags ) { + auto pfnGetEventPool = ze_lib::context->zeDdiTable.load()->Event.pfnGetEventPool; + if( nullptr == pfnGetEventPool ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFlags( hEventPool, pFlags ); + return pfnGetEventPool( hEvent, phEventPool ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a fence for the command queue. +/// @brief Gets the signal event scope. /// /// @details -/// - A fence is a heavyweight synchronization primitive used to communicate -/// to the host that command list execution has completed. -/// - The application must only use the fence for the command queue which -/// was provided during creation. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @remarks -/// _Analogues_ -/// - **vkCreateFence** +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7093,18 +7411,15 @@ zeEventPoolGetFlags( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandQueue` +/// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phFence` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == pSignalScope` ze_result_t ZE_APICALL -zeFenceCreate( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue - const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor - ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created +zeEventGetSignalScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pSignalScope ///< [out] signal event scope. This is the scope of relevant cache + ///< hierarchies that are flushed on a signal action before the event is + ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7112,49 +7427,40 @@ zeFenceCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFenceCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Fence.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnEventGetSignalScope_t pfnGetSignalScope = [&result] { + auto pfnGetSignalScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetSignalScope; + if( nullptr == pfnGetSignalScope ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnGetSignalScope; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hCommandQueue, desc, phFence ); + return pfnGetSignalScope( hEvent, pSignalScope ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Fence.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnGetSignalScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetSignalScope; + if( nullptr == pfnGetSignalScope ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hCommandQueue, desc, phFence ); + return pfnGetSignalScope( hEvent, pSignalScope ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Deletes a fence object. +/// @brief Gets the wait event scope. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the fence before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this fence. -/// - The application must **not** call this function from simultaneous -/// threads with the same fence handle. -/// - The implementation of this function must be thread-safe. -/// -/// @remarks -/// _Analogues_ -/// - **vkDestroyFence** +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7171,11 +7477,15 @@ zeFenceCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hFence` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pWaitScope` ze_result_t ZE_APICALL -zeFenceDestroy( - ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy +zeEventGetWaitScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pWaitScope ///< [out] wait event scope. This is the scope of relevant cache + ///< hierarchies invalidated on a wait action after the event is complete. + ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7183,45 +7493,41 @@ zeFenceDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFenceDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Fence.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnEventGetWaitScope_t pfnGetWaitScope = [&result] { + auto pfnGetWaitScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetWaitScope; + if( nullptr == pfnGetWaitScope ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnGetWaitScope; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hFence ); + return pfnGetWaitScope( hEvent, pWaitScope ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Fence.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnGetWaitScope = ze_lib::context->zeDdiTable.load()->Event.pfnGetWaitScope; + if( nullptr == pfnGetWaitScope ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hFence ); + return pfnGetWaitScope( hEvent, pWaitScope ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief The current host thread waits on a fence to be signaled. +/// @brief Gets the handle of the context on which the event pool was created. /// /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **vkWaitForFences** -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -7237,20 +7543,13 @@ zeFenceDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hFence` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_NOT_READY -/// + timeout expired +/// + `nullptr == hEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phContext` ze_result_t ZE_APICALL -zeFenceHostSynchronize( - ze_fence_handle_t hFence, ///< [in] handle of the fence - uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to - ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; - ///< if zero, then operates exactly like ::zeFenceQueryStatus; - ///< if `UINT64_MAX`, then function will not return until complete or - ///< device is lost. - ///< Due to external dependencies, timeout may be rounded to the closest - ///< value allowed by the accuracy of those dependencies. +zeEventPoolGetContextHandle( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7258,45 +7557,41 @@ zeFenceHostSynchronize( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFenceHostSynchronize_t pfnHostSynchronize = [&result] { - auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Fence.pfnHostSynchronize; - if( nullptr == pfnHostSynchronize ) { + static const ze_pfnEventPoolGetContextHandle_t pfnGetContextHandle = [&result] { + auto pfnGetContextHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetContextHandle; + if( nullptr == pfnGetContextHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSynchronize; + return pfnGetContextHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnHostSynchronize( hFence, timeout ); + return pfnGetContextHandle( hEventPool, phContext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Fence.pfnHostSynchronize; - if( nullptr == pfnHostSynchronize ) { + auto pfnGetContextHandle = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetContextHandle; + if( nullptr == pfnGetContextHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnHostSynchronize( hFence, timeout ); + return pfnGetContextHandle( hEventPool, phContext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries a fence object's status. +/// @brief Gets the creation flags used to create the event pool. /// /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **vkGetFenceStatus** -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -7312,13 +7607,14 @@ zeFenceHostSynchronize( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hFence` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_NOT_READY -/// + not signaled +/// + `nullptr == hEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` ze_result_t ZE_APICALL -zeFenceQueryStatus( - ze_fence_handle_t hFence ///< [in] handle of the fence +zeEventPoolGetFlags( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_event_pool_flags_t* pFlags ///< [out] creation flags used to create the event pool; may be 0 or a + ///< valid combination of ::ze_event_pool_flag_t ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7326,44 +7622,43 @@ zeFenceQueryStatus( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFenceQueryStatus_t pfnQueryStatus = [&result] { - auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Fence.pfnQueryStatus; - if( nullptr == pfnQueryStatus ) { + static const ze_pfnEventPoolGetFlags_t pfnGetFlags = [&result] { + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetFlags; + if( nullptr == pfnGetFlags ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryStatus; + return pfnGetFlags; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryStatus( hFence ); + return pfnGetFlags( hEventPool, pFlags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Fence.pfnQueryStatus; - if( nullptr == pfnQueryStatus ) { + auto pfnGetFlags = ze_lib::context->zeDdiTable.load()->EventPool.pfnGetFlags; + if( nullptr == pfnGetFlags ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryStatus( hFence ); + return pfnGetFlags( hEventPool, pFlags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Reset a fence back to the not signaled state. +/// @brief Gets counter based flags of an event. /// /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - **vkResetFences** +/// - Returns 0 for regular events created with ::zeEventCreate, and a valid +/// combination of ::ze_event_counter_based_flag_t for counter based +/// events created with ::zeEventCounterBasedCreate. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7380,10 +7675,14 @@ zeFenceQueryStatus( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hFence` +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` ze_result_t ZE_APICALL -zeFenceReset( - ze_fence_handle_t hFence ///< [in] handle of the fence +zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7391,40 +7690,48 @@ zeFenceReset( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFenceReset_t pfnReset = [&result] { - auto pfnReset = ze_lib::context->zeDdiTable.load()->Fence.pfnReset; - if( nullptr == pfnReset ) { + static const ze_pfnEventGetCounterBasedFlags_t pfnGetCounterBasedFlags = [&result] { + auto pfnGetCounterBasedFlags = ze_lib::context->zeDdiTable.load()->Event.pfnGetCounterBasedFlags; + if( nullptr == pfnGetCounterBasedFlags ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReset; + return pfnGetCounterBasedFlags; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReset( hFence ); + return pfnGetCounterBasedFlags( hEvent, pFlags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReset = ze_lib::context->zeDdiTable.load()->Fence.pfnReset; - if( nullptr == pfnReset ) { + auto pfnGetCounterBasedFlags = ze_lib::context->zeDdiTable.load()->Event.pfnGetCounterBasedFlags; + if( nullptr == pfnGetCounterBasedFlags ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReset( hFence ); + return pfnGetCounterBasedFlags( hEvent, pFlags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves supported properties of an image. +/// @brief Creates a fence for the command queue. /// /// @details +/// - A fence is a heavyweight synchronization primitive used to communicate +/// to the host that command list execution has completed. +/// - The application must only use the fence for the command queue which +/// was provided during creation. /// - 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. +/// +/// @remarks +/// _Analogues_ +/// - **vkCreateFence** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7441,19 +7748,18 @@ zeFenceReset( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == desc` -/// + `nullptr == pImageProperties` +/// + `nullptr == phFence` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// + `0x1 < desc->flags` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeImageGetProperties( - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_properties_t* pImageProperties ///< [out] pointer to image properties +zeFenceCreate( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue + const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor + ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7461,46 +7767,49 @@ zeImageGetProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageGetProperties_t pfnGetProperties = [&result] { - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Image.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + static const ze_pfnFenceCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Fence.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetProperties( hDevice, desc, pImageProperties ); + return pfnCreate( hCommandQueue, desc, phFence ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Image.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Fence.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties( hDevice, desc, pImageProperties ); + return pfnCreate( hCommandQueue, desc, phFence ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an image on the context. +/// @brief Deletes a fence object. /// /// @details -/// - The application must only use the image for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. +/// - The application must ensure the device is not currently referencing +/// the fence before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this fence. +/// - The application must **not** call this function from simultaneous +/// threads with the same fence handle. /// - The implementation of this function must be thread-safe. /// /// @remarks /// _Analogues_ -/// - clCreateImage +/// - **vkDestroyFence** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7517,22 +7826,11 @@ zeImageGetProperties( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImage` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// + `nullptr == hFence` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeImageCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t* phImage ///< [out] pointer to handle of image object created +zeFenceDestroy( + ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7540,45 +7838,44 @@ zeImageCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Image.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnFenceDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Fence.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hContext, hDevice, desc, phImage ); + return pfnDestroy( hFence ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Image.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Fence.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hContext, hDevice, desc, phImage ); + return pfnDestroy( hFence ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Deletes an image object. +/// @brief The current host thread waits on a fence to be signaled. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the image before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this image. -/// - The application must **not** call this function from simultaneous -/// threads with the same image handle. -/// - The implementation of this function must be thread-safe. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - **vkWaitForFences** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7595,11 +7892,20 @@ zeImageCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hFence` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_NOT_READY +/// + timeout expired ze_result_t ZE_APICALL -zeImageDestroy( - ze_image_handle_t hImage ///< [in][release] handle of image object to destroy +zeFenceHostSynchronize( + ze_fence_handle_t hFence, ///< [in] handle of the fence + uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then operates exactly like ::zeFenceQueryStatus; + ///< if `UINT64_MAX`, then function will not return until complete or + ///< device is lost. + ///< Due to external dependencies, timeout may be rounded to the closest + ///< value allowed by the accuracy of those dependencies. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7607,55 +7913,44 @@ zeImageDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Image.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnFenceHostSynchronize_t pfnHostSynchronize = [&result] { + auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Fence.pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnHostSynchronize; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hImage ); + return pfnHostSynchronize( hFence, timeout ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Image.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnHostSynchronize = ze_lib::context->zeDdiTable.load()->Fence.pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hImage ); + return pfnHostSynchronize( hFence, timeout ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Allocates shared memory on the context. +/// @brief Queries a fence object's status. /// /// @details -/// - Shared allocations share ownership between the host and one or more -/// devices. -/// - Shared allocations may optionally be associated with a device by -/// passing a handle to the device. -/// - Devices supporting only single-device shared access capabilities may -/// access shared memory associated with the device. -/// For these devices, ownership of the allocation is shared between the -/// host and the associated device only. -/// - Passing nullptr as the device handle does not associate the shared -/// allocation with any device. -/// For allocations with no associated device, ownership of the allocation -/// is shared between the host and all devices supporting cross-device -/// shared access capabilities. -/// - The application must only use the memory allocation for the context -/// and device, or its sub-devices, which was provided during allocation. /// - 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. +/// +/// @remarks +/// _Analogues_ +/// - **vkGetFenceStatus** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7672,31 +7967,13 @@ zeImageDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == device_desc` -/// + `nullptr == host_desc` -/// + `nullptr == pptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < device_desc->flags` -/// + `0x1f < host_desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Must be zero or a power-of-two -/// + `0 != (alignment & (alignment - 1))` +/// + `nullptr == hFence` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_NOT_READY +/// + not signaled ze_result_t ZE_APICALL -zeMemAllocShared( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor - const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - ze_device_handle_t hDevice, ///< [in][optional] device handle to associate with - void** pptr ///< [out] pointer to shared allocation +zeFenceQueryStatus( + ze_fence_handle_t hFence ///< [in] handle of the fence ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7704,45 +7981,44 @@ zeMemAllocShared( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemAllocShared_t pfnAllocShared = [&result] { - auto pfnAllocShared = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocShared; - if( nullptr == pfnAllocShared ) { + static const ze_pfnFenceQueryStatus_t pfnQueryStatus = [&result] { + auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Fence.pfnQueryStatus; + if( nullptr == pfnQueryStatus ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocShared; + return pfnQueryStatus; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + return pfnQueryStatus( hFence ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAllocShared = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocShared; - if( nullptr == pfnAllocShared ) { + auto pfnQueryStatus = ze_lib::context->zeDdiTable.load()->Fence.pfnQueryStatus; + if( nullptr == pfnQueryStatus ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + return pfnQueryStatus( hFence ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Allocates device memory on the context. +/// @brief Reset a fence back to the not signaled state. /// /// @details -/// - Device allocations are owned by a specific device. -/// - In general, a device allocation may only be accessed by the device -/// that owns it. -/// - The application must only use the memory allocation for the context -/// and device, or its sub-devices, which was provided during allocation. /// - 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. +/// +/// @remarks +/// _Analogues_ +/// - **vkResetFences** /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7759,29 +8035,10 @@ zeMemAllocShared( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == device_desc` -/// + `nullptr == pptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < device_desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Must be zero or a power-of-two -/// + `0 != (alignment & (alignment - 1))` +/// + `nullptr == hFence` ze_result_t ZE_APICALL -zeMemAllocDevice( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - ze_device_handle_t hDevice, ///< [in] handle of the device - void** pptr ///< [out] pointer to device allocation +zeFenceReset( + ze_fence_handle_t hFence ///< [in] handle of the fence ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7789,47 +8046,40 @@ zeMemAllocDevice( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemAllocDevice_t pfnAllocDevice = [&result] { - auto pfnAllocDevice = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocDevice; - if( nullptr == pfnAllocDevice ) { + static const ze_pfnFenceReset_t pfnReset = [&result] { + auto pfnReset = ze_lib::context->zeDdiTable.load()->Fence.pfnReset; + if( nullptr == pfnReset ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocDevice; + return pfnReset; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); + return pfnReset( hFence ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAllocDevice = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocDevice; - if( nullptr == pfnAllocDevice ) { + auto pfnReset = ze_lib::context->zeDdiTable.load()->Fence.pfnReset; + if( nullptr == pfnReset ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); + return pfnReset( hFence ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Allocates host memory on the context. +/// @brief Retrieves supported properties of an image. /// /// @details -/// - Host allocations are owned by the host process. -/// - Host allocations are accessible by the host and all devices within the -/// driver's context. -/// - Host allocations are frequently used as staging areas to transfer data -/// to or from devices. -/// - The application must only use the memory allocation for the context -/// which was provided during allocation. /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7846,27 +8096,19 @@ zeMemAllocDevice( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == host_desc` -/// + `nullptr == pptr` +/// + `nullptr == desc` +/// + `nullptr == pImageProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1f < host_desc->flags` +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Must be zero or a power-of-two -/// + `0 != (alignment & (alignment - 1))` ze_result_t ZE_APICALL -zeMemAllocHost( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor - size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the - ///< `maxMemAllocSize` member of ::ze_device_properties_t - size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of - ///< two - void** pptr ///< [out] pointer to host allocation +zeImageGetProperties( + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_properties_t* pImageProperties ///< [out] pointer to image properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7874,50 +8116,47 @@ zeMemAllocHost( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemAllocHost_t pfnAllocHost = [&result] { - auto pfnAllocHost = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocHost; - if( nullptr == pfnAllocHost ) { + static const ze_pfnImageGetProperties_t pfnGetProperties = [&result] { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Image.pfnGetProperties; + if( nullptr == pfnGetProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocHost; + return pfnGetProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAllocHost( hContext, host_desc, size, alignment, pptr ); + return pfnGetProperties( hDevice, desc, pImageProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAllocHost = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocHost; - if( nullptr == pfnAllocHost ) { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Image.pfnGetProperties; + if( nullptr == pfnGetProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAllocHost( hContext, host_desc, size, alignment, pptr ); + return pfnGetProperties( hDevice, desc, pImageProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory on the -/// context. +/// @brief Creates an image on the context. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the memory before it is freed -/// - The implementation will use the default and immediate policy to -/// schedule all Host and Device allocations associated with this memory -/// to be freed, without any safety checking. Actual freeing of memory is -/// specific to user mode driver and kernel mode driver implementation and -/// may be done asynchronously. -/// - The application must **not** call this function from simultaneous -/// threads with the same pointer. +/// - The application must only use the image for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// +/// @remarks +/// _Analogues_ +/// - clCreateImage +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -7934,12 +8173,21 @@ zeMemAllocHost( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` +/// + `nullptr == desc` +/// + `nullptr == phImage` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ze_result_t ZE_APICALL -zeMemFree( +zeImageCreate( ze_context_handle_t hContext, ///< [in] handle of the context object - void* ptr ///< [in][release] pointer to memory to free + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t* phImage ///< [out] pointer to handle of image object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7947,44 +8195,45 @@ zeMemFree( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemFree_t pfnFree = [&result] { - auto pfnFree = ze_lib::context->zeDdiTable.load()->Mem.pfnFree; - if( nullptr == pfnFree ) { + static const ze_pfnImageCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Image.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFree; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnFree( hContext, ptr ); + return pfnCreate( hContext, hDevice, desc, phImage ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnFree = ze_lib::context->zeDdiTable.load()->Mem.pfnFree; - if( nullptr == pfnFree ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Image.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFree( hContext, ptr ); + return pfnCreate( hContext, hDevice, desc, phImage ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves attributes of a memory allocation +/// @brief Deletes an image object. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The application may query attributes of a memory allocation unrelated -/// to the context. -/// When this occurs, the returned allocation type will be -/// ::ZE_MEMORY_TYPE_UNKNOWN, and the returned identifier and associated -/// device is unspecified. +/// - The application must ensure the device is not currently referencing +/// the image before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this image. +/// - The application must **not** call this function from simultaneous +/// threads with the same image handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8001,16 +8250,11 @@ zeMemFree( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pMemAllocProperties` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeMemGetAllocProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] memory pointer to query - ze_memory_allocation_properties_t* pMemAllocProperties, ///< [in,out] query result for memory allocation properties - ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation +zeImageDestroy( + ze_image_handle_t hImage ///< [in][release] handle of image object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8018,39 +8262,55 @@ zeMemGetAllocProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetAllocProperties_t pfnGetAllocProperties = [&result] { - auto pfnGetAllocProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAllocProperties; - if( nullptr == pfnGetAllocProperties ) { + static const ze_pfnImageDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Image.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocProperties; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); + return pfnDestroy( hImage ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAllocProperties; - if( nullptr == pfnGetAllocProperties ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Image.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); + return pfnDestroy( hImage ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves the base address and/or size of an allocation +/// @brief Allocates shared memory on the context. /// /// @details +/// - Shared allocations share ownership between the host and one or more +/// devices. +/// - Shared allocations may optionally be associated with a device by +/// passing a handle to the device. +/// - Devices supporting only single-device shared access capabilities may +/// access shared memory associated with the device. +/// For these devices, ownership of the allocation is shared between the +/// host and the associated device only. +/// - Passing nullptr as the device handle does not associate the shared +/// allocation with any device. +/// For allocations with no associated device, ownership of the allocation +/// is shared between the host and all devices supporting cross-device +/// shared access capabilities. +/// - The application must only use the memory allocation for the context +/// and device, or its sub-devices, which was provided during allocation. /// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8069,14 +8329,29 @@ zeMemGetAllocProperties( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_ADDRESS_NOT_FOUND +/// + `nullptr == device_desc` +/// + `nullptr == host_desc` +/// + `nullptr == pptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < device_desc->flags` +/// + `0x1f < host_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Must be zero or a power-of-two +/// + `0 != (alignment & (alignment - 1))` ze_result_t ZE_APICALL -zeMemGetAddressRange( +zeMemAllocShared( ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] memory pointer to query - void** pBase, ///< [in,out][optional] base address of the allocation - size_t* pSize ///< [in,out][optional] size of the allocation + const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor + const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + ze_device_handle_t hDevice, ///< [in][optional] device handle to associate with + void** pptr ///< [out] pointer to shared allocation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8084,43 +8359,43 @@ zeMemGetAddressRange( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetAddressRange_t pfnGetAddressRange = [&result] { - auto pfnGetAddressRange = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAddressRange; - if( nullptr == pfnGetAddressRange ) { + static const ze_pfnMemAllocShared_t pfnAllocShared = [&result] { + auto pfnAllocShared = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocShared; + if( nullptr == pfnAllocShared ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAddressRange; + return pfnAllocShared; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAddressRange( hContext, ptr, pBase, pSize ); + return pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAddressRange = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAddressRange; - if( nullptr == pfnGetAddressRange ) { + auto pfnAllocShared = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocShared; + if( nullptr == pfnAllocShared ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAddressRange( hContext, ptr, pBase, pSize ); + return pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an IPC memory handle for the specified allocation +/// @brief Allocates device memory on the context. /// /// @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 must be base pointer of a device or host memory -/// allocation; i.e. the value returned from ::zeMemAllocDevice or from -/// ::zeMemAllocHost, respectively. +/// - Device allocations are owned by a specific device. +/// - In general, a device allocation may only be accessed by the device +/// that owns it. +/// - The application must only use the memory allocation for the context +/// and device, or its sub-devices, which was provided during allocation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -8140,14 +8415,28 @@ zeMemGetAddressRange( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pIpcHandle` +/// + `nullptr == device_desc` +/// + `nullptr == pptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < device_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Must be zero or a power-of-two +/// + `0 != (alignment & (alignment - 1))` ze_result_t ZE_APICALL -zeMemGetIpcHandle( +zeMemAllocDevice( ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + ze_device_handle_t hDevice, ///< [in] handle of the device + void** pptr ///< [out] pointer to device allocation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8155,43 +8444,45 @@ zeMemGetIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetIpcHandle_t pfnGetIpcHandle = [&result] { - auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandle; - if( nullptr == pfnGetIpcHandle ) { + static const ze_pfnMemAllocDevice_t pfnAllocDevice = [&result] { + auto pfnAllocDevice = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocDevice; + if( nullptr == pfnAllocDevice ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandle; + return pfnAllocDevice; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIpcHandle( hContext, ptr, pIpcHandle ); + return pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandle; - if( nullptr == pfnGetIpcHandle ) { + auto pfnAllocDevice = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocDevice; + if( nullptr == pfnAllocDevice ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandle( hContext, ptr, pIpcHandle ); + return pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an IPC memory handle out of a file descriptor +/// @brief Allocates host memory on the context. /// /// @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. +/// - Host allocations are owned by the host process. +/// - Host allocations are accessible by the host and all devices within the +/// driver's context. +/// - Host allocations are frequently used as staging areas to transfer data +/// to or from devices. +/// - The application must only use the memory allocation for the context +/// which was provided during allocation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -8212,12 +8503,25 @@ zeMemGetIpcHandle( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pIpcHandle` +/// + `nullptr == host_desc` +/// + `nullptr == pptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1f < host_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Must be zero or a power-of-two +/// + `0 != (alignment & (alignment - 1))` ze_result_t ZE_APICALL -zeMemGetIpcHandleFromFileDescriptorExp( +zeMemAllocHost( ze_context_handle_t hContext, ///< [in] handle of the context object - uint64_t handle, ///< [in] file descriptor - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor + size_t size, ///< [in] size in bytes to allocate; must be less than or equal to the + ///< `maxMemAllocSize` member of ::ze_device_properties_t + size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of + ///< two + void** pptr ///< [out] pointer to host allocation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8225,41 +8529,48 @@ zeMemGetIpcHandleFromFileDescriptorExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetIpcHandleFromFileDescriptorExp_t pfnGetIpcHandleFromFileDescriptorExp = [&result] { - auto pfnGetIpcHandleFromFileDescriptorExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetIpcHandleFromFileDescriptorExp; - if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) { + static const ze_pfnMemAllocHost_t pfnAllocHost = [&result] { + auto pfnAllocHost = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocHost; + if( nullptr == pfnAllocHost ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleFromFileDescriptorExp; + return pfnAllocHost; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); + return pfnAllocHost( hContext, host_desc, size, alignment, pptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandleFromFileDescriptorExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetIpcHandleFromFileDescriptorExp; - if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) { + auto pfnAllocHost = ze_lib::context->zeDdiTable.load()->Mem.pfnAllocHost; + if( nullptr == pfnAllocHost ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); + return pfnAllocHost( hContext, host_desc, size, alignment, pptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Gets the file descriptor contained in an IPC memory handle +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context. /// /// @details -/// - IPC memory handle must be a valid handle obtained with -/// ::zeMemGetIpcHandle. -/// - The application may call this function from simultaneous threads. +/// - The application must ensure the device is not currently referencing +/// the memory before it is freed +/// - The implementation will use the default and immediate policy to +/// schedule all Host and Device allocations associated with this memory +/// to be freed, without any safety checking. Actual freeing of memory is +/// specific to user mode driver and kernel mode driver implementation and +/// may be done asynchronously. +/// - The application must **not** call this function from simultaneous +/// threads with the same pointer. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -8279,12 +8590,11 @@ zeMemGetIpcHandleFromFileDescriptorExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pHandle` +/// + `nullptr == ptr` ze_result_t ZE_APICALL -zeMemGetFileDescriptorFromIpcHandleExp( +zeMemFree( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_ipc_mem_handle_t ipcHandle, ///< [in] IPC memory handle - uint64_t* pHandle ///< [out] Returned file descriptor + void* ptr ///< [in][release] pointer to memory to free ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8292,50 +8602,44 @@ zeMemGetFileDescriptorFromIpcHandleExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetFileDescriptorFromIpcHandleExp_t pfnGetFileDescriptorFromIpcHandleExp = [&result] { - auto pfnGetFileDescriptorFromIpcHandleExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetFileDescriptorFromIpcHandleExp; - if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) { + static const ze_pfnMemFree_t pfnFree = [&result] { + auto pfnFree = ze_lib::context->zeDdiTable.load()->Mem.pfnFree; + if( nullptr == pfnFree ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFileDescriptorFromIpcHandleExp; + return pfnFree; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); + return pfnFree( hContext, ptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetFileDescriptorFromIpcHandleExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetFileDescriptorFromIpcHandleExp; - if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) { + auto pfnFree = ze_lib::context->zeDdiTable.load()->Mem.pfnFree; + if( nullptr == pfnFree ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); + return pfnFree( hContext, ptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns an IPC memory handle to the driver +/// @brief Retrieves attributes of a memory allocation /// /// @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. -/// - Upon call, driver may release any underlying resources associated with -/// 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. -/// - 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. +/// - The application may call this function from simultaneous threads. +/// - The application may query attributes of a memory allocation unrelated +/// to the context. +/// When this occurs, the returned allocation type will be +/// ::ZE_MEMORY_TYPE_UNKNOWN, and the returned identifier and associated +/// device is unspecified. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8353,10 +8657,15 @@ zeMemGetFileDescriptorFromIpcHandleExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == pMemAllocProperties` ze_result_t ZE_APICALL -zeMemPutIpcHandle( +zeMemGetAllocProperties( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_ipc_mem_handle_t handle ///< [in] IPC memory handle + const void* ptr, ///< [in] memory pointer to query + ze_memory_allocation_properties_t* pMemAllocProperties, ///< [in,out] query result for memory allocation properties + ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8364,47 +8673,39 @@ zeMemPutIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemPutIpcHandle_t pfnPutIpcHandle = [&result] { - auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnPutIpcHandle; - if( nullptr == pfnPutIpcHandle ) { + static const ze_pfnMemGetAllocProperties_t pfnGetAllocProperties = [&result] { + auto pfnGetAllocProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAllocProperties; + if( nullptr == pfnGetAllocProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPutIpcHandle; + return pfnGetAllocProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnPutIpcHandle( hContext, handle ); + return pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnPutIpcHandle; - if( nullptr == pfnPutIpcHandle ) { + auto pfnGetAllocProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAllocProperties; + if( nullptr == pfnGetAllocProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPutIpcHandle( hContext, handle ); + return pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Opens an IPC memory handle to retrieve a device pointer on the -/// context. +/// @brief Retrieves the base address and/or size of an allocation /// /// @details -/// - Takes an IPC memory handle from a remote process and associates it -/// with a device pointer usable in this process. -/// - The device pointer in this process should not be freed with -/// ::zeMemFree, but rather with ::zeMemCloseIpcHandle. -/// - Multiple calls to this function with the same IPC handle will return -/// unique pointers. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8422,20 +8723,15 @@ zeMemPutIpcHandle( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pptr` +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_ADDRESS_NOT_FOUND ze_result_t ZE_APICALL -zeMemOpenIpcHandle( +zeMemGetAddressRange( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle - ze_ipc_mem_handle_t handle, ///< [in] IPC memory handle - ze_ipc_memory_flags_t flags, ///< [in] flags controlling the operation. - ///< must be 0 (default) or a valid combination of ::ze_ipc_memory_flag_t. - void** pptr ///< [out] pointer to device allocation in this process + const void* ptr, ///< [in] memory pointer to query + void** pBase, ///< [in,out][optional] base address of the allocation + size_t* pSize ///< [in,out][optional] size of the allocation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8443,42 +8739,48 @@ zeMemOpenIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemOpenIpcHandle_t pfnOpenIpcHandle = [&result] { - auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnOpenIpcHandle; - if( nullptr == pfnOpenIpcHandle ) { + static const ze_pfnMemGetAddressRange_t pfnGetAddressRange = [&result] { + auto pfnGetAddressRange = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAddressRange; + if( nullptr == pfnGetAddressRange ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnOpenIpcHandle; + return pfnGetAddressRange; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); + return pfnGetAddressRange( hContext, ptr, pBase, pSize ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnOpenIpcHandle; - if( nullptr == pfnOpenIpcHandle ) { + auto pfnGetAddressRange = ze_lib::context->zeDdiTable.load()->Mem.pfnGetAddressRange; + if( nullptr == pfnGetAddressRange ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); + return pfnGetAddressRange( hContext, ptr, pBase, pSize ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes an IPC memory handle +/// @brief Creates an IPC memory handle for the specified allocation /// /// @details -/// - Closes an IPC memory handle by unmapping memory that was opened in -/// this process using ::zeMemOpenIpcHandle. -/// - The application must **not** call this function from simultaneous -/// threads with the same pointer. +/// - 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. /// /// @returns @@ -8499,10 +8801,12 @@ zeMemOpenIpcHandle( /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == ptr` +/// + `nullptr == pIpcHandle` ze_result_t ZE_APICALL -zeMemCloseIpcHandle( +zeMemGetIpcHandle( ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr ///< [in][release] pointer to device allocation in this process + const void* ptr, ///< [in] pointer to the device memory allocation + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8510,56 +8814,45 @@ zeMemCloseIpcHandle( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemCloseIpcHandle_t pfnCloseIpcHandle = [&result] { - auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnCloseIpcHandle; - if( nullptr == pfnCloseIpcHandle ) { + static const ze_pfnMemGetIpcHandle_t pfnGetIpcHandle = [&result] { + auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseIpcHandle; + return pfnGetIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCloseIpcHandle( hContext, ptr ); + return pfnGetIpcHandle( hContext, ptr, pIpcHandle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnCloseIpcHandle; - if( nullptr == pfnCloseIpcHandle ) { + auto pfnGetIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseIpcHandle( hContext, ptr ); + return pfnGetIpcHandle( hContext, ptr, pIpcHandle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Sets atomic access attributes for a shared allocation +/// @brief Creates an IPC memory handle out of a file descriptor /// /// @details -/// - If the shared-allocation is owned by multiple devices (i.e. nullptr -/// was passed to ::zeMemAllocShared when creating it), then hDevice may be -/// passed to set the attributes in that specific device. If nullptr is -/// passed in hDevice, then the atomic attributes are set in all devices -/// associated with the allocation. -/// - If the atomic access attribute select is not supported by the driver, -/// ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. -/// - The atomic access attribute may be only supported at a device-specific -/// granularity, such as at a page boundary. In this case, the memory range -/// may be expanded such that the start and end of the range satisfy granularity -/// requirements. -/// - When calling this function multiple times with different flags, only the -/// attributes from last call are honored. -/// - The application must not call this function for shared-allocations currently -/// being used by the device. -/// - The application must **not** call this function from simultaneous threads -/// with the same pointer. -/// - The implementation of this function should be lock-free. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8577,20 +8870,13 @@ zeMemCloseIpcHandle( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` -/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7f < attr` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == pIpcHandle` ze_result_t ZE_APICALL -zeMemSetAtomicAccessAttributeExp( - ze_context_handle_t hContext, ///< [in] handle of context - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_atomic_attr_exp_flags_t attr ///< [in] Atomic access attributes to set for the specified range. - ///< Must be 0 (default) or a valid combination of ::ze_memory_atomic_attr_exp_flag_t. +zeMemGetIpcHandleFromFileDescriptorExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + uint64_t handle, ///< [in] file descriptor + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8598,42 +8884,42 @@ zeMemSetAtomicAccessAttributeExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemSetAtomicAccessAttributeExp_t pfnSetAtomicAccessAttributeExp = [&result] { - auto pfnSetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnSetAtomicAccessAttributeExp; - if( nullptr == pfnSetAtomicAccessAttributeExp ) { + static const ze_pfnMemGetIpcHandleFromFileDescriptorExp_t pfnGetIpcHandleFromFileDescriptorExp = [&result] { + auto pfnGetIpcHandleFromFileDescriptorExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetIpcHandleFromFileDescriptorExp; + if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetAtomicAccessAttributeExp; + return pfnGetIpcHandleFromFileDescriptorExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); + return pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnSetAtomicAccessAttributeExp; - if( nullptr == pfnSetAtomicAccessAttributeExp ) { + auto pfnGetIpcHandleFromFileDescriptorExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetIpcHandleFromFileDescriptorExp; + if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); + return pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves the atomic access attributes previously set for a shared -/// allocation +/// @brief Gets the file descriptor contained in an IPC memory handle /// /// @details -/// - The application may call this function from simultaneous threads -/// with the same pointer. -/// - The implementation of this function should be lock-free. +/// - IPC memory handle must be a valid handle obtained with +/// ::zeMemGetIpcHandle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8651,17 +8937,13 @@ zeMemSetAtomicAccessAttributeExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` -/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pAttr` +/// + `nullptr == pHandle` ze_result_t ZE_APICALL -zeMemGetAtomicAccessAttributeExp( - ze_context_handle_t hContext, ///< [in] handle of context - ze_device_handle_t hDevice, ///< [in] device associated with the memory advice - const void* ptr, ///< [in] Pointer to the start of the memory range - size_t size, ///< [in] Size in bytes of the memory range - ze_memory_atomic_attr_exp_flags_t* pAttr ///< [out] Atomic access attributes for the specified range +zeMemGetFileDescriptorFromIpcHandleExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_ipc_mem_handle_t ipcHandle, ///< [in] IPC memory handle + uint64_t* pHandle ///< [out] Returned file descriptor ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8669,49 +8951,50 @@ zeMemGetAtomicAccessAttributeExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetAtomicAccessAttributeExp_t pfnGetAtomicAccessAttributeExp = [&result] { - auto pfnGetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetAtomicAccessAttributeExp; - if( nullptr == pfnGetAtomicAccessAttributeExp ) { + static const ze_pfnMemGetFileDescriptorFromIpcHandleExp_t pfnGetFileDescriptorFromIpcHandleExp = [&result] { + auto pfnGetFileDescriptorFromIpcHandleExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetFileDescriptorFromIpcHandleExp; + if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAtomicAccessAttributeExp; + return pfnGetFileDescriptorFromIpcHandleExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); + return pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetAtomicAccessAttributeExp; - if( nullptr == pfnGetAtomicAccessAttributeExp ) { + auto pfnGetFileDescriptorFromIpcHandleExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetFileDescriptorFromIpcHandleExp; + if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); + return pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a module on the context. +/// @brief Returns an IPC memory handle to the driver /// /// @details -/// - Compiles the module for execution on the device. -/// - The application must only use the module for the device, or its -/// sub-devices, which was provided during creation. -/// - The module can be copied to other devices and contexts within the same -/// driver instance by using ::zeModuleGetNativeBinary. -/// - A build log can optionally be returned to the caller. The caller is -/// responsible for destroying build log using ::zeModuleBuildLogDestroy. -/// - The module descriptor constants are only supported for SPIR-V -/// specialization constants. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - 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. +/// - Upon call, driver may release any underlying resources associated with +/// 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. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8729,25 +9012,10 @@ zeMemGetAtomicAccessAttributeExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == desc->pInputModule` -/// + `nullptr == phModule` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_MODULE_FORMAT_NATIVE < desc->format` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_NATIVE_BINARY -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `0 == desc->inputSize` -/// - ::ZE_RESULT_ERROR_MODULE_BUILD_FAILURE ze_result_t ZE_APICALL -zeModuleCreate( +zeMemPutIpcHandle( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_module_desc_t* desc, ///< [in] pointer to module descriptor - ze_module_handle_t* phModule, ///< [out] pointer to handle of module object created - ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. + ze_ipc_mem_handle_t handle ///< [in] IPC memory handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8755,46 +9023,65 @@ zeModuleCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Module.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnMemPutIpcHandle_t pfnPutIpcHandle = [&result] { + auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnPutIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); + return pfnPutIpcHandle( hContext, handle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Module.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnPutIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); + return pfnPutIpcHandle( hContext, handle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys module +/// @brief Opens an IPC memory handle to retrieve a device pointer on the +/// context. /// /// @details -/// - The application must destroy all kernel handles created from the -/// module before destroying the module itself. -/// - The application must ensure the device is not currently referencing -/// the module before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this module. -/// - The application must **not** call this function from simultaneous -/// threads with the same module handle. +/// - Takes an IPC memory handle from a remote process and associates it +/// with a device pointer usable in this process. +/// - The 'hDevice' parameter identifies the device into which the +/// allocation is imported. If this device differs from the one where the +/// memory was originally allocated, it must have P2P access to the +/// exporting device. P2P accessibility can be verified using +/// ::zeDeviceGetP2PProperties or ::zeDeviceCanAccessPeer. +/// - The `hContext` parameter has no requirement to match the context used +/// during the original allocation in the exporting process. Any context +/// of the importing process may be used. +/// - After the handle is successfully opened, the returned pointer may be +/// accessed by `hDevice` and by any other device of the importing process +/// that has P2P connectivity to the exporting device. +/// - When the IPC handle was originally created from a physical memory +/// object (directly via a mapped virtual address), opening the handle +/// assigns a new virtual address in the importing process that maps to +/// the underlying physical memory; no prior ::zeVirtualMemReserve or +/// ::zeVirtualMemMap call is required in the importing process. +/// - The device pointer in this process should not be freed with +/// ::zeMemFree, but rather with ::zeMemCloseIpcHandle. +/// - Multiple calls to this function with the same IPC handle will return +/// unique pointers. +/// - The driver must not release the underlying physical memory until all +/// IPC handles referencing it have been closed via ::zeMemCloseIpcHandle +/// or returned via ::zeMemPutIpcHandle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -8812,11 +9099,21 @@ zeModuleCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hModule` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pptr` ze_result_t ZE_APICALL -zeModuleDestroy( - ze_module_handle_t hModule ///< [in][release] handle of the module +zeMemOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle + ze_ipc_mem_handle_t handle, ///< [in] IPC memory handle + ze_ipc_memory_flags_t flags, ///< [in] flags controlling the operation. + ///< must be 0 (default) or a valid combination of ::ze_ipc_memory_flag_t. + void** pptr ///< [out] pointer to device allocation in this process ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8824,66 +9121,43 @@ zeModuleDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Module.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnMemOpenIpcHandle_t pfnOpenIpcHandle = [&result] { + auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnOpenIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hModule ); + return pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Module.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnOpenIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hModule ); + return pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Dynamically link modules together that share import/export linkage -/// dependencies. +/// @brief Closes an IPC memory handle /// /// @details -/// - Modules support SPIR-V import and export linkage types for functions -/// and global variables. See the SPIR-V specification for linkage -/// details. -/// - Modules can have both import and export linkage. -/// - Modules that do not have any imports or exports do not need to be -/// linked. -/// - All module import requirements must be satisfied via linking before -/// kernel objects can be created from them. -/// - Modules cannot be partially linked. Unsatisfiable import dependencies -/// in the set of modules passed to ::zeModuleDynamicLink will result in -/// ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE being returned. -/// - Modules will only be linked once. A module can be used in multiple -/// link calls if it has exports but its imports will not be re-linked. -/// - Ambiguous dependencies, where multiple modules satisfy the same import -/// dependencies for a module, are not allowed. -/// - The application must ensure the modules being linked were created on -/// the same context. -/// - The application may call this function from simultaneous threads as -/// long as the import modules being linked are not the same. -/// - ModuleGetNativeBinary can be called on any module regardless of -/// whether it is linked or not. -/// - A link log can optionally be returned to the caller. The caller is -/// responsible for destroying the link log using -/// ::zeModuleBuildLogDestroy. -/// - The link log may contain a list of the unresolved import dependencies -/// if present. -/// - The implementation of this function should be lock-free. +/// - Closes an IPC memory handle by unmapping memory that was opened in +/// this process using ::zeMemOpenIpcHandle. +/// - The application must **not** call this function from simultaneous +/// threads with the same pointer. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8899,15 +9173,14 @@ zeModuleDestroy( /// - ::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 == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phModules` -/// - ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE +/// + `nullptr == ptr` ze_result_t ZE_APICALL -zeModuleDynamicLink( - uint32_t numModules, ///< [in] number of modules to be linked pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to - ///< dynamically link together. - ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. +zeMemCloseIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr ///< [in][release] pointer to device allocation in this process ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8915,45 +9188,56 @@ zeModuleDynamicLink( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleDynamicLink_t pfnDynamicLink = [&result] { - auto pfnDynamicLink = ze_lib::context->zeDdiTable.load()->Module.pfnDynamicLink; - if( nullptr == pfnDynamicLink ) { + static const ze_pfnMemCloseIpcHandle_t pfnCloseIpcHandle = [&result] { + auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDynamicLink; + return pfnCloseIpcHandle; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDynamicLink( numModules, phModules, phLinkLog ); + return pfnCloseIpcHandle( hContext, ptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDynamicLink = ze_lib::context->zeDdiTable.load()->Module.pfnDynamicLink; - if( nullptr == pfnDynamicLink ) { + auto pfnCloseIpcHandle = ze_lib::context->zeDdiTable.load()->Mem.pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDynamicLink( numModules, phModules, phLinkLog ); + return pfnCloseIpcHandle( hContext, ptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys module build log object +/// @brief Sets atomic access attributes for a shared allocation /// /// @details -/// - The implementation of this function may immediately free all Host -/// allocations associated with this object. -/// - The application must **not** call this function from simultaneous -/// threads with the same build log handle. +/// - If the shared-allocation is owned by multiple devices (i.e. nullptr +/// was passed to ::zeMemAllocShared when creating it), then hDevice may be +/// passed to set the attributes in that specific device. If nullptr is +/// passed in hDevice, then the atomic attributes are set in all devices +/// associated with the allocation. +/// - If the atomic access attribute select is not supported by the driver, +/// ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. +/// - The atomic access attribute may be only supported at a device-specific +/// granularity, such as at a page boundary. In this case, the memory range +/// may be expanded such that the start and end of the range satisfy granularity +/// requirements. +/// - When calling this function multiple times with different flags, only the +/// attributes from last call are honored. +/// - The application must not call this function for shared-allocations currently +/// being used by the device. +/// - The application must **not** call this function from simultaneous threads +/// with the same pointer. /// - The implementation of this function should be lock-free. -/// - This function can be called before or after ::zeModuleDestroy for the -/// associated module. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8970,11 +9254,21 @@ zeModuleDynamicLink( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hModuleBuildLog` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7f < attr` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeModuleBuildLogDestroy( - ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. +zeMemSetAtomicAccessAttributeExp( + ze_context_handle_t hContext, ///< [in] handle of context + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_atomic_attr_exp_flags_t attr ///< [in] Atomic access attributes to set for the specified range. + ///< Must be 0 (default) or a valid combination of ::ze_memory_atomic_attr_exp_flag_t. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -8982,41 +9276,41 @@ zeModuleBuildLogDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleBuildLogDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnMemSetAtomicAccessAttributeExp_t pfnSetAtomicAccessAttributeExp = [&result] { + auto pfnSetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnSetAtomicAccessAttributeExp; + if( nullptr == pfnSetAtomicAccessAttributeExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnSetAtomicAccessAttributeExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hModuleBuildLog ); + return pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnSetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnSetAtomicAccessAttributeExp; + if( nullptr == pfnSetAtomicAccessAttributeExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hModuleBuildLog ); + return pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves text string for build log. +/// @brief Retrieves the atomic access attributes previously set for a shared +/// allocation /// /// @details -/// - The caller can pass nullptr for pBuildLog when querying only for size. -/// - The caller must provide memory for build log. -/// - The application may call this function from simultaneous threads. +/// - The application may call this function from simultaneous threads +/// with the same pointer. /// - The implementation of this function should be lock-free. /// /// @returns @@ -9034,14 +9328,18 @@ zeModuleBuildLogDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hModuleBuildLog` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSize` +/// + `nullptr == ptr` +/// + `nullptr == pAttr` ze_result_t ZE_APICALL -zeModuleBuildLogGetString( - ze_module_build_log_handle_t hModuleBuildLog, ///< [in] handle of the module build log object. - size_t* pSize, ///< [in,out] size of build log string. - char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. +zeMemGetAtomicAccessAttributeExp( + ze_context_handle_t hContext, ///< [in] handle of context + ze_device_handle_t hDevice, ///< [in] device associated with the memory advice + const void* ptr, ///< [in] Pointer to the start of the memory range + size_t size, ///< [in] Size in bytes of the memory range + ze_memory_atomic_attr_exp_flags_t* pAttr ///< [out] Atomic access attributes for the specified range ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9049,48 +9347,49 @@ zeModuleBuildLogGetString( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleBuildLogGetString_t pfnGetString = [&result] { - auto pfnGetString = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnGetString; - if( nullptr == pfnGetString ) { + static const ze_pfnMemGetAtomicAccessAttributeExp_t pfnGetAtomicAccessAttributeExp = [&result] { + auto pfnGetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetAtomicAccessAttributeExp; + if( nullptr == pfnGetAtomicAccessAttributeExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetString; + return pfnGetAtomicAccessAttributeExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetString( hModuleBuildLog, pSize, pBuildLog ); + return pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetString = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnGetString; - if( nullptr == pfnGetString ) { + auto pfnGetAtomicAccessAttributeExp = ze_lib::context->zeDdiTable.load()->MemExp.pfnGetAtomicAccessAttributeExp; + if( nullptr == pfnGetAtomicAccessAttributeExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetString( hModuleBuildLog, pSize, pBuildLog ); + return pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve native binary from Module. +/// @brief Creates a module on the context. /// /// @details -/// - The native binary output can be cached to disk and new modules can be -/// later constructed from the cached copy. -/// - The native binary will retain debugging information that is associated -/// with a module. -/// - The caller can pass nullptr for pModuleNativeBinary when querying only -/// for size. -/// - The implementation will copy the native binary into a buffer supplied -/// by the caller. +/// - Compiles the module for execution on the device. +/// - The application must only use the module for the device, or its +/// sub-devices, which was provided during creation. +/// - The module can be copied to other devices and contexts within the same +/// driver instance by using ::zeModuleGetNativeBinary. +/// - A build log can optionally be returned to the caller. The caller is +/// responsible for destroying build log using ::zeModuleBuildLogDestroy. +/// - The module descriptor constants are only supported for SPIR-V +/// specialization constants. /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9107,14 +9406,26 @@ zeModuleBuildLogGetString( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hModule` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSize` -ze_result_t ZE_APICALL -zeModuleGetNativeBinary( - ze_module_handle_t hModule, ///< [in] handle of the module - size_t* pSize, ///< [in,out] size of native binary in bytes. - uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary +/// + `nullptr == desc` +/// + `nullptr == desc->pInputModule` +/// + `nullptr == phModule` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_MODULE_FORMAT_NATIVE < desc->format` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NATIVE_BINARY +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `0 == desc->inputSize` +/// - ::ZE_RESULT_ERROR_MODULE_BUILD_FAILURE +ze_result_t ZE_APICALL +zeModuleCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_module_desc_t* desc, ///< [in] pointer to module descriptor + ze_module_handle_t* phModule, ///< [out] pointer to handle of module object created + ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9122,44 +9433,47 @@ zeModuleGetNativeBinary( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleGetNativeBinary_t pfnGetNativeBinary = [&result] { - auto pfnGetNativeBinary = ze_lib::context->zeDdiTable.load()->Module.pfnGetNativeBinary; - if( nullptr == pfnGetNativeBinary ) { + static const ze_pfnModuleCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Module.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNativeBinary; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); + return pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetNativeBinary = ze_lib::context->zeDdiTable.load()->Module.pfnGetNativeBinary; - if( nullptr == pfnGetNativeBinary ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Module.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); + return pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve global variable pointer from Module. +/// @brief Destroys module /// /// @details -/// - For modules created from SPIR-V the interpretation of `pGlobalName` is -/// described in the SPIR-V programming guide. -/// - For native modules not created from SPIR-V the interpretation of -/// `pGlobalName` is implementation defined. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The application must destroy all kernel handles created from the +/// module before destroying the module itself. +/// - The application must ensure the device is not currently referencing +/// the module before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this module. +/// - The application must **not** call this function from simultaneous +/// threads with the same module handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9177,15 +9491,10 @@ zeModuleGetNativeBinary( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pGlobalName` -/// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_NAME +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeModuleGetGlobalPointer( - ze_module_handle_t hModule, ///< [in] handle of the module - const char* pGlobalName, ///< [in] name of global variable in module - size_t* pSize, ///< [in,out][optional] size of global variable - void** pptr ///< [in,out][optional] device visible pointer +zeModuleDestroy( + ze_module_handle_t hModule ///< [in][release] handle of the module ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9193,39 +9502,65 @@ zeModuleGetGlobalPointer( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleGetGlobalPointer_t pfnGetGlobalPointer = [&result] { - auto pfnGetGlobalPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetGlobalPointer; - if( nullptr == pfnGetGlobalPointer ) { + static const ze_pfnModuleDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Module.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGlobalPointer; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); + return pfnDestroy( hModule ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetGlobalPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetGlobalPointer; - if( nullptr == pfnGetGlobalPointer ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Module.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); + return pfnDestroy( hModule ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve all kernel names in the module. +/// @brief Dynamically link modules together that share import/export linkage +/// dependencies. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - Modules support SPIR-V import and export linkage types for functions +/// and global variables. See the SPIR-V specification for linkage +/// details. +/// - Modules can have both import and export linkage. +/// - Modules that do not have any imports or exports do not need to be +/// linked. +/// - All module import requirements must be satisfied via linking before +/// kernel objects can be created from them. +/// - Modules cannot be partially linked. Unsatisfiable import dependencies +/// in the set of modules passed to ::zeModuleDynamicLink will result in +/// ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE being returned. +/// - Modules will only be linked once. A module can be used in multiple +/// link calls if it has exports but its imports will not be re-linked. +/// - Ambiguous dependencies, where multiple modules satisfy the same import +/// dependencies for a module, are not allowed. +/// - The application must ensure the modules being linked were created on +/// the same context. +/// - The application may call this function from simultaneous threads as +/// long as the import modules being linked are not the same. +/// - ModuleGetNativeBinary can be called on any module regardless of +/// whether it is linked or not. +/// - A link log can optionally be returned to the caller. The caller is +/// responsible for destroying the link log using +/// ::zeModuleBuildLogDestroy. +/// - The link log may contain a list of the unresolved import dependencies +/// if present. /// - The implementation of this function should be lock-free. /// /// @returns @@ -9242,21 +9577,15 @@ zeModuleGetGlobalPointer( /// - ::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 == pCount` +/// + `nullptr == phModules` +/// - ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE ze_result_t ZE_APICALL -zeModuleGetKernelNames( - ze_module_handle_t hModule, ///< [in] handle of the module - uint32_t* pCount, ///< [in,out] pointer to the number of names. - ///< if count is zero, then the driver shall update the value with the - ///< total number of names available. - ///< if count is greater than the number of names available, then the - ///< driver shall update the value with the correct number of names available. - const char** pNames ///< [in,out][optional][range(0, *pCount)] array of names of functions. - ///< if count is less than the number of names available, then driver shall - ///< only retrieve that number of names. +zeModuleDynamicLink( + uint32_t numModules, ///< [in] number of modules to be linked pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to + ///< dynamically link together. + ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9264,40 +9593,45 @@ zeModuleGetKernelNames( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleGetKernelNames_t pfnGetKernelNames = [&result] { - auto pfnGetKernelNames = ze_lib::context->zeDdiTable.load()->Module.pfnGetKernelNames; - if( nullptr == pfnGetKernelNames ) { + static const ze_pfnModuleDynamicLink_t pfnDynamicLink = [&result] { + auto pfnDynamicLink = ze_lib::context->zeDdiTable.load()->Module.pfnDynamicLink; + if( nullptr == pfnDynamicLink ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetKernelNames; + return pfnDynamicLink; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetKernelNames( hModule, pCount, pNames ); + return pfnDynamicLink( numModules, phModules, phLinkLog ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetKernelNames = ze_lib::context->zeDdiTable.load()->Module.pfnGetKernelNames; - if( nullptr == pfnGetKernelNames ) { + auto pfnDynamicLink = ze_lib::context->zeDdiTable.load()->Module.pfnDynamicLink; + if( nullptr == pfnDynamicLink ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetKernelNames( hModule, pCount, pNames ); + return pfnDynamicLink( numModules, phModules, phLinkLog ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve module properties. +/// @brief Destroys module build log object /// /// @details -/// - The application may call this function from simultaneous threads. +/// - The implementation of this function may immediately free all Host +/// allocations associated with this object. +/// - The application must **not** call this function from simultaneous +/// threads with the same build log handle. /// - The implementation of this function should be lock-free. +/// - This function can be called before or after ::zeModuleDestroy for the +/// associated module. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9314,13 +9648,11 @@ zeModuleGetKernelNames( /// - ::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 == pModuleProperties` +/// + `nullptr == hModuleBuildLog` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeModuleGetProperties( - ze_module_handle_t hModule, ///< [in] handle of the module - ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. +zeModuleBuildLogDestroy( + ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9328,42 +9660,42 @@ zeModuleGetProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleGetProperties_t pfnGetProperties = [&result] { - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Module.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + static const ze_pfnModuleBuildLogDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetProperties( hModule, pModuleProperties ); + return pfnDestroy( hModuleBuildLog ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Module.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties( hModule, pModuleProperties ); + return pfnDestroy( hModuleBuildLog ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create a kernel from the module. +/// @brief Retrieves text string for build log. /// /// @details -/// - Modules that have unresolved imports need to be dynamically linked -/// before a kernel can be created from them. (See ::zeModuleDynamicLink) +/// - The caller can pass nullptr for pBuildLog when querying only for size. +/// - The caller must provide memory for build log. /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9380,21 +9712,14 @@ zeModuleGetProperties( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hModule` +/// + `nullptr == hModuleBuildLog` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == desc->pKernelName` -/// + `nullptr == phKernel` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_NAME -/// - ::ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED +/// + `nullptr == pSize` 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 - ze_kernel_handle_t* phKernel ///< [out] handle of the Function object +zeModuleBuildLogGetString( + ze_module_build_log_handle_t hModuleBuildLog, ///< [in] handle of the module build log object. + size_t* pSize, ///< [in,out] size of build log string. + char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9402,45 +9727,48 @@ zeKernelCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Kernel.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnModuleBuildLogGetString_t pfnGetString = [&result] { + auto pfnGetString = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnGetString; + if( nullptr == pfnGetString ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnGetString; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hModule, desc, phKernel ); + return pfnGetString( hModuleBuildLog, pSize, pBuildLog ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Kernel.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnGetString = ze_lib::context->zeDdiTable.load()->ModuleBuildLog.pfnGetString; + if( nullptr == pfnGetString ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hModule, desc, phKernel ); + return pfnGetString( hModuleBuildLog, pSize, pBuildLog ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a kernel object +/// @brief Retrieve native binary from Module. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the kernel before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this kernel. -/// - The application must **not** call this function from simultaneous -/// threads with the same kernel handle. -/// - The implementation of this function must be thread-safe. +/// - The native binary output can be cached to disk and new modules can be +/// later constructed from the cached copy. +/// - The native binary will retain debugging information that is associated +/// with a module. +/// - The caller can pass nullptr for pModuleNativeBinary when querying only +/// for size. +/// - The implementation will copy the native binary into a buffer supplied +/// by the caller. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9457,11 +9785,14 @@ zeKernelCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hModule` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pSize` ze_result_t ZE_APICALL -zeKernelDestroy( - ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object +zeModuleGetNativeBinary( + ze_module_handle_t hModule, ///< [in] handle of the module + size_t* pSize, ///< [in,out] size of native binary in bytes. + uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9469,43 +9800,42 @@ zeKernelDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Kernel.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnModuleGetNativeBinary_t pfnGetNativeBinary = [&result] { + auto pfnGetNativeBinary = ze_lib::context->zeDdiTable.load()->Module.pfnGetNativeBinary; + if( nullptr == pfnGetNativeBinary ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnGetNativeBinary; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hKernel ); + return pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Kernel.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnGetNativeBinary = ze_lib::context->zeDdiTable.load()->Module.pfnGetNativeBinary; + if( nullptr == pfnGetNativeBinary ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hKernel ); + return pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve a function pointer from a module by name +/// @brief Retrieve global variable pointer from Module. /// /// @details -/// - The function pointer is unique for the device on which the module was -/// created. -/// - The function pointer is no longer valid if module is destroyed. -/// - The function name should only refer to callable functions within the -/// module. +/// - For modules created from SPIR-V the interpretation of `pGlobalName` is +/// described in the SPIR-V programming guide. +/// - For native modules not created from SPIR-V the interpretation of +/// `pGlobalName` is implementation defined. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -9526,14 +9856,14 @@ zeKernelDestroy( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pFunctionName` -/// + `nullptr == pfnFunction` -/// - ::ZE_RESULT_ERROR_INVALID_FUNCTION_NAME +/// + `nullptr == pGlobalName` +/// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_NAME ze_result_t ZE_APICALL -zeModuleGetFunctionPointer( +zeModuleGetGlobalPointer( ze_module_handle_t hModule, ///< [in] handle of the module - const char* pFunctionName, ///< [in] Name of function to retrieve function pointer for. - void** pfnFunction ///< [out] pointer to function. + const char* pGlobalName, ///< [in] name of global variable in module + size_t* pSize, ///< [in,out][optional] size of global variable + void** pptr ///< [in,out][optional] device visible pointer ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9541,42 +9871,39 @@ zeModuleGetFunctionPointer( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleGetFunctionPointer_t pfnGetFunctionPointer = [&result] { - auto pfnGetFunctionPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetFunctionPointer; - if( nullptr == pfnGetFunctionPointer ) { + static const ze_pfnModuleGetGlobalPointer_t pfnGetGlobalPointer = [&result] { + auto pfnGetGlobalPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetGlobalPointer; + if( nullptr == pfnGetGlobalPointer ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFunctionPointer; + return pfnGetGlobalPointer; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); + return pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetFunctionPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetFunctionPointer; - if( nullptr == pfnGetFunctionPointer ) { + auto pfnGetGlobalPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetGlobalPointer; + if( nullptr == pfnGetGlobalPointer ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); + return pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Set group size for a kernel. +/// @brief Retrieve all kernel names in the module. /// /// @details -/// - The group size will be used when a ::zeCommandListAppendLaunchKernel -/// variant is called. -/// - The application must **not** call this function from simultaneous -/// threads with the same kernel handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -9594,14 +9921,20 @@ zeModuleGetFunctionPointer( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION +/// + `nullptr == hModule` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeKernelSetGroupSize( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t groupSizeX, ///< [in] group size for X dimension to use for this kernel - uint32_t groupSizeY, ///< [in] group size for Y dimension to use for this kernel - uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel +zeModuleGetKernelNames( + ze_module_handle_t hModule, ///< [in] handle of the module + uint32_t* pCount, ///< [in,out] pointer to the number of names. + ///< if count is zero, then the driver shall update the value with the + ///< total number of names available. + ///< if count is greater than the number of names available, then the + ///< driver shall update the value with the correct number of names available. + const char** pNames ///< [in,out][optional][range(0, *pCount)] array of names of functions. + ///< if count is less than the number of names available, then driver shall + ///< only retrieve that number of names. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9609,41 +9942,38 @@ zeKernelSetGroupSize( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSetGroupSize_t pfnSetGroupSize = [&result] { - auto pfnSetGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetGroupSize; - if( nullptr == pfnSetGroupSize ) { + static const ze_pfnModuleGetKernelNames_t pfnGetKernelNames = [&result] { + auto pfnGetKernelNames = ze_lib::context->zeDdiTable.load()->Module.pfnGetKernelNames; + if( nullptr == pfnGetKernelNames ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetGroupSize; + return pfnGetKernelNames; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + return pfnGetKernelNames( hModule, pCount, pNames ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetGroupSize; - if( nullptr == pfnSetGroupSize ) { + auto pfnGetKernelNames = ze_lib::context->zeDdiTable.load()->Module.pfnGetKernelNames; + if( nullptr == pfnGetKernelNames ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + return pfnGetKernelNames( hModule, pCount, pNames ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query a suggested group size for a kernel given a global size for each -/// dimension. +/// @brief Retrieve module properties. /// /// @details -/// - This function ignores the group size that is set using -/// ::zeKernelSetGroupSize. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -9662,21 +9992,13 @@ zeKernelSetGroupSize( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` +/// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == groupSizeX` -/// + `nullptr == groupSizeY` -/// + `nullptr == groupSizeZ` -/// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION +/// + `nullptr == pModuleProperties` ze_result_t ZE_APICALL -zeKernelSuggestGroupSize( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t globalSizeX, ///< [in] global width for X dimension - uint32_t globalSizeY, ///< [in] global width for Y dimension - uint32_t globalSizeZ, ///< [in] global width for Z dimension - uint32_t* groupSizeX, ///< [out] recommended size of group for X dimension - uint32_t* groupSizeY, ///< [out] recommended size of group for Y dimension - uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension +zeModuleGetProperties( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9684,44 +10006,42 @@ zeKernelSuggestGroupSize( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSuggestGroupSize_t pfnSuggestGroupSize = [&result] { - auto pfnSuggestGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestGroupSize; - if( nullptr == pfnSuggestGroupSize ) { + static const ze_pfnModuleGetProperties_t pfnGetProperties = [&result] { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Module.pfnGetProperties; + if( nullptr == pfnGetProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSuggestGroupSize; + return pfnGetProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + return pfnGetProperties( hModule, pModuleProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSuggestGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestGroupSize; - if( nullptr == pfnSuggestGroupSize ) { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Module.pfnGetProperties; + if( nullptr == pfnGetProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + return pfnGetProperties( hModule, pModuleProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query a suggested max group count for a cooperative kernel. +/// @brief Create a kernel from the module. /// /// @details +/// - Modules that have unresolved imports need to be dynamically linked +/// before a kernel can be created from them. (See ::zeModuleDynamicLink) /// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// - Applications are recommended to use ::zeKernelSuggestGroupSize and -/// ::zeKernelSetGroupSize first before calling this function and -/// launching cooperative kernels. Otherwise, implementation may return -/// ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9738,13 +10058,21 @@ zeKernelSuggestGroupSize( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` +/// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == totalGroupCount` +/// + `nullptr == desc` +/// + `nullptr == desc->pKernelName` +/// + `nullptr == phKernel` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_NAME +/// - ::ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED ze_result_t ZE_APICALL -zeKernelSuggestMaxCooperativeGroupCount( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t* totalGroupCount ///< [out] recommended total group count. +zeKernelCreate( + ze_module_handle_t hModule, ///< [in] handle of the module + const ze_kernel_desc_t* desc, ///< [in] pointer to kernel descriptor + ze_kernel_handle_t* phKernel ///< [out] handle of the Function object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9752,45 +10080,45 @@ zeKernelSuggestMaxCooperativeGroupCount( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSuggestMaxCooperativeGroupCount_t pfnSuggestMaxCooperativeGroupCount = [&result] { - auto pfnSuggestMaxCooperativeGroupCount = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestMaxCooperativeGroupCount; - if( nullptr == pfnSuggestMaxCooperativeGroupCount ) { + static const ze_pfnKernelCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Kernel.pfnCreate; + if( nullptr == pfnCreate ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSuggestMaxCooperativeGroupCount; + return pfnCreate; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); + return pfnCreate( hModule, desc, phKernel ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSuggestMaxCooperativeGroupCount = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestMaxCooperativeGroupCount; - if( nullptr == pfnSuggestMaxCooperativeGroupCount ) { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Kernel.pfnCreate; + if( nullptr == pfnCreate ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); + return pfnCreate( hModule, desc, phKernel ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Set kernel argument for a kernel. +/// @brief Destroys a kernel object /// /// @details -/// - The argument values will be used when a -/// ::zeCommandListAppendLaunchKernel variant is called. +/// - The application must ensure the device is not currently referencing +/// the kernel before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this kernel. /// - The application must **not** call this function from simultaneous /// threads with the same kernel handle. -/// - The implementation of this function should be lock-free. -/// - If argument is SLM (size), then SLM size in bytes for this resource is -/// provided as argument size and argument value is null +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9808,16 +10136,10 @@ zeKernelSuggestMaxCooperativeGroupCount( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX -/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeKernelSetArgumentValue( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] - size_t argSize, ///< [in] size of argument type - const void* pArgValue ///< [in][optional] argument value represented as matching arg type. If - ///< null then argument value is considered null. +zeKernelDestroy( + ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9825,43 +10147,44 @@ zeKernelSetArgumentValue( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSetArgumentValue_t pfnSetArgumentValue = [&result] { - auto pfnSetArgumentValue = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetArgumentValue; - if( nullptr == pfnSetArgumentValue ) { + static const ze_pfnKernelDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Kernel.pfnDestroy; + if( nullptr == pfnDestroy ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetArgumentValue; + return pfnDestroy; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); + return pfnDestroy( hKernel ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetArgumentValue = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetArgumentValue; - if( nullptr == pfnSetArgumentValue ) { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Kernel.pfnDestroy; + if( nullptr == pfnDestroy ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); + return pfnDestroy( hKernel ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Sets kernel indirect access flags. +/// @brief Retrieve a function pointer from a module by name /// /// @details -/// - The application should specify which allocations will be indirectly -/// accessed by the kernel to allow driver to optimize which allocations -/// are made resident -/// - This function may **not** be called from simultaneous threads with the -/// same Kernel handle. +/// - The function pointer is unique for the device on which the module was +/// created. +/// - The function pointer is no longer valid if module is destroyed. +/// - The function name should only refer to callable functions within the +/// module. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -9879,14 +10202,16 @@ zeKernelSetArgumentValue( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hModule` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFunctionName` +/// + `nullptr == pfnFunction` +/// - ::ZE_RESULT_ERROR_INVALID_FUNCTION_NAME ze_result_t ZE_APICALL -zeKernelSetIndirectAccess( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags +zeModuleGetFunctionPointer( + ze_module_handle_t hModule, ///< [in] handle of the module + const char* pFunctionName, ///< [in] Name of function to retrieve function pointer for. + void** pfnFunction ///< [out] pointer to function. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9894,40 +10219,42 @@ zeKernelSetIndirectAccess( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSetIndirectAccess_t pfnSetIndirectAccess = [&result] { - auto pfnSetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetIndirectAccess; - if( nullptr == pfnSetIndirectAccess ) { + static const ze_pfnModuleGetFunctionPointer_t pfnGetFunctionPointer = [&result] { + auto pfnGetFunctionPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetFunctionPointer; + if( nullptr == pfnGetFunctionPointer ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetIndirectAccess; + return pfnGetFunctionPointer; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetIndirectAccess( hKernel, flags ); + return pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetIndirectAccess; - if( nullptr == pfnSetIndirectAccess ) { + auto pfnGetFunctionPointer = ze_lib::context->zeDdiTable.load()->Module.pfnGetFunctionPointer; + if( nullptr == pfnGetFunctionPointer ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetIndirectAccess( hKernel, flags ); + return pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve kernel indirect access flags. +/// @brief Set group size for a kernel. /// /// @details -/// - This function may be called from simultaneous threads with the same -/// Kernel handle. +/// - The group size will be used when a ::zeCommandListAppendLaunchKernel +/// variant is called. +/// - The application must **not** call this function from simultaneous +/// threads with the same kernel handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -9946,12 +10273,13 @@ zeKernelSetIndirectAccess( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pFlags` +/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION ze_result_t ZE_APICALL -zeKernelGetIndirectAccess( +zeKernelSetGroupSize( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. + uint32_t groupSizeX, ///< [in] group size for X dimension to use for this kernel + uint32_t groupSizeY, ///< [in] group size for Y dimension to use for this kernel + uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel ) { #ifdef L0_STATIC_LOADER_BUILD @@ -9959,41 +10287,42 @@ zeKernelGetIndirectAccess( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetIndirectAccess_t pfnGetIndirectAccess = [&result] { - auto pfnGetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetIndirectAccess; - if( nullptr == pfnGetIndirectAccess ) { + static const ze_pfnKernelSetGroupSize_t pfnSetGroupSize = [&result] { + auto pfnSetGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetGroupSize; + if( nullptr == pfnSetGroupSize ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIndirectAccess; + return pfnSetGroupSize; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIndirectAccess( hKernel, pFlags ); + return pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetIndirectAccess; - if( nullptr == pfnGetIndirectAccess ) { + auto pfnSetGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetGroupSize; + if( nullptr == pfnSetGroupSize ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIndirectAccess( hKernel, pFlags ); + return pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve all declared kernel attributes (i.e. can be specified with -/// __attribute__ in runtime language). +/// @brief Query a suggested group size for a kernel given a global size for each +/// dimension. /// /// @details -/// - This function may be called from simultaneous threads with the same -/// Kernel handle. +/// - This function ignores the group size that is set using +/// ::zeKernelSetGroupSize. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10013,23 +10342,19 @@ zeKernelGetIndirectAccess( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSize` +/// + `nullptr == groupSizeX` +/// + `nullptr == groupSizeY` +/// + `nullptr == groupSizeZ` +/// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION ze_result_t ZE_APICALL -zeKernelGetSourceAttributes( +zeKernelSuggestGroupSize( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t* pSize, ///< [in,out] pointer to size of string in bytes, including - ///< null-terminating character. - char** pString ///< [in,out][optional] pointer to application-managed character array - ///< (string data). - ///< If NULL, the string length of the kernel source attributes, including - ///< a null-terminating character, is returned in pSize. Otherwise, pString - ///< must point to valid application memory that is greater than or equal - ///< to *pSize bytes in length, and on return the pointed-to string will - ///< contain a space-separated list of kernel source attributes. Note: This - ///< API was originally intended to ship with a char *pString, however this - ///< typo was introduced. Thus the API has to stay this way for backwards - ///< compatible reasons. It can be corrected in v2.0. Suggestion is to - ///< create your own char *pString and then pass to this API with &pString. + uint32_t globalSizeX, ///< [in] global width for X dimension + uint32_t globalSizeY, ///< [in] global width for Y dimension + uint32_t globalSizeZ, ///< [in] global width for Z dimension + uint32_t* groupSizeX, ///< [out] recommended size of group for X dimension + uint32_t* groupSizeY, ///< [out] recommended size of group for Y dimension + uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10037,43 +10362,44 @@ zeKernelGetSourceAttributes( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetSourceAttributes_t pfnGetSourceAttributes = [&result] { - auto pfnGetSourceAttributes = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetSourceAttributes; - if( nullptr == pfnGetSourceAttributes ) { + static const ze_pfnKernelSuggestGroupSize_t pfnSuggestGroupSize = [&result] { + auto pfnSuggestGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestGroupSize; + if( nullptr == pfnSuggestGroupSize ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSourceAttributes; + return pfnSuggestGroupSize; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetSourceAttributes( hKernel, pSize, pString ); + return pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSourceAttributes = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetSourceAttributes; - if( nullptr == pfnGetSourceAttributes ) { + auto pfnSuggestGroupSize = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestGroupSize; + if( nullptr == pfnSuggestGroupSize ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSourceAttributes( hKernel, pSize, pString ); + return pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Sets the preferred cache configuration. +/// @brief Query a suggested max group count for a cooperative kernel. /// /// @details -/// - The cache configuration will be used when a -/// ::zeCommandListAppendLaunchKernel variant is called. -/// - The application must **not** call this function from simultaneous -/// threads with the same kernel handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. +/// - Applications are recommended to use ::zeKernelSuggestGroupSize and +/// ::zeKernelSetGroupSize first before calling this function and +/// launching cooperative kernels. Otherwise, implementation may return +/// ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10082,6 +10408,7 @@ zeKernelGetSourceAttributes( /// - ::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 @@ -10090,15 +10417,12 @@ zeKernelGetSourceAttributes( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == totalGroupCount` ze_result_t ZE_APICALL -zeKernelSetCacheConfig( +zeKernelSuggestMaxCooperativeGroupCount( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_cache_config_flags_t flags ///< [in] cache configuration. - ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. + uint32_t* totalGroupCount ///< [out] recommended total group count. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10106,40 +10430,45 @@ zeKernelSetCacheConfig( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSetCacheConfig_t pfnSetCacheConfig = [&result] { - auto pfnSetCacheConfig = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetCacheConfig; - if( nullptr == pfnSetCacheConfig ) { + static const ze_pfnKernelSuggestMaxCooperativeGroupCount_t pfnSuggestMaxCooperativeGroupCount = [&result] { + auto pfnSuggestMaxCooperativeGroupCount = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestMaxCooperativeGroupCount; + if( nullptr == pfnSuggestMaxCooperativeGroupCount ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheConfig; + return pfnSuggestMaxCooperativeGroupCount; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetCacheConfig( hKernel, flags ); + return pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheConfig = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetCacheConfig; - if( nullptr == pfnSetCacheConfig ) { + auto pfnSuggestMaxCooperativeGroupCount = ze_lib::context->zeDdiTable.load()->Kernel.pfnSuggestMaxCooperativeGroupCount; + if( nullptr == pfnSuggestMaxCooperativeGroupCount ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheConfig( hKernel, flags ); + return pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve kernel properties. +/// @brief Set kernel argument for a kernel. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - The argument values will be used when a +/// ::zeCommandListAppendLaunchKernel variant is called. +/// - The application must **not** call this function from simultaneous +/// threads with the same kernel handle. /// - The implementation of this function should be lock-free. +/// - If argument is SLM (size), then SLM size in bytes for this resource is +/// provided as argument size and argument value is null /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10157,12 +10486,16 @@ zeKernelSetCacheConfig( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pKernelProperties` +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ze_result_t ZE_APICALL -zeKernelGetProperties( +zeKernelSetArgumentValue( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. + uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] + size_t argSize, ///< [in] size of argument type + const void* pArgValue ///< [in][optional] argument value represented as matching arg type. If + ///< null then argument value is considered null. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10170,42 +10503,43 @@ zeKernelGetProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetProperties_t pfnGetProperties = [&result] { - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + static const ze_pfnKernelSetArgumentValue_t pfnSetArgumentValue = [&result] { + auto pfnSetArgumentValue = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetArgumentValue; + if( nullptr == pfnSetArgumentValue ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties; + return pfnSetArgumentValue; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetProperties( hKernel, pKernelProperties ); + return pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + auto pfnSetArgumentValue = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetArgumentValue; + if( nullptr == pfnSetArgumentValue ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties( hKernel, pKernelProperties ); + return pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve kernel name from Kernel. +/// @brief Sets kernel indirect access flags. /// /// @details -/// - The caller can pass nullptr for pName when querying only for size. -/// - The implementation will copy the kernel name into a buffer supplied by -/// the caller. -/// - The application may call this function from simultaneous threads. +/// - The application should specify which allocations will be indirectly +/// accessed by the kernel to allow driver to optimize which allocations +/// are made resident +/// - This function may **not** be called from simultaneous threads with the +/// same Kernel handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10224,14 +10558,13 @@ zeKernelGetProperties( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSize` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeKernelGetName( +zeKernelSetIndirectAccess( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - size_t* pSize, ///< [in,out] size of kernel name string, including null terminator, in - ///< bytes. - char* pName ///< [in,out][optional] char pointer to kernel name. + ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10239,46 +10572,40 @@ zeKernelGetName( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetName_t pfnGetName = [&result] { - auto pfnGetName = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetName; - if( nullptr == pfnGetName ) { + static const ze_pfnKernelSetIndirectAccess_t pfnSetIndirectAccess = [&result] { + auto pfnSetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetIndirectAccess; + if( nullptr == pfnSetIndirectAccess ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetName; + return pfnSetIndirectAccess; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetName( hKernel, pSize, pName ); + return pfnSetIndirectAccess( hKernel, flags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetName = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetName; - if( nullptr == pfnGetName ) { + auto pfnSetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetIndirectAccess; + if( nullptr == pfnSetIndirectAccess ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetName( hKernel, pSize, pName ); + return pfnSetIndirectAccess( hKernel, flags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch kernel over one or more work groups. +/// @brief Retrieve kernel indirect access flags. /// /// @details -/// - The application must ensure the kernel and events are accessible by -/// the device on which the command list was created. -/// - This may **only** be called for a command list created with command -/// queue group ordinal that supports compute. -/// - 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. +/// - This function may be called from simultaneous threads with the same +/// Kernel handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10296,23 +10623,13 @@ zeKernelGetName( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pLaunchFuncArgs` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pFlags` ze_result_t ZE_APICALL -zeCommandListAppendLaunchKernel( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list +zeKernelGetIndirectAccess( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10320,54 +10637,42 @@ zeCommandListAppendLaunchKernel( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchKernel_t pfnAppendLaunchKernel = [&result] { - auto pfnAppendLaunchKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernel; - if( nullptr == pfnAppendLaunchKernel ) { + static const ze_pfnKernelGetIndirectAccess_t pfnGetIndirectAccess = [&result] { + auto pfnGetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetIndirectAccess; + if( nullptr == pfnGetIndirectAccess ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernel; + return pfnGetIndirectAccess; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetIndirectAccess( hKernel, pFlags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernel; - if( nullptr == pfnAppendLaunchKernel ) { + auto pfnGetIndirectAccess = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetIndirectAccess; + if( nullptr == pfnGetIndirectAccess ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetIndirectAccess( hKernel, pFlags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch kernel over one or more work groups and allow to pass -/// additional parameters. +/// @brief Retrieve all declared kernel attributes (i.e. can be specified with +/// __attribute__ in runtime language). /// /// @details -/// - The application must ensure the kernel and events are accessible by -/// the device on which the command list was created. -/// - This may **only** be called for a command list created with command -/// queue group ordinal that supports compute. -/// - 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. +/// - This function may be called from simultaneous threads with the same +/// Kernel 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 supports both immediate and regular command lists. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10376,6 +10681,7 @@ zeCommandListAppendLaunchKernel( /// - ::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 @@ -10383,26 +10689,25 @@ zeCommandListAppendLaunchKernel( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pGroupCounts` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + when passed additional parameters are invalid or incompatible with the device or command list +/// + `nullptr == pSize` ze_result_t ZE_APICALL -zeCommandListAppendLaunchKernelWithParameters( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list +zeKernelGetSourceAttributes( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pGroupCounts, ///< [in] thread group launch arguments - const void * pNext, ///< [in][optional] additional parameters passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + uint32_t* pSize, ///< [in,out] pointer to size of string in bytes, including + ///< null-terminating character. + char** pString ///< [in,out][optional] pointer to application-managed character array + ///< (string data). + ///< If NULL, the string length of the kernel source attributes, including + ///< a null-terminating character, is returned in pSize. Otherwise, pString + ///< must point to valid application memory that is greater than or equal + ///< to *pSize bytes in length, and on return the pointed-to string will + ///< contain a space-separated list of kernel source attributes. Note: This + ///< API was originally intended to ship with a char *pString, however this + ///< typo was introduced. Thus the API has to stay this way for backwards + ///< compatible reasons. It can be corrected in v2.0. Suggestion is to + ///< create your own char *pString and then pass to this API with &pString. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10410,54 +10715,43 @@ zeCommandListAppendLaunchKernelWithParameters( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchKernelWithParameters_t pfnAppendLaunchKernelWithParameters = [&result] { - auto pfnAppendLaunchKernelWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithParameters; - if( nullptr == pfnAppendLaunchKernelWithParameters ) { + static const ze_pfnKernelGetSourceAttributes_t pfnGetSourceAttributes = [&result] { + auto pfnGetSourceAttributes = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetSourceAttributes; + if( nullptr == pfnGetSourceAttributes ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelWithParameters; + return pfnGetSourceAttributes; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetSourceAttributes( hKernel, pSize, pString ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchKernelWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithParameters; - if( nullptr == pfnAppendLaunchKernelWithParameters ) { + auto pfnGetSourceAttributes = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetSourceAttributes; + if( nullptr == pfnGetSourceAttributes ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetSourceAttributes( hKernel, pSize, pString ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch kernel over one or more work groups with specifying work group -/// size and all kernel arguments and allow to pass additional extensions. +/// @brief Sets the preferred cache configuration. /// /// @details -/// - The application must ensure the kernel and events are accessible by -/// the device on which the command list was created. -/// - This may **only** be called for a command list created with command -/// queue group ordinal that supports compute. -/// - 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 cache configuration will be used when a +/// ::zeCommandListAppendLaunchKernel variant is called. +/// - The application must **not** call this function from simultaneous +/// threads with the same kernel 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` /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10473,28 +10767,16 @@ zeCommandListAppendLaunchKernelWithParameters( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` /// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::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_t ZE_APICALL -zeCommandListAppendLaunchKernelWithArguments( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list +zeKernelSetCacheConfig( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t groupCounts, ///< [in] thread group counts - const ze_group_size_t groupSizes, ///< [in] thread group sizes - void ** pArguments, ///< [in]pointer to an array of pointers - const void * pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_cache_config_flags_t flags ///< [in] cache configuration. + ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10502,51 +10784,40 @@ zeCommandListAppendLaunchKernelWithArguments( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchKernelWithArguments_t pfnAppendLaunchKernelWithArguments = [&result] { - auto pfnAppendLaunchKernelWithArguments = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithArguments; - if( nullptr == pfnAppendLaunchKernelWithArguments ) { + static const ze_pfnKernelSetCacheConfig_t pfnSetCacheConfig = [&result] { + auto pfnSetCacheConfig = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetCacheConfig; + if( nullptr == pfnSetCacheConfig ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelWithArguments; + return pfnSetCacheConfig; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetCacheConfig( hKernel, flags ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchKernelWithArguments = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithArguments; - if( nullptr == pfnAppendLaunchKernelWithArguments ) { + auto pfnSetCacheConfig = ze_lib::context->zeDdiTable.load()->Kernel.pfnSetCacheConfig; + if( nullptr == pfnSetCacheConfig ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetCacheConfig( hKernel, flags ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch kernel cooperatively over one or more work groups. +/// @brief Retrieve kernel properties. /// /// @details -/// - The application must ensure the kernel and events are accessible by -/// the device on which the command list was created. -/// - This may **only** be called for a command list created with command -/// queue group ordinal that supports compute. -/// - This may only be used for a command list that are submitted to command -/// queue with cooperative flag set. -/// - 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 application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. -/// - Use ::zeKernelSuggestMaxCooperativeGroupCount to recommend max group -/// count for device for cooperative functions that device supports. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10563,23 +10834,13 @@ zeCommandListAppendLaunchKernelWithArguments( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pLaunchFuncArgs` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pKernelProperties` ze_result_t ZE_APICALL -zeCommandListAppendLaunchCooperativeKernel( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list +zeKernelGetProperties( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10587,51 +10848,42 @@ zeCommandListAppendLaunchCooperativeKernel( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchCooperativeKernel_t pfnAppendLaunchCooperativeKernel = [&result] { - auto pfnAppendLaunchCooperativeKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchCooperativeKernel; - if( nullptr == pfnAppendLaunchCooperativeKernel ) { + static const ze_pfnKernelGetProperties_t pfnGetProperties = [&result] { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetProperties; + if( nullptr == pfnGetProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchCooperativeKernel; + return pfnGetProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetProperties( hKernel, pKernelProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchCooperativeKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchCooperativeKernel; - if( nullptr == pfnAppendLaunchCooperativeKernel ) { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetProperties; + if( nullptr == pfnGetProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetProperties( hKernel, pKernelProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch kernel over one or more work groups using indirect arguments. +/// @brief Retrieve kernel name from Kernel. /// /// @details -/// - The application must ensure the kernel and events are accessible by -/// the device on which the command list was created. -/// - The application must ensure the launch arguments are visible to the -/// device on which the command list was created. -/// - The implementation must not access the contents of the launch -/// arguments 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 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 caller can pass nullptr for pName when querying only for size. +/// - The implementation will copy the kernel name into a buffer supplied by +/// the caller. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10649,24 +10901,15 @@ zeCommandListAppendLaunchCooperativeKernel( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pLaunchArgumentsBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pSize` ze_result_t ZE_APICALL -zeCommandListAppendLaunchKernelIndirect( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list +zeKernelGetName( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in] pointer to device buffer that will contain thread group launch - ///< arguments - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + size_t* pSize, ///< [in,out] size of kernel name string, including null terminator, in + ///< bytes. + char* pName ///< [in,out][optional] char pointer to kernel name. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10674,51 +10917,44 @@ zeCommandListAppendLaunchKernelIndirect( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchKernelIndirect_t pfnAppendLaunchKernelIndirect = [&result] { - auto pfnAppendLaunchKernelIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelIndirect; - if( nullptr == pfnAppendLaunchKernelIndirect ) { + static const ze_pfnKernelGetName_t pfnGetName = [&result] { + auto pfnGetName = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetName; + if( nullptr == pfnGetName ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelIndirect; + return pfnGetName; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetName( hKernel, pSize, pName ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchKernelIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelIndirect; - if( nullptr == pfnAppendLaunchKernelIndirect ) { + auto pfnGetName = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetName; + if( nullptr == pfnGetName ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetName( hKernel, pSize, pName ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Launch multiple kernels over one or more work groups using an array of -/// indirect arguments. +/// @brief Launch kernel over one or more work groups. /// /// @details /// - The application must ensure the kernel and events are accessible by /// the device on which the command list was created. -/// - 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 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. @@ -10739,23 +10975,17 @@ zeCommandListAppendLaunchKernelIndirect( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phKernels` -/// + `nullptr == pCountBuffer` -/// + `nullptr == pLaunchArgumentsBuffer` +/// + `nullptr == pLaunchFuncArgs` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeCommandListAppendLaunchMultipleKernelsIndirect( +zeCommandListAppendLaunchKernel( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] maximum number of kernels to launch - ze_kernel_handle_t* phKernels, ///< [in][range(0, numKernels)] handles of the kernel objects - const uint32_t* pCountBuffer, ///< [in] pointer to device memory location that will contain the actual - ///< number of kernels to launch; value must be less than or equal to - ///< numKernels - const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in][range(0, numKernels)] pointer to device buffer that will contain - ///< a contiguous array of thread group launch arguments + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -10768,41 +10998,1657 @@ zeCommandListAppendLaunchMultipleKernelsIndirect( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendLaunchMultipleKernelsIndirect_t pfnAppendLaunchMultipleKernelsIndirect = [&result] { - auto pfnAppendLaunchMultipleKernelsIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchMultipleKernelsIndirect; - if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) { + static const ze_pfnCommandListAppendLaunchKernel_t pfnAppendLaunchKernel = [&result] { + auto pfnAppendLaunchKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernel; + if( nullptr == pfnAppendLaunchKernel ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchKernel; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernel; + if( nullptr == pfnAppendLaunchKernel ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel over one or more work groups and allow to pass +/// additional parameters. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - This may **only** be called for a command list created with command +/// queue group ordinal that supports compute. +/// - 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 supports both immediate and regular command lists. +/// +/// @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 == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pGroupCounts` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ze_result_t ZE_APICALL +zeCommandListAppendLaunchKernelWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pGroupCounts, ///< [in] thread group launch arguments + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendLaunchKernelWithParameters_t pfnAppendLaunchKernelWithParameters = [&result] { + auto pfnAppendLaunchKernelWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithParameters; + if( nullptr == pfnAppendLaunchKernelWithParameters ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchKernelWithParameters; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchKernelWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithParameters; + if( nullptr == pfnAppendLaunchKernelWithParameters ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchKernelWithParameters( hCommandList, hKernel, pGroupCounts, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel over one or more work groups with specifying work group +/// size and all kernel arguments and allow to pass additional extensions. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - This may **only** be called for a command list created with command +/// queue group ordinal that supports compute. +/// - 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 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` +/// +/// @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 == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(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_t ZE_APICALL +zeCommandListAppendLaunchKernelWithArguments( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t groupCounts, ///< [in] thread group counts + const ze_group_size_t groupSizes, ///< [in] thread group sizes + void ** pArguments, ///< [in]pointer to an array of pointers + const void * pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendLaunchKernelWithArguments_t pfnAppendLaunchKernelWithArguments = [&result] { + auto pfnAppendLaunchKernelWithArguments = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithArguments; + if( nullptr == pfnAppendLaunchKernelWithArguments ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchKernelWithArguments; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchKernelWithArguments = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelWithArguments; + if( nullptr == pfnAppendLaunchKernelWithArguments ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchKernelWithArguments( hCommandList, hKernel, groupCounts, groupSizes, pArguments, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel cooperatively over one or more work groups. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - This may **only** be called for a command list created with command +/// queue group ordinal that supports compute. +/// - This may only be used for a command list that are submitted to command +/// queue with cooperative flag set. +/// - 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. +/// - Use ::zeKernelSuggestMaxCooperativeGroupCount to recommend max group +/// count for device for cooperative functions that device supports. +/// +/// @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 == hCommandList` +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pLaunchFuncArgs` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ze_result_t ZE_APICALL +zeCommandListAppendLaunchCooperativeKernel( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendLaunchCooperativeKernel_t pfnAppendLaunchCooperativeKernel = [&result] { + auto pfnAppendLaunchCooperativeKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchCooperativeKernel; + if( nullptr == pfnAppendLaunchCooperativeKernel ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchCooperativeKernel; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchCooperativeKernel = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchCooperativeKernel; + if( nullptr == pfnAppendLaunchCooperativeKernel ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel over one or more work groups using indirect arguments. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - The application must ensure the launch arguments are visible to the +/// device on which the command list was created. +/// - The implementation must not access the contents of the launch +/// arguments 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 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. +/// +/// @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 == hCommandList` +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pLaunchArgumentsBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ze_result_t ZE_APICALL +zeCommandListAppendLaunchKernelIndirect( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in] pointer to device buffer that will contain thread group launch + ///< arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendLaunchKernelIndirect_t pfnAppendLaunchKernelIndirect = [&result] { + auto pfnAppendLaunchKernelIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelIndirect; + if( nullptr == pfnAppendLaunchKernelIndirect ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchKernelIndirect; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchKernelIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchKernelIndirect; + if( nullptr == pfnAppendLaunchKernelIndirect ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch multiple kernels over one or more work groups using an array of +/// indirect arguments. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - 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. +/// - This function may **not** be called from simultaneous threads with the +/// same command list handle. +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phKernels` +/// + `nullptr == pCountBuffer` +/// + `nullptr == pLaunchArgumentsBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ze_result_t ZE_APICALL +zeCommandListAppendLaunchMultipleKernelsIndirect( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] maximum number of kernels to launch + ze_kernel_handle_t* phKernels, ///< [in][range(0, numKernels)] handles of the kernel objects + const uint32_t* pCountBuffer, ///< [in] pointer to device memory location that will contain the actual + ///< number of kernels to launch; value must be less than or equal to + ///< numKernels + const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in][range(0, numKernels)] pointer to device buffer that will contain + ///< a contiguous array of thread group launch arguments + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendLaunchMultipleKernelsIndirect_t pfnAppendLaunchMultipleKernelsIndirect = [&result] { + auto pfnAppendLaunchMultipleKernelsIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchMultipleKernelsIndirect; + if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendLaunchMultipleKernelsIndirect; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendLaunchMultipleKernelsIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchMultipleKernelsIndirect; + if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Makes memory resident for the device. +/// +/// @details +/// - The application must ensure the memory is resident before being +/// referenced by the device +/// - 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_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 == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + ptr is not recognized by the implementation +ze_result_t ZE_APICALL +zeContextMakeMemoryResident( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + void* ptr, ///< [in] pointer to memory to make resident + size_t size ///< [in] size in bytes to make resident + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnContextMakeMemoryResident_t pfnMakeMemoryResident = [&result] { + auto pfnMakeMemoryResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeMemoryResident; + if( nullptr == pfnMakeMemoryResident ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnMakeMemoryResident; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnMakeMemoryResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeMemoryResident; + if( nullptr == pfnMakeMemoryResident ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Allows memory to be evicted from the device. +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the memory before it is evicted +/// - The application may free the memory without evicting; the memory is +/// implicitly evicted when freed. +/// - 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 == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +ze_result_t ZE_APICALL +zeContextEvictMemory( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + void* ptr, ///< [in] pointer to memory to evict + size_t size ///< [in] size in bytes to evict + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnContextEvictMemory_t pfnEvictMemory = [&result] { + auto pfnEvictMemory = ze_lib::context->zeDdiTable.load()->Context.pfnEvictMemory; + if( nullptr == pfnEvictMemory ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnEvictMemory; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnEvictMemory( hContext, hDevice, ptr, size ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnEvictMemory = ze_lib::context->zeDdiTable.load()->Context.pfnEvictMemory; + if( nullptr == pfnEvictMemory ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnEvictMemory( hContext, hDevice, ptr, size ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Makes image resident for the device. +/// +/// @details +/// - The application must ensure the image is resident before being +/// referenced by the device +/// - 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 == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` +ze_result_t ZE_APICALL +zeContextMakeImageResident( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_image_handle_t hImage ///< [in] handle of image to make resident + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnContextMakeImageResident_t pfnMakeImageResident = [&result] { + auto pfnMakeImageResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeImageResident; + if( nullptr == pfnMakeImageResident ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnMakeImageResident; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnMakeImageResident( hContext, hDevice, hImage ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnMakeImageResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeImageResident; + if( nullptr == pfnMakeImageResident ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnMakeImageResident( hContext, hDevice, hImage ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Allows image to be evicted from the device. +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the image before it is evicted +/// - The application may destroy the image without evicting; the image is +/// implicitly evicted when destroyed. +/// - 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 == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` +ze_result_t ZE_APICALL +zeContextEvictImage( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_image_handle_t hImage ///< [in] handle of image to make evict + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnContextEvictImage_t pfnEvictImage = [&result] { + auto pfnEvictImage = ze_lib::context->zeDdiTable.load()->Context.pfnEvictImage; + if( nullptr == pfnEvictImage ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnEvictImage; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnEvictImage( hContext, hDevice, hImage ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnEvictImage = ze_lib::context->zeDdiTable.load()->Context.pfnEvictImage; + if( nullptr == pfnEvictImage ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnEvictImage( hContext, hDevice, hImage ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates sampler on the context. +/// +/// @details +/// - The application must only use the sampler for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phSampler` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_SAMPLER_ADDRESS_MODE_MIRROR < desc->addressMode` +/// + `::ZE_SAMPLER_FILTER_MODE_LINEAR < desc->filterMode` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ze_result_t ZE_APICALL +zeSamplerCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_sampler_desc_t* desc, ///< [in] pointer to sampler descriptor + ze_sampler_handle_t* phSampler ///< [out] handle of the sampler + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnSamplerCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Sampler.pfnCreate; + if( nullptr == pfnCreate ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnCreate; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnCreate( hContext, hDevice, desc, phSampler ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnCreate = ze_lib::context->zeDdiTable.load()->Sampler.pfnCreate; + if( nullptr == pfnCreate ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnCreate( hContext, hDevice, desc, phSampler ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys sampler object +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the sampler before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this sampler. +/// - The application must **not** call this function from simultaneous +/// threads with the same sampler handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hSampler` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ze_result_t ZE_APICALL +zeSamplerDestroy( + ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnSamplerDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Sampler.pfnDestroy; + if( nullptr == pfnDestroy ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroy; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroy( hSampler ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Sampler.pfnDestroy; + if( nullptr == pfnDestroy ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnDestroy( hSampler ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Reserves pages in virtual address space. +/// +/// @details +/// - The application must only use the memory allocation on the context for +/// which it was created. +/// - The starting address and size must be page aligned. See +/// ::zeVirtualMemQueryPageSize. +/// - If pStart is not null then implementation will attempt to reserve +/// starting from that address. If not available then will find another +/// suitable starting address. +/// - The application may call this function from simultaneous threads. +/// - The access attributes will default to none to indicate reservation is +/// inaccessible. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pptr` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +ze_result_t ZE_APICALL +zeVirtualMemReserve( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* pStart, ///< [in][optional] pointer to start of region to reserve. If nullptr then + ///< implementation will choose a start address. + size_t size, ///< [in] size in bytes to reserve; must be page aligned. + void** pptr ///< [out] pointer to virtual reservation. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemReserve_t pfnReserve = [&result] { + auto pfnReserve = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnReserve; + if( nullptr == pfnReserve ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnReserve; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnReserve( hContext, pStart, size, pptr ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnReserve = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnReserve; + if( nullptr == pfnReserve ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnReserve( hContext, pStart, size, pptr ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Free pages in a reserved virtual address range. +/// +/// @details +/// - Any existing virtual mappings for the range will be unmapped. +/// - Physical allocations objects that were mapped to this range will not +/// be destroyed. These need to be destroyed explicitly. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +ze_result_t ZE_APICALL +zeVirtualMemFree( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of region to free. + size_t size ///< [in] size in bytes to free; must be page aligned. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemFree_t pfnFree = [&result] { + auto pfnFree = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnFree; + if( nullptr == pfnFree ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnFree; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnFree( hContext, ptr, size ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnFree = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnFree; + if( nullptr == pfnFree ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnFree( hContext, ptr, size ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Queries page size to use for aligning virtual memory reservations and +/// physical memory allocations. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pagesize` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +ze_result_t ZE_APICALL +zeVirtualMemQueryPageSize( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t size, ///< [in] unaligned allocation size in bytes + size_t* pagesize ///< [out] pointer to page size to use for start address and size + ///< alignments. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemQueryPageSize_t pfnQueryPageSize = [&result] { + auto pfnQueryPageSize = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnQueryPageSize; + if( nullptr == pfnQueryPageSize ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnQueryPageSize; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnQueryPageSize( hContext, hDevice, size, pagesize ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnQueryPageSize = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnQueryPageSize; + if( nullptr == pfnQueryPageSize ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnQueryPageSize( hContext, hDevice, size, pagesize ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves memory properties of the physical memory object. +/// +/// @details +/// - The application must only use the physical memory object on the +/// context for which it was created. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hPhysicalMem` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemProperties` +ze_result_t ZE_APICALL +zePhysicalMemGetProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object + ze_physical_mem_properties_t* pMemProperties ///< [in,out] pointer to physical memory properties structure. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnPhysicalMemGetProperties_t pfnGetProperties = [&result] { + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnGetProperties; + if( nullptr == pfnGetProperties ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetProperties; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnGetProperties; + if( nullptr == pfnGetProperties ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a physical memory object for the context. +/// +/// @details +/// - The application must only use the physical memory object on the +/// context for which it was created. +/// - The size must be page aligned. For host memory, the operating system +/// page size should be used. For device memory, see +/// ::zeVirtualMemQueryPageSize. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phPhysicalMemory` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == desc->size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +ze_result_t ZE_APICALL +zePhysicalMemCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating + ///< physical host memory. + ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. + ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnPhysicalMemCreate_t pfnCreate = [&result] { + auto pfnCreate = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnCreate; + if( nullptr == pfnCreate ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnCreate; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnCreate = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnCreate; + if( nullptr == pfnCreate ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a physical memory object. +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the physical memory object before it is deleted +/// - The application must **not** call this function from simultaneous +/// threads with the same physical memory handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hPhysicalMemory` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ze_result_t ZE_APICALL +zePhysicalMemDestroy( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnPhysicalMemDestroy_t pfnDestroy = [&result] { + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnDestroy; + if( nullptr == pfnDestroy ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroy; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroy( hContext, hPhysicalMemory ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnDestroy = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnDestroy; + if( nullptr == pfnDestroy ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnDestroy( hContext, hPhysicalMemory ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Maps pages in virtual address space to pages from physical memory +/// object. +/// +/// @details +/// - The virtual address range must have been reserved using +/// ::zeVirtualMemReserve. +/// - The application must only use the mapped memory allocation on the +/// context for which it was created. +/// - The virtual start address and size must be page aligned. See +/// ::zeVirtualMemQueryPageSize. +/// - The application should use, for the starting address and size, the +/// same size alignment used for the physical allocation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// + `nullptr == hPhysicalMemory` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +ze_result_t ZE_APICALL +zeVirtualMemMap( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of virtual address range to map. + size_t size, ///< [in] size in bytes of virtual address range to map; must be page + ///< aligned. + ze_physical_mem_handle_t hPhysicalMemory, ///< [in] handle to physical memory object. + size_t offset, ///< [in] offset into physical memory allocation object; must be page + ///< aligned. + ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address + ///< range. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemMap_t pfnMap = [&result] { + auto pfnMap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnMap; + if( nullptr == pfnMap ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnMap; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnMap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnMap; + if( nullptr == pfnMap ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Unmaps pages in virtual address space from pages from a physical +/// memory object. +/// +/// @details +/// - The page access attributes for virtual address range will revert back +/// to none. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Address must be page aligned +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// + Size must be page aligned +ze_result_t ZE_APICALL +zeVirtualMemUnmap( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of region to unmap. + size_t size ///< [in] size in bytes to unmap; must be page aligned. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemUnmap_t pfnUnmap = [&result] { + auto pfnUnmap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnUnmap; + if( nullptr == pfnUnmap ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnUnmap; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnUnmap( hContext, ptr, size ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnUnmap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnUnmap; + if( nullptr == pfnUnmap ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnUnmap( hContext, ptr, size ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set memory access attributes for a virtual address range. +/// +/// @details +/// - This function may be called from simultaneous threads with the same +/// function handle. +/// - 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 == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Address must be page aligned +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// + Size must be page aligned +ze_result_t ZE_APICALL +zeVirtualMemSetAccessAttribute( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of reserved virtual address region. + size_t size, ///< [in] size in bytes; must be page aligned. + ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address + ///< range. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemSetAccessAttribute_t pfnSetAccessAttribute = [&result] { + auto pfnSetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnSetAccessAttribute; + if( nullptr == pfnSetAccessAttribute ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnSetAccessAttribute; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnSetAccessAttribute( hContext, ptr, size, access ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnSetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnSetAccessAttribute; + if( nullptr == pfnSetAccessAttribute ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnSetAccessAttribute( hContext, ptr, size, access ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get memory access attribute for a virtual address range. +/// +/// @details +/// - If size and outSize are equal then the pages in the specified virtual +/// address range have the same access attributes. +/// - This function may be called from simultaneous threads with the same +/// function handle. +/// - 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 == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == access` +/// + `nullptr == outSize` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + Address must be page aligned +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE +/// + `0 == size` +/// + Size must be page aligned +ze_result_t ZE_APICALL +zeVirtualMemGetAccessAttribute( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to start of virtual address region for query. + size_t size, ///< [in] size in bytes; must be page aligned. + ze_memory_access_attribute_t* access, ///< [out] query result for page access attribute. + size_t* outSize ///< [out] query result for size of virtual address range, starting at ptr, + ///< that shares same access attribute. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnVirtualMemGetAccessAttribute_t pfnGetAccessAttribute = [&result] { + auto pfnGetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnGetAccessAttribute; + if( nullptr == pfnGetAccessAttribute ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchMultipleKernelsIndirect; + return pfnGetAccessAttribute; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendLaunchMultipleKernelsIndirect = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendLaunchMultipleKernelsIndirect; - if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) { + auto pfnGetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnGetAccessAttribute; + if( nullptr == pfnGetAccessAttribute ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Makes memory resident for the device. +/// @brief Set global work offset for a kernel. /// /// @details -/// - The application must ensure the memory is resident before being -/// referenced by the device -/// - The application may call this function from simultaneous threads. +/// - The global work offset will be used when a +/// ::zeCommandListAppendLaunchKernel() variant is called. +/// - The application must **not** call this function from simultaneous +/// threads with the same kernel handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10811,6 +12657,7 @@ zeCommandListAppendLaunchMultipleKernelsIndirect( /// - ::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 @@ -10819,18 +12666,13 @@ zeCommandListAppendLaunchMultipleKernelsIndirect( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + ptr is not recognized by the implementation +/// + `nullptr == hKernel` ze_result_t ZE_APICALL -zeContextMakeMemoryResident( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - void* ptr, ///< [in] pointer to memory to make resident - size_t size ///< [in] size in bytes to make resident +zeKernelSetGlobalOffsetExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + uint32_t offsetX, ///< [in] global offset for X dimension to use for this kernel + uint32_t offsetY, ///< [in] global offset for Y dimension to use for this kernel + uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10838,44 +12680,43 @@ zeContextMakeMemoryResident( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnContextMakeMemoryResident_t pfnMakeMemoryResident = [&result] { - auto pfnMakeMemoryResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeMemoryResident; - if( nullptr == pfnMakeMemoryResident ) { + static const ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp = [&result] { + auto pfnSetGlobalOffsetExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSetGlobalOffsetExp; + if( nullptr == pfnSetGlobalOffsetExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMakeMemoryResident; + return pfnSetGlobalOffsetExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + return pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnMakeMemoryResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeMemoryResident; - if( nullptr == pfnMakeMemoryResident ) { + auto pfnSetGlobalOffsetExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSetGlobalOffsetExp; + if( nullptr == pfnSetGlobalOffsetExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + return pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Allows memory to be evicted from the device. +/// @brief Retrieves kernel binary program data (ISA GEN format). /// /// @details -/// - The application must ensure the device is not currently referencing -/// the memory before it is evicted -/// - The application may free the memory without evicting; the memory is -/// implicitly evicted when freed. +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data +/// for kernel 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10892,16 +12733,15 @@ zeContextMakeMemoryResident( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` +/// + `nullptr == pSize` +/// + `nullptr == pKernelBinary` ze_result_t ZE_APICALL -zeContextEvictMemory( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - void* ptr, ///< [in] pointer to memory to evict - size_t size ///< [in] size in bytes to evict +zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10909,41 +12749,41 @@ zeContextEvictMemory( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnContextEvictMemory_t pfnEvictMemory = [&result] { - auto pfnEvictMemory = ze_lib::context->zeDdiTable.load()->Context.pfnEvictMemory; - if( nullptr == pfnEvictMemory ) { + static const ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp = [&result] { + auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEvictMemory; + return pfnGetBinaryExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnEvictMemory( hContext, hDevice, ptr, size ); + return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEvictMemory = ze_lib::context->zeDdiTable.load()->Context.pfnEvictMemory; - if( nullptr == pfnEvictMemory ) { + auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEvictMemory( hContext, hDevice, ptr, size ); + return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Makes image resident for the device. +/// @brief Import an external semaphore /// /// @details -/// - The application must ensure the image is resident before being -/// referenced by the device -/// - The application may call this function from simultaneous threads. +/// - Imports an external semaphore. +/// - This function may be called from simultaneous threads with the same +/// device handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -10961,14 +12801,18 @@ zeContextEvictMemory( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` /// + `nullptr == hDevice` -/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phSemaphore` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1ff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeContextMakeImageResident( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_image_handle_t hImage ///< [in] handle of image to make resident +zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10976,44 +12820,43 @@ zeContextMakeImageResident( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnContextMakeImageResident_t pfnMakeImageResident = [&result] { - auto pfnMakeImageResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeImageResident; - if( nullptr == pfnMakeImageResident ) { + static const ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt = [&result] { + auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMakeImageResident; + return pfnImportExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnMakeImageResident( hContext, hDevice, hImage ); + return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnMakeImageResident = ze_lib::context->zeDdiTable.load()->Context.pfnMakeImageResident; - if( nullptr == pfnMakeImageResident ) { + auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMakeImageResident( hContext, hDevice, hImage ); + return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Allows image to be evicted from the device. +/// @brief Release an external semaphore /// /// @details /// - The application must ensure the device is not currently referencing -/// the image before it is evicted -/// - The application may destroy the image without evicting; the image is -/// implicitly evicted when destroyed. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// the semaphore before it is released. +/// - The application must **not** call this function from simultaneous +/// threads with the same semaphore handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11030,14 +12873,11 @@ zeContextMakeImageResident( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` +/// + `nullptr == hSemaphore` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeContextEvictImage( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_image_handle_t hImage ///< [in] handle of image to make evict +zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11045,42 +12885,43 @@ zeContextEvictImage( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnContextEvictImage_t pfnEvictImage = [&result] { - auto pfnEvictImage = ze_lib::context->zeDdiTable.load()->Context.pfnEvictImage; - if( nullptr == pfnEvictImage ) { + static const ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt = [&result] { + auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEvictImage; + return pfnReleaseExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnEvictImage( hContext, hDevice, hImage ); + return pfnReleaseExternalSemaphoreExt( hSemaphore ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEvictImage = ze_lib::context->zeDdiTable.load()->Context.pfnEvictImage; - if( nullptr == pfnEvictImage ) { + auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEvictImage( hContext, hDevice, hImage ); + return pfnReleaseExternalSemaphoreExt( hSemaphore ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates sampler on the context. +/// @brief Signal an external semaphore /// /// @details -/// - The application must only use the sampler for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - Signals an external semaphore. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11088,7 +12929,6 @@ zeContextEvictImage( /// - ::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 @@ -11097,21 +12937,30 @@ zeContextEvictImage( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phSampler` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_SAMPLER_ADDRESS_MODE_MIRROR < desc->addressMode` -/// + `::ZE_SAMPLER_FILTER_MODE_LINEAR < desc->filterMode` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phSemaphores` +/// + `nullptr == signalParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == signalParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeSamplerCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_sampler_desc_t* desc, ///< [in] pointer to sampler descriptor - ze_sampler_handle_t* phSampler ///< [out] handle of the sampler +zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11119,45 +12968,43 @@ zeSamplerCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnSamplerCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Sampler.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt = [&result] { + auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnAppendSignalExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hContext, hDevice, desc, phSampler ); + return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->Sampler.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hContext, hDevice, desc, phSampler ); + return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys sampler object +/// @brief Wait on external semaphores /// /// @details -/// - The application must ensure the device is not currently referencing -/// the sampler before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this sampler. -/// - The application must **not** call this function from simultaneous -/// threads with the same sampler handle. -/// - The implementation of this function must be thread-safe. +/// - Waits on external semaphores. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11165,7 +13012,6 @@ zeSamplerCreate( /// - ::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 @@ -11174,11 +13020,30 @@ zeSamplerCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hSampler` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == waitParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == waitParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeSamplerDestroy( - ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler +zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11186,49 +13051,41 @@ zeSamplerDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnSamplerDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Sampler.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt = [&result] { + auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnAppendWaitExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hSampler ); + return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->Sampler.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hSampler ); + return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserves pages in virtual address space. +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details -/// - The application must only use the memory allocation on the context for -/// which it was created. -/// - The starting address and size must be page aligned. See -/// ::zeVirtualMemQueryPageSize. -/// - If pStart is not null then implementation will attempt to reserve -/// starting from that address. If not available then will find another -/// suitable starting address. /// - The application may call this function from simultaneous threads. -/// - The access attributes will default to none to indicate reservation is -/// inaccessible. /// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11245,18 +13102,18 @@ zeSamplerDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pptr` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeVirtualMemReserve( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* pStart, ///< [in][optional] pointer to start of region to reserve. If nullptr then - ///< implementation will choose a start address. - size_t size, ///< [in] size in bytes to reserve; must be page aligned. - void** pptr ///< [out] pointer to virtual reservation. +zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11264,41 +13121,38 @@ zeVirtualMemReserve( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemReserve_t pfnReserve = [&result] { - auto pfnReserve = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnReserve; - if( nullptr == pfnReserve ) { + static const ze_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserve; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReserve( hContext, pStart, size, pptr ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserve = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnReserve; - if( nullptr == pfnReserve ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserve( hContext, pStart, size, pptr ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Free pages in a reserved virtual address range. +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - Any existing virtual mappings for the range will be unmapped. -/// - Physical allocations objects that were mapped to this range will not -/// be destroyed. These need to be destroyed explicitly. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -11317,17 +13171,20 @@ zeVirtualMemReserve( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeVirtualMemFree( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of region to free. - size_t size ///< [in] size in bytes to free; must be page aligned. +zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11335,44 +13192,42 @@ zeVirtualMemFree( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemFree_t pfnFree = [&result] { - auto pfnFree = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnFree; - if( nullptr == pfnFree ) { + static const ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFree; + return pfnGetBuildPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnFree( hContext, ptr, size ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnFree = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnFree; - if( nullptr == pfnFree ) { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFree( hContext, ptr, size ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries page size to use for aligning virtual memory reservations and -/// physical memory allocations. +/// @brief Checks ray tracing acceleration structure format compatibility /// /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -11386,19 +13241,20 @@ zeVirtualMemFree( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pagesize` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. ze_result_t ZE_APICALL -zeVirtualMemQueryPageSize( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t size, ///< [in] unaligned allocation size in bytes - size_t* pagesize ///< [out] pointer to page size to use for start address and size - ///< alignments. +zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11406,42 +13262,83 @@ zeVirtualMemQueryPageSize( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemQueryPageSize_t pfnQueryPageSize = [&result] { - auto pfnQueryPageSize = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnQueryPageSize; - if( nullptr == pfnQueryPageSize ) { + static const ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryPageSize; + return pfnRTASFormatCompatibilityCheckExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryPageSize( hContext, hDevice, size, pagesize ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryPageSize = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnQueryPageSize; - if( nullptr == pfnQueryPageSize ) { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryPageSize( hContext, hDevice, size, pagesize ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves memory properties of the physical memory object. +/// @brief Build ray tracing acceleration structure /// /// @details -/// - The application must only use the physical memory object on the -/// context for which it was created. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. +/// - 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. +/// - 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. +/// - 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. +/// - 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. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - 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. +/// - A successfully constructed acceleration structure is generally +/// non-copyable. It can only get copied from host to device using the +/// special ::zeRTASBuilderCommandListAppendCopyExt function. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11458,15 +13355,37 @@ zeVirtualMemQueryPageSize( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hPhysicalMem` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemProperties` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. ze_result_t ZE_APICALL -zePhysicalMemGetProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object - ze_physical_mem_properties_t* pMemProperties ///< [in,out] pointer to physical memory properties structure. +zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11474,45 +13393,55 @@ zePhysicalMemGetProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnPhysicalMemGetProperties_t pfnGetProperties = [&result] { - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + static const ze_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties; + return pfnBuildExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetProperties = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnGetProperties; - if( nullptr == pfnGetProperties ) { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetProperties( hContext, hPhysicalMem, pMemProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a physical memory object for the context. +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. /// /// @details -/// - The application must only use the physical memory object on the -/// context for which it was created. -/// - The size must be page aligned. For host memory, the operating system -/// page size should be used. For device memory, see -/// ::zeVirtualMemQueryPageSize. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The memory pointed to by srcptr must be host memory containing a valid +/// ray tracing acceleration structure. +/// - The number of bytes to copy must be larger or equal to the size of the +/// ray tracing acceleration structure. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - 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, +/// and the memory was allocated, 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11529,24 +13458,26 @@ zePhysicalMemGetProperties( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phPhysicalMemory` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == desc->size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zePhysicalMemCreate( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating - ///< physical host memory. - ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. - ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created +zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11554,42 +13485,42 @@ zePhysicalMemCreate( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnPhysicalMemCreate_t pfnCreate = [&result] { - auto pfnCreate = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnCreate; - if( nullptr == pfnCreate ) { + static const ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate; + return pfnCommandListAppendCopyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreate = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnCreate; - if( nullptr == pfnCreate ) { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a physical memory object. +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @details -/// - The application must ensure the device is not currently referencing -/// the physical memory object before it is deleted +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. /// - The application must **not** call this function from simultaneous -/// threads with the same physical memory handle. +/// threads with the same builder handle. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -11607,13 +13538,11 @@ zePhysicalMemCreate( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hPhysicalMemory` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zePhysicalMemDestroy( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11621,49 +13550,42 @@ zePhysicalMemDestroy( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnPhysicalMemDestroy_t pfnDestroy = [&result] { - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnDestroy; - if( nullptr == pfnDestroy ) { + static const ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroy( hContext, hPhysicalMemory ); + return pfnDestroyExt( hBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroy = ze_lib::context->zeDdiTable.load()->PhysicalMem.pfnDestroy; - if( nullptr == pfnDestroy ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroy( hContext, hPhysicalMemory ); + return pfnDestroyExt( hBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Maps pages in virtual address space to pages from physical memory -/// object. +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - The virtual address range must have been reserved using -/// ::zeVirtualMemReserve. -/// - The application must only use the mapped memory allocation on the -/// context for which it was created. -/// - The virtual start address and size must be page aligned. See -/// ::zeVirtualMemQueryPageSize. -/// - The application should use, for the starting address and size, the -/// same size alignment used for the physical allocation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11680,27 +13602,13 @@ zePhysicalMemDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hPhysicalMemory` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT +/// + `nullptr == phParallelOperation` ze_result_t ZE_APICALL -zeVirtualMemMap( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of virtual address range to map. - size_t size, ///< [in] size in bytes of virtual address range to map; must be page - ///< aligned. - ze_physical_mem_handle_t hPhysicalMemory, ///< [in] handle to physical memory object. - size_t offset, ///< [in] offset into physical memory allocation object; must be page - ///< aligned. - ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address - ///< range. +zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11708,41 +13616,44 @@ zeVirtualMemMap( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemMap_t pfnMap = [&result] { - auto pfnMap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnMap; - if( nullptr == pfnMap ) { + static const ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMap; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + return pfnCreateExt( hDriver, phParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnMap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnMap; - if( nullptr == pfnMap ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + return pfnCreateExt( hDriver, phParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Unmaps pages in virtual address space from pages from a physical -/// memory object. +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties /// /// @details -/// - The page access attributes for virtual address range will revert back -/// to none. +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling +/// this function. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -11761,19 +13672,13 @@ zeVirtualMemMap( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hParallelOperation` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Address must be page aligned -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// + Size must be page aligned +/// + `nullptr == pProperties` ze_result_t ZE_APICALL -zeVirtualMemUnmap( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of region to unmap. - size_t size ///< [in] size in bytes to unmap; must be page aligned. +zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11781,41 +13686,40 @@ zeVirtualMemUnmap( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemUnmap_t pfnUnmap = [&result] { - auto pfnUnmap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnUnmap; - if( nullptr == pfnUnmap ) { + static const ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt = [&result] { + auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUnmap; + return pfnGetPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnUnmap( hContext, ptr, size ); + return pfnGetPropertiesExt( hParallelOperation, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUnmap = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnUnmap; - if( nullptr == pfnUnmap ) { + auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUnmap( hContext, ptr, size ); + return pfnGetPropertiesExt( hParallelOperation, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Set memory access attributes for a virtual address range. +/// @brief Joins a parallel build operation /// /// @details -/// - This function may be called from simultaneous threads with the same -/// function handle. -/// - The implementation of this function should be lock-free. +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11832,24 +13736,10 @@ zeVirtualMemUnmap( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Address must be page aligned -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// + Size must be page aligned +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeVirtualMemSetAccessAttribute( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of reserved virtual address region. - size_t size, ///< [in] size in bytes; must be page aligned. - ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address - ///< range. +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11857,43 +13747,45 @@ zeVirtualMemSetAccessAttribute( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemSetAccessAttribute_t pfnSetAccessAttribute = [&result] { - auto pfnSetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnSetAccessAttribute; - if( nullptr == pfnSetAccessAttribute ) { + static const ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt = [&result] { + auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetAccessAttribute; + return pfnJoinExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetAccessAttribute( hContext, ptr, size, access ); + return pfnJoinExt( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnSetAccessAttribute; - if( nullptr == pfnSetAccessAttribute ) { + auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetAccessAttribute( hContext, ptr, size, access ); + return pfnJoinExt( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get memory access attribute for a virtual address range. +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - If size and outSize are equal then the pages in the specified virtual -/// address range have the same access attributes. -/// - This function may be called from simultaneous threads with the same -/// function handle. -/// - The implementation of this function should be lock-free. +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11910,24 +13802,10 @@ zeVirtualMemSetAccessAttribute( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == access` -/// + `nullptr == outSize` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT -/// + Address must be page aligned -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE -/// + `0 == size` -/// + Size must be page aligned +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeVirtualMemGetAccessAttribute( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to start of virtual address region for query. - size_t size, ///< [in] size in bytes; must be page aligned. - ze_memory_access_attribute_t* access, ///< [out] query result for page access attribute. - size_t* outSize ///< [out] query result for size of virtual address range, starting at ptr, - ///< that shares same access attribute. +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -11935,42 +13813,47 @@ zeVirtualMemGetAccessAttribute( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnVirtualMemGetAccessAttribute_t pfnGetAccessAttribute = [&result] { - auto pfnGetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnGetAccessAttribute; - if( nullptr == pfnGetAccessAttribute ) { + static const ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAccessAttribute; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); + return pfnDestroyExt( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAccessAttribute = ze_lib::context->zeDdiTable.load()->VirtualMem.pfnGetAccessAttribute; - if( nullptr == pfnGetAccessAttribute ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); + return pfnDestroyExt( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Set global work offset for a kernel. +/// @brief Retrieves the vector width properties of the device. /// /// @details -/// - The global work offset will be used when a -/// ::zeCommandListAppendLaunchKernel() variant is called. -/// - The application must **not** call this function from simultaneous -/// threads with the same kernel handle. +/// - Properties are reported for each vector width supported by the device. +/// - Multiple calls to this function will return properties in the same +/// order. +/// - The number of vector width properties is reported thru the pCount +/// parameter which is updated by the driver given pCount == 0. +/// - The application may provide a buffer that is larger than the number of +/// properties, but the application must set pCount to the number of +/// properties to retrieve. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -11988,13 +13871,21 @@ zeVirtualMemGetAccessAttribute( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeKernelSetGlobalOffsetExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - uint32_t offsetX, ///< [in] global offset for X dimension to use for this kernel - uint32_t offsetY, ///< [in] global offset for Y dimension to use for this kernel - uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel +zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12002,41 +13893,40 @@ zeKernelSetGlobalOffsetExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp = [&result] { - auto pfnSetGlobalOffsetExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSetGlobalOffsetExp; - if( nullptr == pfnSetGlobalOffsetExp ) { + static const ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt = [&result] { + auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetGlobalOffsetExp; + return pfnGetVectorWidthPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetGlobalOffsetExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSetGlobalOffsetExp; - if( nullptr == pfnSetGlobalOffsetExp ) { + auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel binary program data (ISA GEN format). +/// @brief Retrieves kernel allocation properties. /// /// @details /// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data -/// for kernel handle. +/// - Returns array of kernel allocation properties for kernel handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -12057,13 +13947,20 @@ zeKernelSetGlobalOffsetExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pSize` -/// + `nullptr == pKernelBinary` +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeKernelGetBinaryExp( +zeKernelGetAllocationPropertiesExp( ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12071,42 +13968,53 @@ zeKernelGetBinaryExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp = [&result] { - auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) { + static const ze_pfnKernelGetAllocationPropertiesExp_t pfnGetAllocationPropertiesExp = [&result] { + auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBinaryExp; + return pfnGetAllocationPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) { + auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Import an external semaphore +/// @brief Creates an IPC memory handle for the specified allocation with +/// properties for the requested handle. /// /// @details -/// - Imports an external semaphore. -/// - This function may be called from simultaneous threads with the same -/// device handle. -/// - The implementation of this function should be lock-free. +/// - 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. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12123,18 +14031,16 @@ zeKernelGetBinaryExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phSemaphore` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1ff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == ptr` +/// + `nullptr == pIpcHandle` ze_result_t ZE_APICALL -zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. +zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12142,43 +14048,43 @@ zeDeviceImportExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt = [&result] { - auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) { + static const ze_pfnMemGetIpcHandleWithProperties_t pfnGetIpcHandleWithProperties = [&result] { + auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImportExternalSemaphoreExt; + return pfnGetIpcHandleWithProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) { + auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Release an external semaphore +/// @brief Creates a new graph object. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the semaphore before it is released. -/// - The application must **not** call this function from simultaneous -/// threads with the same semaphore handle. -/// - The implementation of this function must be thread-safe. +/// - A newly created graph is an empty container for captured operations. +/// - The application may instantiate executable graph objects from a +/// recorded graph using ::zeGraphInstantiateExt. +/// - The application may begin capturing into an empty graph using +/// ::zeCommandListBeginCaptureIntoGraphExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12195,11 +14101,15 @@ zeDeviceImportExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hSemaphore` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` ze_result_t ZE_APICALL -zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. +zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12207,43 +14117,105 @@ zeDeviceReleaseExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt = [&result] { - auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) { + static const ze_pfnGraphCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReleaseExternalSemaphoreExt; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReleaseExternalSemaphoreExt( hSemaphore ); + return pfnCreateExt( hContext, pNext, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReleaseExternalSemaphoreExt( hSemaphore ); + return pfnCreateExt( hContext, pNext, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Signal an external semaphore +/// @brief Begins recording asynchronous append operations into a new graph +/// associated with an immediate command list. /// /// @details -/// - Signals an external semaphore. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - Graph capture is intended for asynchronous append operations only; +/// synchronous operations are not supported while capture is active and +/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - The application must call this function only with an immediate command +/// list. +/// - The application must not call this function with a synchronous +/// immediate command list. +/// - After this call succeeds, append operations issued to the command list +/// are recorded into a graph and are not submitted to the device. Events +/// used by these operations are not signaled until capture ends and the +/// graph is instantiated and executed. +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while +/// capture is active, calling +/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is +/// active, calling ::zeCommandListAppendGraphExt on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - While capture is active, host-side synchronization operations on +/// recorded work, such as ::zeCommandListHostSynchronize or +/// ::zeEventHostSynchronize, return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - While capture is active, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph +/// cannot be used outside the graph; such use returns an error +/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). +/// - The command list on which capture starts is called the primary command +/// list for a given capture session. +/// - If an event signaled by a captured command list is used in the wait +/// list of another immediate command list, that command list also enters +/// graph capture mode. This creates a fork. The command list from which +/// the fork originated is called the parent, and the forked command list +/// is called the child. A child command list may itself be used to create +/// additional forks, resulting in a tree of command lists participating +/// in the same graph capture. +/// - Subsequent signals from the parent command list to a child command +/// list are allowed and do not create additional forks or capture +/// sessions; the child command list remains in the same capture session +/// as the parent command list. +/// - Each fork must be joined by signaling on the child command list and by +/// waiting on the parent command list. +/// - A child command list may signal multiple times back to the parent +/// command list, but only the last signal on the child command list may +/// become part of the join operation. +/// - Child command lists continue recording as long as the primary command +/// list is in capture mode. +/// - Commands that append work (for example, compute kernels or data +/// transfers) to a recording child command list after the intended join +/// operation are treated as unjoined work, and the graph is considered +/// invalid. Commands that do not append work (for example, event signal +/// and wait operations) are allowed after the join operation and do not +/// invalidate the graph. +/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply to recording child command lists as well. +/// - It is invalid to merge two separate graph capture sessions (i.e. with +/// different primary command lists) by waiting on an event associated +/// with a different graph (operation will return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event +/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error +/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append +/// operations. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12251,6 +14223,7 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::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 @@ -12260,73 +14233,57 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == signalParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == signalParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; - } - static const ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt = [&result] { - auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { + } + static const ze_pfnCommandListBeginGraphCaptureExt_t pfnBeginGraphCaptureExt = [&result] { + auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalExternalSemaphoreExt; + return pfnBeginGraphCaptureExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnBeginGraphCaptureExt( hCommandList, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { + auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnBeginGraphCaptureExt( hCommandList, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Wait on external semaphores +/// @brief Begins recording asynchronous append operations into an existing +/// graph. /// /// @details -/// - Waits on external semaphores. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - The graph must be created with ::zeGraphCreateExt before calling this +/// function. +/// - The graph must be empty when capture begins. +/// - After this call succeeds, the command list enters graph capture mode +/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12334,6 +14291,7 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::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 @@ -12343,29 +14301,13 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == waitParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == waitParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12373,41 +14315,42 @@ zeCommandListAppendWaitExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt = [&result] { - auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { + static const ze_pfnCommandListBeginCaptureIntoGraphExt_t pfnBeginCaptureIntoGraphExt = [&result] { + auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitExternalSemaphoreExt; + return pfnBeginCaptureIntoGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { + auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Queries whether a command list is in graph capture mode. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is +/// in graph capture mode. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is +/// not in graph capture mode. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12424,18 +14367,10 @@ zeCommandListAppendWaitExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hCommandList` ze_result_t ZE_APICALL -zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object +zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12443,40 +14378,57 @@ zeRTASBuilderCreateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + static const ze_pfnCommandListIsGraphCaptureEnabledExt_t pfnIsGraphCaptureEnabledExt = [&result] { + auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnIsGraphCaptureEnabledExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnIsGraphCaptureEnabledExt( hCommandList ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnIsGraphCaptureEnabledExt( hCommandList ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief Ends graph capture on the primary command list and returns the +/// recorded graph. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - This function may only be called on the primary command list used with +/// ::zeCommandListBeginGraphCaptureExt or +/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, +/// the returned graph handle is the same graph handle that was provided +/// when capture began. +/// - The returned graph must be instantiated before execution. +/// - This call ends graph capture mode on all command lists participating +/// in the same graph capture (including forks). +/// - After this call succeeds, subsequent append operations submit work to +/// the device normally. +/// - If capture mode is not active on the command list, an error is +/// returned. +/// - After this call succeeds, events signaled by previously captured +/// commands do not create new forks. +/// - After this call succeeds, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the +/// application and don't interfere with recorded state. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12493,20 +14445,19 @@ zeRTASBuilderCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// + if graph contains unjoined forks +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties +zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12514,42 +14465,49 @@ zeRTASBuilderGetBuildPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { - auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + static const ze_pfnCommandListEndGraphCaptureExt_t pfnEndGraphCaptureExt = [&result] { + auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExt; + return pfnEndGraphCaptureExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @brief Returns the graph associated with a command list that is in graph +/// capture mode. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - This function may only be called while the command list is in graph +/// capture mode. +/// - The returned graph handle cannot be instantiated until capture is +/// ended by ::zeCommandListEndGraphCaptureExt. +/// - This function does not transfer ownership of the graph handle. +/// - If the command list is not in graph capture mode, an error is returned +/// and `*phGraph` is set to null. /// /// @returns +/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -12563,20 +14521,15 @@ zeRTASBuilderGetBuildPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B +zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12584,83 +14537,43 @@ zeDriverRTASFormatCompatibilityCheckExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { - auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + static const ze_pfnCommandListGetGraphExt_t pfnGetGraphExt = [&result] { + auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExt; + return pfnGetGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnGetGraphExt( hCommandList, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnGetGraphExt( hCommandList, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Returns the primary command list associated with a graph capture +/// session. /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. -/// - 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. -/// - 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. -/// - 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. -/// - 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. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - 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. -/// - A successfully constructed acceleration structure is generally -/// non-copyable. It can only get copied from host to device using the -/// special ::zeRTASBuilderCommandListAppendCopyExt function. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." +/// - The returned command list is the command list that initiated capture +/// for the graph during its recording stage. +/// - This function can be called while the graph is being recorded and +/// after capture has ended. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12677,37 +14590,14 @@ zeDriverRTASFormatCompatibilityCheckExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +/// + `nullptr == phCommandList` ze_result_t ZE_APICALL -zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes +zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12715,55 +14605,44 @@ zeRTASBuilderBuildExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { - auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) { + static const ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt = [&result] { + auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExt; + return pfnGetPrimaryCommandListExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) { + auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device -/// memory. +/// @brief Registers a host callback that is invoked when a graph is destroyed. /// /// @details -/// - The memory pointed to by srcptr must be host memory containing a valid -/// ray tracing acceleration structure. -/// - The number of bytes to copy must be larger or equal to the size of the -/// ray tracing acceleration structure. -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. -/// - 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, -/// and the memory was allocated, 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. +/// - Callbacks may be registered while a graph is being recorded or after +/// executable graph instances have been created from it. +/// - Multiple callbacks may be registered for the same graph. +/// - All registered callbacks are invoked when the graph is destroyed. +/// - The callback must not call Level Zero APIs that use the graph being +/// destroyed. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12780,26 +14659,14 @@ zeRTASBuilderBuildExt( /// - ::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 == dstptr` -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeRTASBuilderCommandListAppendCopyExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12807,43 +14674,58 @@ zeRTASBuilderCommandListAppendCopyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { - auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + static const ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt = [&result] { + auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCommandListAppendCopyExt; + return pfnSetDestructionCallbackExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Creates an executable graph object from a recorded graph. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. -/// - The implementation of this function must be thread-safe. +/// - Multiple executable graph objects may be created from a single +/// recorded graph. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12860,11 +14742,15 @@ zeRTASBuilderCommandListAppendCopyExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phExecutableGraph` ze_result_t ZE_APICALL -zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy +zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12872,42 +14758,53 @@ zeRTASBuilderDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnGraphInstantiateExt_t pfnInstantiateExt = [&result] { + auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnInstantiateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hBuilder ); + return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hBuilder ); + return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Appends execution of an executable graph to a command list. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// - The destination command list must match the type and execution +/// characteristics of the command list used to initiate recording, +/// including the queue group ordinal and immediate mode configuration. +/// - Only one execution of the same executable graph object may run at a +/// time; concurrent graph execution requires multiple executable graph +/// instances. +/// - If this function is called while the executable graph is already +/// running, the new execution is scheduled after the current execution +/// completes. +/// - Graph execution obeys the implicit in-order dependency semantics of +/// the destination command list. +/// - If `hSignalEvent` is provided, it is signaled after all recorded +/// append operations on all recorded queues complete. +/// - If wait events are provided, graph execution does not begin until all +/// wait events are satisfied. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12924,13 +14821,19 @@ zeRTASBuilderDestroyExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` +/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object +zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12938,46 +14841,36 @@ zeRTASParallelOperationCreateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt = [&result] { - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + static const ze_pfnCommandListAppendGraphExt_t pfnAppendGraphExt = [&result] { + auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnAppendGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hDriver, phParallelOperation ); + return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt( hDriver, phParallelOperation ); + return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties -/// -/// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// @brief Returns the recorded graph used to instantiate an executable graph. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12994,13 +14887,13 @@ zeRTASParallelOperationCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == phSourceGraph` ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties +zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13008,40 +14901,44 @@ zeRTASParallelOperationGetPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt = [&result] { - auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) { + static const ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt = [&result] { + auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExt; + return pfnGetSourceGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExt( hParallelOperation, pProperties ); + return pfnGetSourceGraphExt( hGraph, phSourceGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) { + auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExt( hParallelOperation, pProperties ); + return pfnGetSourceGraphExt( hGraph, phSourceGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Queries whether a graph is empty. /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no +/// operations. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains +/// recorded operations. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13058,10 +14955,10 @@ zeRTASParallelOperationGetPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object +zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13069,45 +14966,42 @@ zeRTASParallelOperationJoinExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt = [&result] { - auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) { + static const ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt = [&result] { + auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExt; + return pfnIsEmptyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnJoinExt( hParallelOperation ); + return pfnIsEmptyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) { + auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExt( hParallelOperation ); + return pfnIsEmptyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Writes a DOT description of a recorded graph to disk. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. -/// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. -/// - The implementation of this function must be thread-safe. +/// - The generated DOT output captures the graph structure and recorded +/// append operations. +/// - Kernel node output includes kernel names, argument lists, and argument +/// types and values. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13124,10 +15018,15 @@ zeRTASParallelOperationJoinExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == filePath` ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13135,48 +15034,42 @@ zeRTASParallelOperationDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt = [&result] { + auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnDumpContentsExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hParallelOperation ); + return pfnDumpContentsExt( hGraph, filePath, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hParallelOperation ); + return pfnDumpContentsExt( hGraph, filePath, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves the vector width properties of the device. +/// @brief Destroys an executable graph object. /// /// @details -/// - Properties are reported for each vector width supported by the device. -/// - Multiple calls to this function will return properties in the same -/// order. -/// - The number of vector width properties is reported thru the pCount -/// parameter which is updated by the driver given pCount == 0. -/// - The application may provide a buffer that is larger than the number of -/// properties, but the application must set pCount to the number of -/// properties to retrieve. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The executable graph must not be in use or executing on any command +/// list when it is destroyed. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13193,21 +15086,10 @@ zeRTASParallelOperationDestroyExt( /// - ::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` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. +zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13215,42 +15097,42 @@ zeDeviceGetVectorWidthPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt = [&result] { - auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) { + static const ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVectorWidthPropertiesExt; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + return pfnDestroyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + return pfnDestroyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel allocation properties. +/// @brief Destroys a recorded graph object. /// /// @details -/// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns array of kernel allocation properties for kernel handle. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - All executable graph instances created from the recorded graph must be +/// destroyed before this function is called. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13267,22 +15149,10 @@ zeDeviceGetVectorWidthPropertiesExt( /// - ::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 == pCount` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. +zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13290,47 +15160,54 @@ zeKernelGetAllocationPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetAllocationPropertiesExp_t pfnGetAllocationPropertiesExp = [&result] { - auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) { + static const ze_pfnGraphDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocationPropertiesExp; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + return pfnDestroyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + return pfnDestroyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an IPC memory handle for the specified allocation with -/// properties for the requested handle. +/// @brief Appends a host function call into a command list. /// /// @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 application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The host function will be executed on the host when the command list +/// reaches this point during execution. +/// - The host function callback must be of type +/// ::ze_host_function_callback_t. +/// - The host function must **not** call any Level Zero API functions. +/// - The host function may access USM shared and USM host allocations. +/// - The runtime invokes the host function asynchronously to API calls. +/// - Device may wait for preceding commands to finish before invoking the +/// callback (i.e. callbacks may introduce implicit synchronization point +/// on the device). +/// - Device will wait for all phWaitEvents to be signaled before executing +/// the host function. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13339,7 +15216,6 @@ zeKernelGetAllocationPropertiesExp( /// - ::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 @@ -13347,16 +15223,25 @@ zeKernelGetAllocationPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pIpcHandle` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle +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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13364,31 +15249,31 @@ zeMemGetIpcHandleWithProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetIpcHandleWithProperties_t pfnGetIpcHandleWithProperties = [&result] { - auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) { + static const ze_pfnCommandListAppendHostFunction_t pfnAppendHostFunction = [&result] { + auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleWithProperties; + return pfnAppendHostFunction; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) { + auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } @@ -15898,6 +17783,7 @@ zeImageGetDeviceOffsetExp( /// @brief Creates a command list as the clone of another command list. /// /// @details +/// - @deprecated since 1.17 /// - The source command list must be created with the /// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. /// - The source command list must be closed prior to cloning. @@ -16356,6 +18242,72 @@ zeCommandListUpdateMutableCommandsExp( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query whether a command list was created with the mutable command list +/// extension. +/// +/// @details +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pIsMutable` +ze_result_t ZE_APICALL +zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListIsMutableExp_t pfnIsMutableExp = [&result] { + auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnIsMutableExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnIsMutableExp( hCommandList, pIsMutable ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnIsMutableExp( hCommandList, pIsMutable ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Updates the signal event for a mutable command in a mutable command /// list. diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index 82422236..55ae2fa8 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -32,6 +32,40 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeInitDrivers") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetExecutableGraphProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.ExecutableGraph ); + initialzeDdiTable.ExecutableGraph.pfnGetSourceGraphExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeExecutableGraphGetSourceGraphExt") ); + initialzeDdiTable.ExecutableGraph.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeExecutableGraphDestroyExt") ); + } + + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetGraphProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.Graph ); + initialzeDdiTable.Graph.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphCreateExt") ); + initialzeDdiTable.Graph.pfnGetPrimaryCommandListExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphGetPrimaryCommandListExt") ); + initialzeDdiTable.Graph.pfnSetDestructionCallbackExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphSetDestructionCallbackExt") ); + initialzeDdiTable.Graph.pfnInstantiateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphInstantiateExt") ); + initialzeDdiTable.Graph.pfnIsEmptyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphIsEmptyExt") ); + initialzeDdiTable.Graph.pfnDumpContentsExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphDumpContentsExt") ); + initialzeDdiTable.Graph.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphDestroyExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -184,6 +218,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDeviceGetRuntimeRequirementsKey") ); initialzeDdiTable.Device.pfnValidateRuntimeRequirements = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceValidateRuntimeRequirements") ); + initialzeDdiTable.Device.pfnGetCounterBasedEventMaxValue = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDeviceGetCounterBasedEventMaxValue") ); initialzeDdiTable.Device.pfnReserveCacheExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReserveCacheExt") ); initialzeDdiTable.Device.pfnSetCacheAdviceExt = reinterpret_cast( @@ -242,6 +278,12 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeCommandQueueExecuteCommandLists") ); initialzeDdiTable.CommandQueue.pfnSynchronize = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandQueueSynchronize") ); + initialzeDdiTable.CommandQueue.pfnGetFlags = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandQueueGetFlags") ); + initialzeDdiTable.CommandQueue.pfnGetMode = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandQueueGetMode") ); + initialzeDdiTable.CommandQueue.pfnGetPriority = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandQueueGetPriority") ); initialzeDdiTable.CommandQueue.pfnGetOrdinal = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandQueueGetOrdinal") ); initialzeDdiTable.CommandQueue.pfnGetIndex = reinterpret_cast( @@ -319,6 +361,28 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeCommandListAppendMemoryFillWithParameters") ); initialzeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListImmediateAppendCommandListsWithParameters") ); + initialzeDdiTable.CommandList.pfnGetFlags = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListGetFlags") ); + initialzeDdiTable.CommandList.pfnImmediateGetFlags = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListImmediateGetFlags") ); + initialzeDdiTable.CommandList.pfnImmediateGetMode = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListImmediateGetMode") ); + initialzeDdiTable.CommandList.pfnImmediateGetPriority = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListImmediateGetPriority") ); + initialzeDdiTable.CommandList.pfnBeginGraphCaptureExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListBeginGraphCaptureExt") ); + initialzeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListBeginCaptureIntoGraphExt") ); + initialzeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListIsGraphCaptureEnabledExt") ); + initialzeDdiTable.CommandList.pfnEndGraphCaptureExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListEndGraphCaptureExt") ); + initialzeDdiTable.CommandList.pfnGetGraphExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListGetGraphExt") ); + initialzeDdiTable.CommandList.pfnAppendGraphExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListAppendGraphExt") ); + initialzeDdiTable.CommandList.pfnAppendHostFunction = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListAppendHostFunction") ); initialzeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListAppendImageCopyToMemoryExt") ); initialzeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt = reinterpret_cast( @@ -347,6 +411,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeCommandListGetNextCommandIdWithKernelsExp") ); initialzeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListUpdateMutableCommandKernelsExp") ); + initialzeDdiTable.CommandListExp.pfnIsMutableExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListIsMutableExp") ); initialzeDdiTable.CommandListExp.pfnCreateCloneExp = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListCreateCloneExp") ); initialzeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp = reinterpret_cast( @@ -390,6 +456,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeEventCounterBasedCloseIpcHandle") ); initialzeDdiTable.Event.pfnCounterBasedGetDeviceAddress = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeEventCounterBasedGetDeviceAddress") ); + initialzeDdiTable.Event.pfnGetCounterBasedFlags = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeEventGetCounterBasedFlags") ); initialzeDdiTable.Event.pfnQueryKernelTimestampsExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeEventQueryKernelTimestampsExt") ); initialzeDdiTable.Event.pfnGetEventPool = reinterpret_cast( @@ -700,6 +768,18 @@ namespace ze_lib result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetExecutableGraphProcAddrTable( version, &initialzeDdiTable.ExecutableGraph ); + } + + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetGraphProcAddrTable( version, &initialzeDdiTable.Graph ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional diff --git a/source/lib/ze_tracing_register_cb_libapi.cpp b/source/lib/ze_tracing_register_cb_libapi.cpp index 7dd2b793..c302c210 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -718,6 +718,31 @@ zelTracerDeviceGetAggregatedCopyOffloadIncrementValueRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCounterBasedEventMaxValueRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb + ) { + + 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_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetCounterBasedEventMaxValueRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetCounterBasedEventMaxValueCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceGetRuntimeRequirementsRegisterCallback( zel_tracer_handle_t hTracer, @@ -1043,6 +1068,81 @@ zelTracerCommandQueueGetIndexRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb + ) { + + 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_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandQueueGetFlagsRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetFlagsCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetModeCb_t pfnGetModeCb + ) { + + 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_pfnCommandQueueGetModeCb_t pfnGetModeCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandQueueGetModeRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetModeCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb + ) { + + 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_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandQueueGetPriorityRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetPriorityCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -1343,6 +1443,106 @@ zelTracerCommandListIsImmediateRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetFlagsCb_t pfnGetFlagsCb + ) { + + 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_pfnCommandListGetFlagsCb_t pfnGetFlagsCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetFlagsRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetFlagsCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb + ) { + + 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_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateGetFlagsRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnImmediateGetFlagsCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetModeRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb + ) { + + 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_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateGetModeRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnImmediateGetModeCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListImmediateGetPriorityRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb + ) { + + 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_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateGetPriorityRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnImmediateGetPriorityCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendBarrierRegisterCallback( zel_tracer_handle_t hTracer, @@ -2393,6 +2593,31 @@ zelTracerEventPoolGetFlagsRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerEventGetCounterBasedFlagsRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnEventGetCounterBasedFlagsCb_t pfnGetCounterBasedFlagsCb + ) { + + 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_pfnEventGetCounterBasedFlagsCb_t pfnGetCounterBasedFlagsCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventGetCounterBasedFlagsRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetCounterBasedFlagsCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerFenceCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -4519,10 +4744,10 @@ zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReserveCacheExtRegisterCallback( +zelTracerGraphCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4530,24 +4755,24 @@ zelTracerDeviceReserveCacheExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReserveCacheExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphCreateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnReserveCacheExtCb); + return func(hTracer, callback_type, pfnCreateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceSetCacheAdviceExtRegisterCallback( +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4555,24 +4780,24 @@ zelTracerDeviceSetCacheAdviceExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceSetCacheAdviceExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginGraphCaptureExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnSetCacheAdviceExtCb); + return func(hTracer, callback_type, pfnBeginGraphCaptureExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryTimestampsExpRegisterCallback( +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4580,24 +4805,24 @@ zelTracerEventQueryTimestampsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryTimestampsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnQueryTimestampsExpCb); + return func(hTracer, callback_type, pfnBeginCaptureIntoGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetMemoryPropertiesExpRegisterCallback( +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4605,24 +4830,24 @@ zelTracerImageGetMemoryPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetMemoryPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetMemoryPropertiesExpCb); + return func(hTracer, callback_type, pfnIsGraphCaptureEnabledExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExtRegisterCallback( +zelTracerCommandListEndGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4630,24 +4855,24 @@ zelTracerImageViewCreateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListEndGraphCaptureExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnViewCreateExtCb); + return func(hTracer, callback_type, pfnEndGraphCaptureExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExpRegisterCallback( +zelTracerCommandListGetGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4655,24 +4880,24 @@ zelTracerImageViewCreateExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnViewCreateExpCb); + return func(hTracer, callback_type, pfnGetGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelSchedulingHintExpRegisterCallback( +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4680,24 +4905,24 @@ zelTracerKernelSchedulingHintExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelSchedulingHintExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphGetPrimaryCommandListExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnSchedulingHintExpCb); + return func(hTracer, callback_type, pfnGetPrimaryCommandListExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDevicePciGetPropertiesExtRegisterCallback( +zelTracerGraphSetDestructionCallbackExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4705,24 +4930,24 @@ zelTracerDevicePciGetPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDevicePciGetPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphSetDestructionCallbackExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnPciGetPropertiesExtCb); + return func(hTracer, callback_type, pfnSetDestructionCallbackExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( +zelTracerGraphInstantiateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4730,24 +4955,24 @@ zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphInstantiateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendImageCopyToMemoryExtCb); + return func(hTracer, callback_type, pfnInstantiateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( +zelTracerCommandListAppendGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4755,24 +4980,24 @@ zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendImageCopyFromMemoryExtCb); + return func(hTracer, callback_type, pfnAppendGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetAllocPropertiesExtRegisterCallback( +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4780,24 +5005,24 @@ zelTracerImageGetAllocPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetAllocPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphGetSourceGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetAllocPropertiesExtCb); + return func(hTracer, callback_type, pfnGetSourceGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerModuleInspectLinkageExtRegisterCallback( +zelTracerGraphIsEmptyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4805,24 +5030,24 @@ zelTracerModuleInspectLinkageExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerModuleInspectLinkageExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphIsEmptyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnInspectLinkageExtCb); + return func(hTracer, callback_type, pfnIsEmptyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemFreeExtRegisterCallback( +zelTracerGraphDumpContentsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4830,24 +5055,24 @@ zelTracerMemFreeExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemFreeExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDumpContentsExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnFreeExtCb); + return func(hTracer, callback_type, pfnDumpContentsExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetExpRegisterCallback( +zelTracerExecutableGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4855,24 +5080,424 @@ zelTracerFabricVertexGetExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphDestroyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetExpCb); + return func(hTracer, callback_type, pfnDestroyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetSubVerticesExpRegisterCallback( +zelTracerGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ) { + + 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_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDestroyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnDestroyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendHostFunctionRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ) { + + 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_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendHostFunctionRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnAppendHostFunctionCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceReserveCacheExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ) { + + 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_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReserveCacheExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnReserveCacheExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceSetCacheAdviceExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ) { + + 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_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceSetCacheAdviceExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnSetCacheAdviceExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerEventQueryTimestampsExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ) { + + 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_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryTimestampsExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnQueryTimestampsExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerImageGetMemoryPropertiesExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ) { + + 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_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetMemoryPropertiesExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetMemoryPropertiesExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerImageViewCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ) { + + 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_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnViewCreateExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerImageViewCreateExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ) { + + 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_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnViewCreateExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerKernelSchedulingHintExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ) { + + 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_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelSchedulingHintExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnSchedulingHintExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDevicePciGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ) { + + 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_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDevicePciGetPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnPciGetPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ) { + + 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_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnAppendImageCopyToMemoryExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ) { + + 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_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnAppendImageCopyFromMemoryExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerImageGetAllocPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ) { + + 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_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetAllocPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetAllocPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerModuleInspectLinkageExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ) { + + 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_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerModuleInspectLinkageExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnInspectLinkageExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerMemFreeExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnMemFreeExtCb_t pfnFreeExtCb + ) { + + 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_pfnMemFreeExtCb_t pfnFreeExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemFreeExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnFreeExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerFabricVertexGetExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ) { + + 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_pfnFabricVertexGetExpCb_t pfnGetExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerFabricVertexGetSubVerticesExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5493,6 +6118,31 @@ zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListIsMutableExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ) { + + 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_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsMutableExpRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnIsMutableExpCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index 97c7698f..3ab25ad7 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -3721,13 +3721,11 @@ zetMetricGroupCalculateMultipleMetricValuesExp( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns metric timestamps synchronized with global device timestamps, -/// optionally synchronized with host +/// @brief Returns metric timestamps synchronized with either host or device +/// timestamps at the time of invoking the function /// /// @details /// - The application may call this function from simultaneous threads. -/// - By default, the global and metrics timestamps are synchronized to the -/// device. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3751,9 +3749,11 @@ zetMetricGroupCalculateMultipleMetricValuesExp( ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { #ifdef L0_STATIC_LOADER_BUILD diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 578a0118..7857f3e6 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -43,6 +43,12 @@ namespace loader return result; } // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. + zeGetExecutableGraphProcAddrTableFromDriver(driver); + result = ZE_RESULT_SUCCESS; + // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. + zeGetGraphProcAddrTableFromDriver(driver); + result = ZE_RESULT_SUCCESS; + // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. zeGetRTASBuilderProcAddrTableFromDriver(driver); result = ZE_RESULT_SUCCESS; // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. @@ -1162,10 +1168,15 @@ namespace loader __zedlllocal ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -1234,6 +1245,33 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCounterBasedEventMaxValue + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetCounterBasedEventMaxValue = dditable->ze.Device.pfnGetCounterBasedEventMaxValue; + if( nullptr == pfnGetCounterBasedEventMaxValue ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceGetRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL @@ -1657,6 +1695,81 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->dditable; + auto pfnGetFlags = dditable->ze.CommandQueue.pfnGetFlags; + if( nullptr == pfnGetFlags ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCmdQueue = reinterpret_cast( hCmdQueue )->handle; + + // forward to device-driver + result = pfnGetFlags( hCmdQueue, pFlags ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->dditable; + auto pfnGetMode = dditable->ze.CommandQueue.pfnGetMode; + if( nullptr == pfnGetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCmdQueue = reinterpret_cast( hCmdQueue )->handle; + + // forward to device-driver + result = pfnGetMode( hCmdQueue, pMode ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->dditable; + auto pfnGetPriority = dditable->ze.CommandQueue.pfnGetPriority; + if( nullptr == pfnGetPriority ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCmdQueue = reinterpret_cast( hCmdQueue )->handle; + + // forward to device-driver + result = pfnGetPriority( hCmdQueue, pPriority ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListCreate __zedlllocal ze_result_t ZE_APICALL @@ -2049,6 +2162,106 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnGetFlags = dditable->ze.CommandList.pfnGetFlags; + if( nullptr == pfnGetFlags ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnGetFlags( hCommandList, pFlags ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnImmediateGetFlags = dditable->ze.CommandList.pfnImmediateGetFlags; + if( nullptr == pfnImmediateGetFlags ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnImmediateGetFlags( hCommandList, pFlags ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnImmediateGetMode = dditable->ze.CommandList.pfnImmediateGetMode; + if( nullptr == pfnImmediateGetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnImmediateGetMode( hCommandList, pMode ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnImmediateGetPriority = dditable->ze.CommandList.pfnImmediateGetPriority; + if( nullptr == pfnImmediateGetPriority ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnImmediateGetPriority( hCommandList, pPriority ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendBarrier __zedlllocal ze_result_t ZE_APICALL @@ -3524,6 +3737,32 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetCounterBasedFlags + __zedlllocal ze_result_t ZE_APICALL + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hEvent )->dditable; + auto pfnGetCounterBasedFlags = dditable->ze.Event.pfnGetCounterBasedFlags; + if( nullptr == pfnGetCounterBasedFlags ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hEvent = reinterpret_cast( hEvent )->handle; + + // forward to device-driver + result = pfnGetCounterBasedFlags( hEvent, pFlags ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeFenceCreate __zedlllocal ze_result_t ZE_APICALL @@ -6308,146 +6547,693 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnReserveCacheExt = dditable->ze.Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnCreateExt = dditable->ze.Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hContext = reinterpret_cast( hContext )->handle; // forward to device-driver - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnCreateExt( hContext, pNext, phGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnSetCacheAdviceExt = dditable->ze.Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnBeginGraphCaptureExt = dditable->ze.CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hEvent )->dditable; - auto pfnQueryTimestampsExp = dditable->ze.EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnBeginCaptureIntoGraphExt = dditable->ze.CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hEvent = reinterpret_cast( hEvent )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hImage )->dditable; - auto pfnGetMemoryPropertiesExp = dditable->ze.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnIsGraphCaptureEnabledExt = dditable->ze.CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + result = pfnIsGraphCaptureEnabledExt( hCommandList ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnViewCreateExt = dditable->ze.Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnEndGraphCaptureExt = dditable->ze.CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + // forward to device-driver + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnGetGraphExt = dditable->ze.CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnGetGraphExt( hCommandList, phGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnGetPrimaryCommandListExt = dditable->ze.Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phCommandList = reinterpret_cast( + context->ze_command_list_factory.getInstance( *phCommandList, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphSetDestructionCallbackExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnSetDestructionCallbackExt = dditable->ze.Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphInstantiateExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnInstantiateExt = dditable->ze.Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phExecutableGraph = reinterpret_cast( + context->ze_executable_graph_factory.getInstance( *phExecutableGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendGraphExt = dditable->ze.CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // convert loader handle to driver handle + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + + // forward to device-driver + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnGetSourceGraphExt = dditable->ze.ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phSourceGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phSourceGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphIsEmptyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnIsEmptyExt = dditable->ze.Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnIsEmptyExt( hGraph ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDumpContentsExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDumpContentsExt = dditable->ze.Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnDumpContentsExt( hGraph, filePath, pNext ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDestroyExt = dditable->ze.ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnDestroyExt( hGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_executable_graph_factory.release( hGraph ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDestroyExt = dditable->ze.Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnDestroyExt( hGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_graph_factory.release( hGraph ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendHostFunction + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendHostFunction = dditable->ze.CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + + // forward to device-driver + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceReserveCacheExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnReserveCacheExt = dditable->ze.Device.pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceSetCacheAdviceExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnSetCacheAdviceExt = dditable->ze.Device.pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventQueryTimestampsExp + __zedlllocal ze_result_t ZE_APICALL + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hEvent )->dditable; + auto pfnQueryTimestampsExp = dditable->ze.EventExp.pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hEvent = reinterpret_cast( hEvent )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetMemoryPropertiesExp + __zedlllocal ze_result_t ZE_APICALL + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hImage )->dditable; + auto pfnGetMemoryPropertiesExp = dditable->ze.ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hImage = reinterpret_cast( hImage )->handle; + + // forward to device-driver + result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageViewCreateExt + __zedlllocal ze_result_t ZE_APICALL + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnViewCreateExt = dditable->ze.Image.pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hContext = reinterpret_cast( hContext )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; // convert loader handle to driver handle hImage = reinterpret_cast( hImage )->handle; @@ -7707,6 +8493,32 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsMutableExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnIsMutableExp = dditable->ze.CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnIsMutableExp( hCommandList, pIsMutable ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL @@ -7820,6 +8632,31 @@ zeGetGlobalProcAddrTableLegacy() loader::loaderDispatch->pCore->Global->pfnInitDrivers = loader::zeInitDrivers; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for ExecutableGraph table +__zedlllocal void ZE_APICALL +zeGetExecutableGraphProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->ExecutableGraph->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; + loader::loaderDispatch->pCore->ExecutableGraph->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Graph table +__zedlllocal void ZE_APICALL +zeGetGraphProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Graph->pfnCreateExt = loader::zeGraphCreateExt; + loader::loaderDispatch->pCore->Graph->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; + loader::loaderDispatch->pCore->Graph->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; + loader::loaderDispatch->pCore->Graph->pfnInstantiateExt = loader::zeGraphInstantiateExt; + loader::loaderDispatch->pCore->Graph->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; + loader::loaderDispatch->pCore->Graph->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; + loader::loaderDispatch->pCore->Graph->pfnDestroyExt = loader::zeGraphDestroyExt; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief function for filling the legacy api pointers for RTASBuilder table __zedlllocal void ZE_APICALL @@ -7924,6 +8761,7 @@ zeGetDeviceProcAddrTableLegacy() loader::loaderDispatch->pCore->Device->pfnGetRuntimeRequirements = loader::zeDeviceGetRuntimeRequirements; 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->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; loader::loaderDispatch->pCore->Device->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; loader::loaderDispatch->pCore->Device->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; @@ -7966,6 +8804,9 @@ zeGetCommandQueueProcAddrTableLegacy() loader::loaderDispatch->pCore->CommandQueue->pfnDestroy = loader::zeCommandQueueDestroy; loader::loaderDispatch->pCore->CommandQueue->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; loader::loaderDispatch->pCore->CommandQueue->pfnSynchronize = loader::zeCommandQueueSynchronize; + 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->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; loader::loaderDispatch->pCore->CommandQueue->pfnGetIndex = loader::zeCommandQueueGetIndex; } @@ -8009,6 +8850,17 @@ zeGetCommandListProcAddrTableLegacy() loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryCopyWithParameters = loader::zeCommandListAppendMemoryCopyWithParameters; loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryFillWithParameters = loader::zeCommandListAppendMemoryFillWithParameters; loader::loaderDispatch->pCore->CommandList->pfnImmediateAppendCommandListsWithParameters = loader::zeCommandListImmediateAppendCommandListsWithParameters; + loader::loaderDispatch->pCore->CommandList->pfnGetFlags = loader::zeCommandListGetFlags; + loader::loaderDispatch->pCore->CommandList->pfnImmediateGetFlags = loader::zeCommandListImmediateGetFlags; + loader::loaderDispatch->pCore->CommandList->pfnImmediateGetMode = loader::zeCommandListImmediateGetMode; + loader::loaderDispatch->pCore->CommandList->pfnImmediateGetPriority = loader::zeCommandListImmediateGetPriority; + loader::loaderDispatch->pCore->CommandList->pfnBeginGraphCaptureExt = loader::zeCommandListBeginGraphCaptureExt; + loader::loaderDispatch->pCore->CommandList->pfnBeginCaptureIntoGraphExt = loader::zeCommandListBeginCaptureIntoGraphExt; + loader::loaderDispatch->pCore->CommandList->pfnIsGraphCaptureEnabledExt = loader::zeCommandListIsGraphCaptureEnabledExt; + loader::loaderDispatch->pCore->CommandList->pfnEndGraphCaptureExt = loader::zeCommandListEndGraphCaptureExt; + 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->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; loader::loaderDispatch->pCore->CommandList->pfnHostSynchronize = loader::zeCommandListHostSynchronize; @@ -8027,6 +8879,7 @@ zeGetCommandListExpProcAddrTableLegacy() // return pointers to the Loader's Functions. loader::loaderDispatch->pCore->CommandListExp->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; loader::loaderDispatch->pCore->CommandListExp->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; + loader::loaderDispatch->pCore->CommandListExp->pfnIsMutableExp = loader::zeCommandListIsMutableExp; loader::loaderDispatch->pCore->CommandListExp->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; loader::loaderDispatch->pCore->CommandListExp->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; loader::loaderDispatch->pCore->CommandListExp->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; @@ -8053,6 +8906,7 @@ zeGetEventProcAddrTableLegacy() loader::loaderDispatch->pCore->Event->pfnCounterBasedOpenIpcHandle = loader::zeEventCounterBasedOpenIpcHandle; loader::loaderDispatch->pCore->Event->pfnCounterBasedCloseIpcHandle = loader::zeEventCounterBasedCloseIpcHandle; loader::loaderDispatch->pCore->Event->pfnCounterBasedGetDeviceAddress = loader::zeEventCounterBasedGetDeviceAddress; + loader::loaderDispatch->pCore->Event->pfnGetCounterBasedFlags = loader::zeEventGetCounterBasedFlags; loader::loaderDispatch->pCore->Event->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; loader::loaderDispatch->pCore->Event->pfnGetEventPool = loader::zeEventGetEventPool; loader::loaderDispatch->pCore->Event->pfnGetSignalScope = loader::zeEventGetSignalScope; @@ -8303,6 +9157,50 @@ zeGetGlobalProcAddrTableFromDriver(loader::driver_t *driver) return result; } /////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +__zedlllocal ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver) +{ + ze_result_t result = ZE_RESULT_SUCCESS; + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.ExecutableGraph); + return result; +} +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +__zedlllocal ze_result_t ZE_APICALL +zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver) +{ + ze_result_t result = ZE_RESULT_SUCCESS; + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zeGetGraphProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.Graph); + return result; +} +/////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses /// @@ -8983,7 +9881,119 @@ zeGetFabricEdgeExpProcAddrTableFromDriver(loader::driver_t *driver) return result; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's FabricVertexExp table +/// @brief Exported function for filling application's FabricVertexExp table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +__zedlllocal ze_result_t ZE_APICALL +zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver) +{ + ze_result_t result = ZE_RESULT_SUCCESS; + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zeGetFabricVertexExpProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.FabricVertexExp); + return result; +} +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Global table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGlobalProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( loader::context->zeDrivers.size() < 1 ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( loader::context->version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + loader::context->ddi_init_version = version; + + ze_result_t result = ZE_RESULT_SUCCESS; + + auto driverCount = loader::context->zeDrivers.size(); + auto firstDriver = &loader::context->zeDrivers[0]; + if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { + result = zeGetGlobalProcAddrTableFromDriver(firstDriver); + } + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Global = new ze_global_dditable_t; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = loader::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + } + zeGetGlobalProcAddrTableLegacy(); + } + else + { + // return pointers directly to driver's DDIs + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = firstDriver->dditable.ze.Global.pfnInit; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = firstDriver->dditable.ze.Global.pfnInitDrivers; + } + } + } + + // If the validation layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGlobalProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + // If the API tracing layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGlobalProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_global_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_global_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.Global = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table /// with current process' addresses /// /// @returns @@ -8991,21 +10001,97 @@ zeGetFabricEdgeExpProcAddrTableFromDriver(loader::driver_t *driver) /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -__zedlllocal ze_result_t ZE_APICALL -zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver) +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) { + if( loader::context->zeDrivers.size() < 1 ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( loader::context->version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + loader::context->ddi_init_version = version; + ze_result_t result = ZE_RESULT_SUCCESS; - if(driver->initStatus != ZE_RESULT_SUCCESS) - return driver->initStatus; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( driver->handle, "zeGetFabricVertexExpProcAddrTable") ); - if(!getTable) - return driver->initStatus; - result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.FabricVertexExp); + + auto driverCount = loader::context->zeDrivers.size(); + auto firstDriver = &loader::context->zeDrivers[0]; + if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { + result = zeGetExecutableGraphProcAddrTableFromDriver(firstDriver); + } + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + loader::loaderDispatch->pCore->ExecutableGraph = new ze_executable_graph_dditable_t; + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSourceGraphExt = loader_driver_ddi::zeExecutableGraphGetSourceGraphExt; + } else { + pDdiTable->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeExecutableGraphDestroyExt; + } else { + pDdiTable->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; + } + } + zeGetExecutableGraphProcAddrTableLegacy(); + } + else + { + // return pointers directly to driver's DDIs + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetSourceGraphExt = firstDriver->dditable.ze.ExecutableGraph.pfnGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.ExecutableGraph.pfnDestroyExt; + } + } + } + + // If the validation layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + // If the API tracing layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_executable_graph_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_executable_graph_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.ExecutableGraph = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + return result; } + /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Global table +/// @brief Exported function for filling application's Graph table /// with current process' addresses /// /// @returns @@ -9014,9 +10100,9 @@ zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver) /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGlobalProcAddrTable( +zeGetGraphProcAddrTable( ze_api_version_t version, ///< [in] API version requested - ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers ) { if( loader::context->zeDrivers.size() < 1 ) { @@ -9036,7 +10122,7 @@ zeGetGlobalProcAddrTable( auto driverCount = loader::context->zeDrivers.size(); auto firstDriver = &loader::context->zeDrivers[0]; if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { - result = zeGetGlobalProcAddrTableFromDriver(firstDriver); + result = zeGetGraphProcAddrTableFromDriver(firstDriver); } if( ZE_RESULT_SUCCESS == result ) @@ -9044,23 +10130,81 @@ zeGetGlobalProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - loader::loaderDispatch->pCore->Global = new ze_global_dditable_t; - if (version >= ZE_API_VERSION_1_0) { - pDdiTable->pfnInit = loader::zeInit; + loader::loaderDispatch->pCore->Graph = new ze_graph_dditable_t; + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExt = loader_driver_ddi::zeGraphCreateExt; + } else { + pDdiTable->pfnCreateExt = loader::zeGraphCreateExt; } - if (version >= ZE_API_VERSION_1_10) { - pDdiTable->pfnInitDrivers = loader::zeInitDrivers; } - zeGetGlobalProcAddrTableLegacy(); + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPrimaryCommandListExt = loader_driver_ddi::zeGraphGetPrimaryCommandListExt; + } else { + pDdiTable->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetDestructionCallbackExt = loader_driver_ddi::zeGraphSetDestructionCallbackExt; + } else { + pDdiTable->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnInstantiateExt = loader_driver_ddi::zeGraphInstantiateExt; + } else { + pDdiTable->pfnInstantiateExt = loader::zeGraphInstantiateExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnIsEmptyExt = loader_driver_ddi::zeGraphIsEmptyExt; + } else { + pDdiTable->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDumpContentsExt = loader_driver_ddi::zeGraphDumpContentsExt; + } else { + pDdiTable->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeGraphDestroyExt; + } else { + pDdiTable->pfnDestroyExt = loader::zeGraphDestroyExt; + } + } + zeGetGraphProcAddrTableLegacy(); } else { // return pointers directly to driver's DDIs - if (version >= ZE_API_VERSION_1_0) { - pDdiTable->pfnInit = firstDriver->dditable.ze.Global.pfnInit; + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnCreateExt = firstDriver->dditable.ze.Graph.pfnCreateExt; } - if (version >= ZE_API_VERSION_1_10) { - pDdiTable->pfnInitDrivers = firstDriver->dditable.ze.Global.pfnInitDrivers; + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPrimaryCommandListExt = firstDriver->dditable.ze.Graph.pfnGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnSetDestructionCallbackExt = firstDriver->dditable.ze.Graph.pfnSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnInstantiateExt = firstDriver->dditable.ze.Graph.pfnInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsEmptyExt = firstDriver->dditable.ze.Graph.pfnIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDumpContentsExt = firstDriver->dditable.ze.Graph.pfnDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.Graph.pfnDestroyExt; } } } @@ -9068,8 +10212,8 @@ zeGetGlobalProcAddrTable( // If the validation layer is enabled, then intercept the loader's DDIs if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGlobalProcAddrTable") ); + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGraphProcAddrTable") ); if(!getTable) return ZE_RESULT_ERROR_UNINITIALIZED; result = getTable( version, pDdiTable ); @@ -9078,14 +10222,14 @@ zeGetGlobalProcAddrTable( // If the API tracing layer is enabled, then intercept the loader's DDIs if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGlobalProcAddrTable") ); + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGraphProcAddrTable") ); if(!getTable) return ZE_RESULT_ERROR_UNINITIALIZED; - ze_global_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_global_dditable_t)); + ze_graph_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_graph_dditable_t)); result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.Global = dditable; + loader::context->tracing_dditable.ze.Graph = dditable; if ( loader::context->tracingLayerEnabled ) { result = getTable( version, pDdiTable ); } @@ -10030,6 +11174,13 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnValidateRuntimeRequirements = loader::zeDeviceValidateRuntimeRequirements; } } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCounterBasedEventMaxValue = loader_driver_ddi::zeDeviceGetCounterBasedEventMaxValue; + } else { + pDdiTable->pfnGetCounterBasedEventMaxValue = loader::zeDeviceGetCounterBasedEventMaxValue; + } + } if (version >= ZE_API_VERSION_1_2) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnReserveCacheExt = loader_driver_ddi::zeDeviceReserveCacheExt; @@ -10132,6 +11283,9 @@ zeGetDeviceProcAddrTable( if (version >= ZE_API_VERSION_1_16) { pDdiTable->pfnValidateRuntimeRequirements = firstDriver->dditable.ze.Device.pfnValidateRuntimeRequirements; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetCounterBasedEventMaxValue = firstDriver->dditable.ze.Device.pfnGetCounterBasedEventMaxValue; + } if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = firstDriver->dditable.ze.Device.pfnReserveCacheExt; } @@ -10501,6 +11655,27 @@ zeGetCommandQueueProcAddrTable( pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; } } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFlags = loader_driver_ddi::zeCommandQueueGetFlags; + } else { + pDdiTable->pfnGetFlags = loader::zeCommandQueueGetFlags; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMode = loader_driver_ddi::zeCommandQueueGetMode; + } else { + pDdiTable->pfnGetMode = loader::zeCommandQueueGetMode; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPriority = loader_driver_ddi::zeCommandQueueGetPriority; + } else { + pDdiTable->pfnGetPriority = loader::zeCommandQueueGetPriority; + } + } if (version >= ZE_API_VERSION_1_9) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnGetOrdinal = loader_driver_ddi::zeCommandQueueGetOrdinal; @@ -10532,6 +11707,15 @@ zeGetCommandQueueProcAddrTable( if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSynchronize = firstDriver->dditable.ze.CommandQueue.pfnSynchronize; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetFlags = firstDriver->dditable.ze.CommandQueue.pfnGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetMode = firstDriver->dditable.ze.CommandQueue.pfnGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPriority = firstDriver->dditable.ze.CommandQueue.pfnGetPriority; + } if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = firstDriver->dditable.ze.CommandQueue.pfnGetOrdinal; } @@ -10842,6 +12026,83 @@ zeGetCommandListProcAddrTable( pDdiTable->pfnImmediateAppendCommandListsWithParameters = loader::zeCommandListImmediateAppendCommandListsWithParameters; } } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFlags = loader_driver_ddi::zeCommandListGetFlags; + } else { + pDdiTable->pfnGetFlags = loader::zeCommandListGetFlags; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImmediateGetFlags = loader_driver_ddi::zeCommandListImmediateGetFlags; + } else { + pDdiTable->pfnImmediateGetFlags = loader::zeCommandListImmediateGetFlags; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImmediateGetMode = loader_driver_ddi::zeCommandListImmediateGetMode; + } else { + pDdiTable->pfnImmediateGetMode = loader::zeCommandListImmediateGetMode; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImmediateGetPriority = loader_driver_ddi::zeCommandListImmediateGetPriority; + } else { + pDdiTable->pfnImmediateGetPriority = loader::zeCommandListImmediateGetPriority; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnBeginGraphCaptureExt = loader_driver_ddi::zeCommandListBeginGraphCaptureExt; + } else { + pDdiTable->pfnBeginGraphCaptureExt = loader::zeCommandListBeginGraphCaptureExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnBeginCaptureIntoGraphExt = loader_driver_ddi::zeCommandListBeginCaptureIntoGraphExt; + } else { + pDdiTable->pfnBeginCaptureIntoGraphExt = loader::zeCommandListBeginCaptureIntoGraphExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnIsGraphCaptureEnabledExt = loader_driver_ddi::zeCommandListIsGraphCaptureEnabledExt; + } else { + pDdiTable->pfnIsGraphCaptureEnabledExt = loader::zeCommandListIsGraphCaptureEnabledExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEndGraphCaptureExt = loader_driver_ddi::zeCommandListEndGraphCaptureExt; + } else { + pDdiTable->pfnEndGraphCaptureExt = loader::zeCommandListEndGraphCaptureExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetGraphExt = loader_driver_ddi::zeCommandListGetGraphExt; + } else { + pDdiTable->pfnGetGraphExt = loader::zeCommandListGetGraphExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendGraphExt = loader_driver_ddi::zeCommandListAppendGraphExt; + } else { + pDdiTable->pfnAppendGraphExt = loader::zeCommandListAppendGraphExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendHostFunction = loader_driver_ddi::zeCommandListAppendHostFunction; + } else { + pDdiTable->pfnAppendHostFunction = loader::zeCommandListAppendHostFunction; + } + } if (version >= ZE_API_VERSION_1_3) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnAppendImageCopyToMemoryExt = loader_driver_ddi::zeCommandListAppendImageCopyToMemoryExt; @@ -11002,6 +12263,39 @@ zeGetCommandListProcAddrTable( if (version >= ZE_API_VERSION_1_16) { pDdiTable->pfnImmediateAppendCommandListsWithParameters = firstDriver->dditable.ze.CommandList.pfnImmediateAppendCommandListsWithParameters; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetFlags = firstDriver->dditable.ze.CommandList.pfnGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetFlags = firstDriver->dditable.ze.CommandList.pfnImmediateGetFlags; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetMode = firstDriver->dditable.ze.CommandList.pfnImmediateGetMode; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnImmediateGetPriority = firstDriver->dditable.ze.CommandList.pfnImmediateGetPriority; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnBeginGraphCaptureExt = firstDriver->dditable.ze.CommandList.pfnBeginGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnBeginCaptureIntoGraphExt = firstDriver->dditable.ze.CommandList.pfnBeginCaptureIntoGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsGraphCaptureEnabledExt = firstDriver->dditable.ze.CommandList.pfnIsGraphCaptureEnabledExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnEndGraphCaptureExt = firstDriver->dditable.ze.CommandList.pfnEndGraphCaptureExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetGraphExt = firstDriver->dditable.ze.CommandList.pfnGetGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnAppendGraphExt = firstDriver->dditable.ze.CommandList.pfnAppendGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnAppendHostFunction = firstDriver->dditable.ze.CommandList.pfnAppendHostFunction; + } if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyToMemoryExt = firstDriver->dditable.ze.CommandList.pfnAppendImageCopyToMemoryExt; } @@ -11113,6 +12407,13 @@ zeGetCommandListExpProcAddrTable( pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; } } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnIsMutableExp = loader_driver_ddi::zeCommandListIsMutableExp; + } else { + pDdiTable->pfnIsMutableExp = loader::zeCommandListIsMutableExp; + } + } if (version >= ZE_API_VERSION_1_9) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnCreateCloneExp = loader_driver_ddi::zeCommandListCreateCloneExp; @@ -11166,6 +12467,9 @@ zeGetCommandListExpProcAddrTable( if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnUpdateMutableCommandKernelsExp = firstDriver->dditable.ze.CommandListExp.pfnUpdateMutableCommandKernelsExp; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsMutableExp = firstDriver->dditable.ze.CommandListExp.pfnIsMutableExp; + } if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCreateCloneExp = firstDriver->dditable.ze.CommandListExp.pfnCreateCloneExp; } @@ -11341,6 +12645,13 @@ zeGetEventProcAddrTable( pDdiTable->pfnCounterBasedGetDeviceAddress = loader::zeEventCounterBasedGetDeviceAddress; } } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCounterBasedFlags = loader_driver_ddi::zeEventGetCounterBasedFlags; + } else { + pDdiTable->pfnGetCounterBasedFlags = loader::zeEventGetCounterBasedFlags; + } + } if (version >= ZE_API_VERSION_1_6) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnQueryKernelTimestampsExt = loader_driver_ddi::zeEventQueryKernelTimestampsExt; @@ -11410,6 +12721,9 @@ zeGetEventProcAddrTable( if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedGetDeviceAddress = firstDriver->dditable.ze.Event.pfnCounterBasedGetDeviceAddress; } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetCounterBasedFlags = firstDriver->dditable.ze.Event.pfnGetCounterBasedFlags; + } if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnQueryKernelTimestampsExt = firstDriver->dditable.ze.Event.pfnQueryKernelTimestampsExt; } diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index c51e59f0..4b60eb69 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -76,6 +76,9 @@ namespace loader using ze_rtas_parallel_operation_ext_object_t = object_t < ze_rtas_parallel_operation_ext_handle_t >; using ze_rtas_parallel_operation_ext_factory_t = singleton_factory_t < ze_rtas_parallel_operation_ext_object_t, ze_rtas_parallel_operation_ext_handle_t >; + using ze_executable_graph_object_t = object_t < ze_executable_graph_handle_t >; + using ze_executable_graph_factory_t = singleton_factory_t < ze_executable_graph_object_t, ze_executable_graph_handle_t >; + using ze_rtas_builder_exp_object_t = object_t < ze_rtas_builder_exp_handle_t >; using ze_rtas_builder_exp_factory_t = singleton_factory_t < ze_rtas_builder_exp_object_t, ze_rtas_builder_exp_handle_t >; @@ -259,10 +262,15 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ); __zedlllocal ze_result_t ZE_APICALL zeDeviceSynchronize( @@ -274,6 +282,13 @@ namespace loader_driver_ddi uint32_t* incrementValue ///< [out] increment value that can be used for Event creation ); __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ); + __zedlllocal ze_result_t ZE_APICALL zeDeviceGetRuntimeRequirements( ze_device_handle_t hDevice, ///< [in] handle of the device const void* pObjDesc, ///< [in] describes the object for which the requirements are to be @@ -365,6 +380,21 @@ namespace loader_driver_ddi uint32_t* pIndex ///< [out] command queue index within the group ); __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListCreate( ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -440,6 +470,26 @@ namespace loader_driver_ddi ///< command list (true) or not (false) ); __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListAppendBarrier( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion @@ -782,6 +832,12 @@ namespace loader_driver_ddi ///< valid combination of ::ze_event_pool_flag_t ); __zedlllocal ze_result_t ZE_APICALL + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ); + __zedlllocal ze_result_t ZE_APICALL zeFenceCreate( ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor @@ -1428,6 +1484,113 @@ namespace loader_driver_ddi ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ); __zedlllocal ze_result_t ZE_APICALL + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ); + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + 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 zeDeviceReserveCacheExt( ze_device_handle_t hDevice, ///< [in] handle of the device object size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the @@ -1755,6 +1918,12 @@ namespace loader_driver_ddi ///< be chained via `pNext` member ); __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListUpdateMutableCommandSignalEventExp( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list uint64_t commandId, ///< [in] command identifier @@ -1787,6 +1956,14 @@ zeGetGlobalProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zeGetGlobalProcAddrTableFromDriver(loader::driver_t *driver); __zedlllocal void ZE_APICALL +zeGetExecutableGraphProcAddrTableLegacy(); +__zedlllocal ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver); +__zedlllocal void ZE_APICALL +zeGetGraphProcAddrTableLegacy(); +__zedlllocal ze_result_t ZE_APICALL +zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver); +__zedlllocal void ZE_APICALL zeGetRTASBuilderProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zeGetRTASBuilderProcAddrTableFromDriver(loader::driver_t *driver); diff --git a/source/loader/ze_ldrddi_driver_ddi.cpp b/source/loader/ze_ldrddi_driver_ddi.cpp index f4708e87..82c07b4b 100644 --- a/source/loader/ze_ldrddi_driver_ddi.cpp +++ b/source/loader/ze_ldrddi_driver_ddi.cpp @@ -754,10 +754,15 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device - uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value. - uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value. + uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp in nanoseconds at the time + ///< of invoking the function. + uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp in tick counts at the + ///< time of invoking the function. + ///< To get the devicetime stamp in nanoseconds, resolve the tick counts + ///< using the timestampValidBits as mask together with timerResolution + ///< members of the ::ze_device_properties_t structure. + ///< For example: deviceTimestampinNS = (deviceTimestamp & + ///< timestampValidBits) * 1/timerResolution.(when timer resolution is in cycle/sec) ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -844,6 +849,39 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCounterBasedEventMaxValue + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCounterBasedEventMaxValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint64_t* maxValue ///< [out] maximum value that may appear under externally managed counter + ///< storage and that may be passed as `completionValue` when creating a + ///< Counter Based Event + ) + { + 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_17) { + 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 pfnGetCounterBasedEventMaxValue = dditable->Device->pfnGetCounterBasedEventMaxValue; + if( nullptr == pfnGetCounterBasedEventMaxValue ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetCounterBasedEventMaxValue( hDevice, maxValue ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceGetRuntimeRequirements __zedlllocal ze_result_t ZE_APICALL @@ -1273,6 +1311,99 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetFlags( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->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_17) { + 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 pfnGetFlags = dditable->CommandQueue->pfnGetFlags; + if( nullptr == pfnGetFlags ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetFlags( hCmdQueue, pFlags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetMode( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->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_17) { + 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 pfnGetMode = dditable->CommandQueue->pfnGetMode; + if( nullptr == pfnGetMode ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetMode( hCmdQueue, pMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueGetPriority( + ze_command_queue_handle_t hCmdQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command queue creation + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCmdQueue )->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_17) { + 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 pfnGetPriority = dditable->CommandQueue->pfnGetPriority; + if( nullptr == pfnGetPriority ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetPriority( hCmdQueue, pPriority ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListCreate __zedlllocal ze_result_t ZE_APICALL @@ -1660,6 +1791,130 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_list_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + 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_17) { + 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 pfnGetFlags = dditable->CommandList->pfnGetFlags; + if( nullptr == pfnGetFlags ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetFlags( hCommandList, pFlags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetFlags + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetFlags( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_flags_t* pFlags ///< [out] pointer to flags used during command list creation + ) + { + 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_17) { + 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 pfnImmediateGetFlags = dditable->CommandList->pfnImmediateGetFlags; + if( nullptr == pfnImmediateGetFlags ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnImmediateGetFlags( hCommandList, pFlags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetMode + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetMode( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_mode_t* pMode ///< [out] pointer to mode used during command list creation + ) + { + 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_17) { + 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 pfnImmediateGetMode = dditable->CommandList->pfnImmediateGetMode; + if( nullptr == pfnImmediateGetMode ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnImmediateGetMode( hCommandList, pMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetPriority + __zedlllocal ze_result_t ZE_APICALL + zeCommandListImmediateGetPriority( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_command_queue_priority_t* pPriority ///< [out] pointer to priority used during command list creation + ) + { + 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_17) { + 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 pfnImmediateGetPriority = dditable->CommandList->pfnImmediateGetPriority; + if( nullptr == pfnImmediateGetPriority ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnImmediateGetPriority( hCommandList, pPriority ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendBarrier __zedlllocal ze_result_t ZE_APICALL @@ -3094,6 +3349,38 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetCounterBasedFlags + __zedlllocal ze_result_t ZE_APICALL + zeEventGetCounterBasedFlags( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_counter_based_flags_t* pFlags ///< [out] flags used during creation of a counter based event; may be 0 or + ///< a valid combination of ::ze_event_counter_based_flag_t + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEvent )->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_17) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Event == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetCounterBasedFlags = dditable->Event->pfnGetCounterBasedFlags; + if( nullptr == pfnGetCounterBasedFlags ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetCounterBasedFlags( hEvent, pFlags ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeFenceCreate __zedlllocal ze_result_t ZE_APICALL @@ -5951,93 +6238,616 @@ namespace loader_driver_ddi } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + auto dditable = reinterpret_cast( hContext )->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_2) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserveCacheExt = dditable->Device->pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + auto pfnCreateExt = dditable->Graph->pfnCreateExt; + if( nullptr == pfnCreateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnCreateExt( hContext, pNext, phGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + 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_2) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheAdviceExt = dditable->Device->pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + auto pfnBeginGraphCaptureExt = dditable->CommandList->pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hEvent )->pCore; + 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_17) { + 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 pfnBeginCaptureIntoGraphExt = dditable->CommandList->pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ) + { + 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_17) { + 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 pfnIsGraphCaptureEnabledExt = dditable->CommandList->pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnIsGraphCaptureEnabledExt( hCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListEndGraphCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ) + { + 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_17) { + 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 pfnEndGraphCaptureExt = dditable->CommandList->pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ) + { + 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_17) { + 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 pfnGetGraphExt = dditable->CommandList->pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetGraphExt( hCommandList, phGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ) + { + 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_17) { + 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 pfnGetPrimaryCommandListExt = dditable->Graph->pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphSetDestructionCallbackExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + 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_17) { + 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 pfnSetDestructionCallbackExt = dditable->Graph->pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphInstantiateExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + 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_17) { + 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 pfnInstantiateExt = dditable->Graph->pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + 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_17) { + 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 pfnAppendGraphExt = dditable->CommandList->pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ) + { + 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_17) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->ExecutableGraph == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetSourceGraphExt = dditable->ExecutableGraph->pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphIsEmptyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ) + { + 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_17) { + 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 pfnIsEmptyExt = dditable->Graph->pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnIsEmptyExt( hGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDumpContentsExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ) + { + 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_17) { + 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 pfnDumpContentsExt = dditable->Graph->pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnDumpContentsExt( hGraph, filePath, pNext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeExecutableGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ) + { + 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_17) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->ExecutableGraph == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnDestroyExt = dditable->ExecutableGraph->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnDestroyExt( hGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ) + { + 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_17) { + 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 pfnDestroyExt = dditable->Graph->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnDestroyExt( hGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendHostFunction + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + 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_17) { + 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 pfnAppendHostFunction = dditable->CommandList->pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceReserveCacheExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ) + { + 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_2) { + 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 pfnReserveCacheExt = dditable->Device->pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceSetCacheAdviceExt + __zedlllocal ze_result_t ZE_APICALL + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ) + { + 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_2) { + 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 pfnSetCacheAdviceExt = dditable->Device->pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventQueryTimestampsExp + __zedlllocal ze_result_t ZE_APICALL + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEvent )->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 @@ -7291,6 +8101,38 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsMutableExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension + ) + { + 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_17) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnIsMutableExp = dditable->CommandListExp->pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnIsMutableExp( hCommandList, pIsMutable ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL @@ -7399,6 +8241,8 @@ namespace loader_driver_ddi { // Delete ddi tables delete pDdiTable->Global; + delete pDdiTable->ExecutableGraph; + delete pDdiTable->Graph; delete pDdiTable->RTASBuilder; delete pDdiTable->RTASBuilderExp; delete pDdiTable->RTASParallelOperation; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index 20fbada0..45dce29c 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -84,6 +84,7 @@ namespace loader ze_driver_factory_t ze_driver_factory; ze_event_factory_t ze_event_factory; ze_event_pool_factory_t ze_event_pool_factory; + ze_executable_graph_factory_t ze_executable_graph_factory; ze_external_semaphore_ext_factory_t ze_external_semaphore_ext_factory; ze_fabric_edge_factory_t ze_fabric_edge_factory; ze_fabric_vertex_factory_t ze_fabric_vertex_factory; diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 6552bc50..18d403bf 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -1886,9 +1886,11 @@ namespace loader __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/loader/zet_ldrddi.h b/source/loader/zet_ldrddi.h index 86db1443..9a3b05fe 100644 --- a/source/loader/zet_ldrddi.h +++ b/source/loader/zet_ldrddi.h @@ -551,9 +551,11 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ); __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetExportDataExp( diff --git a/source/loader/zet_ldrddi_driver_ddi.cpp b/source/loader/zet_ldrddi_driver_ddi.cpp index d52c0129..ebc4dff3 100644 --- a/source/loader/zet_ldrddi_driver_ddi.cpp +++ b/source/loader/zet_ldrddi_driver_ddi.cpp @@ -1870,9 +1870,11 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zetMetricGroupGetGlobalTimestampsExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] Returns the timestamps synchronized to the host or the device. - uint64_t* globalTimestamp, ///< [out] Device timestamp. - uint64_t* metricTimestamp ///< [out] Metric timestamp. + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/utils/ze_to_string.h b/source/utils/ze_to_string.h index 63442495..9795c6a3 100644 --- a/source/utils/ze_to_string.h +++ b/source/utils/ze_to_string.h @@ -116,6 +116,10 @@ inline std::string to_string(ze_rtas_parallel_operation_ext_handle_t handle) { return to_string(reinterpret_cast(handle)); } +inline std::string to_string(ze_executable_graph_handle_t handle) { + return to_string(reinterpret_cast(handle)); +} + inline std::string to_string(ze_rtas_builder_exp_handle_t handle) { return to_string(reinterpret_cast(handle)); } @@ -125,10 +129,18 @@ inline std::string to_string(ze_rtas_parallel_operation_exp_handle_t handle) { } // Callback to_string functions (function pointers) +// Multiple callback typedefs can resolve to the same underlying function-pointer +// type (e.g. void(*)(void*)). Since typedefs are aliases rather than distinct +// types in C++, emit only one to_string overload per unique signature +// (returntype + parameter types) to avoid redefinition errors. inline std::string to_string(ze_rtas_geometry_aabbs_cb_ext_t ptr) { return to_string(reinterpret_cast(ptr)); } +inline std::string to_string(zex_mem_graph_free_callback_fn_t ptr) { + return to_string(reinterpret_cast(ptr)); +} + inline std::string to_string(ze_rtas_geometry_aabbs_cb_exp_t ptr) { return to_string(reinterpret_cast(ptr)); } @@ -1321,6 +1333,20 @@ inline std::string to_string(const ze_float_atomic_ext_properties_t& desc) { return to_string(&desc); } +inline std::string to_string(const ze_relaxed_allocation_limits_ext_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_relaxed_allocation_limits_ext_desc_t& desc) { + return to_string(&desc); +} + inline std::string to_string(const ze_relaxed_allocation_limits_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; @@ -1868,6 +1894,48 @@ inline std::string to_string(const ze_ipc_mem_handle_type_ext_desc_t& desc) { return to_string(&desc); } +inline std::string to_string(const ze_record_replay_graph_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", graphFlags=" << to_string(&desc->graphFlags); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_record_replay_graph_ext_properties_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", mode=" << to_string(&desc->mode); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_device_readonly_memory_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", readonlyCapability=" << to_string(&desc->readonlyCapability); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_device_readonly_memory_ext_properties_t& desc) { + return to_string(&desc); +} + inline std::string to_string(const ze_cache_reservation_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; diff --git a/source/utils/zes_to_string.h b/source/utils/zes_to_string.h index 432fae19..ca319fb7 100644 --- a/source/utils/zes_to_string.h +++ b/source/utils/zes_to_string.h @@ -1235,6 +1235,35 @@ inline std::string to_string(const zes_pci_link_speed_downgrade_ext_properties_t return to_string(&desc); } +inline std::string to_string(const zes_device_ext_state_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_device_ext_state_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const zes_oem_serial_id_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", length=" << to_string(desc->length); + oss << ", oemSerialId=" << to_string(desc->oemSerialId); + oss << "}"; + return oss.str(); +} + +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_power_limit_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; From 638ce0ef4111b3ffafb10c01f4c7f78072953316 Mon Sep 17 00:00:00 2001 From: Russell McGuire Date: Thu, 25 Jun 2026 23:23:07 -0700 Subject: [PATCH 2/2] Bring in DDI table orderin fix from spec Bumping from 1.17.23 to 1.17.24 Signed-off-by: Russell McGuire --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- include/layers/zel_tracing_register_cb.h | 1046 +- include/ze.py | 3964 +++--- include/ze_api.h | 10540 ++++++++-------- include/ze_ddi.h | 270 +- include/ze_ddi_common.h | 2 +- include/zer.py | 2 +- include/zer_api.h | 2 +- include/zer_ddi.h | 2 +- include/zes.py | 300 +- include/zes_api.h | 488 +- include/zes_ddi.h | 2 +- include/zet.py | 330 +- include/zet_api.h | 2446 ++-- include/zet_ddi.h | 2 +- source/drivers/null/ze_nullddi.cpp | 1926 +-- source/drivers/null/zes_nullddi.cpp | 58 +- source/drivers/null/zet_nullddi.cpp | 944 +- source/layers/tracing/ze_tracing_cb_structs.h | 48 +- .../layers/tracing/ze_tracing_register_cb.cpp | 462 +- source/layers/tracing/ze_trcddi.cpp | 3348 ++--- .../generated/ze_certification.h | 306 +- .../generated/zes_certification.h | 12 +- .../generated/zet_certification.h | 118 +- .../ze_parameter_validation.cpp | 1666 +-- .../ze_parameter_validation.h | 68 +- .../zes_parameter_validation.cpp | 36 +- .../zes_parameter_validation.h | 2 +- .../zet_parameter_validation.cpp | 772 +- .../zet_parameter_validation.h | 26 +- .../validation/common/ze_entry_points.h | 136 +- .../validation/common/zes_entry_points.h | 4 +- .../validation/common/zet_entry_points.h | 52 +- .../ze_handle_lifetime.cpp | 1292 +- .../ze_handle_lifetime.h | 68 +- .../zes_handle_lifetime.cpp | 28 +- .../zes_handle_lifetime.h | 2 +- .../zet_handle_lifetime.cpp | 716 +- .../zet_handle_lifetime.h | 26 +- source/layers/validation/ze_valddi.cpp | 5924 ++++----- source/layers/validation/zes_valddi.cpp | 158 +- source/layers/validation/zet_valddi.cpp | 2944 ++--- source/lib/ze_libapi.cpp | 4316 +++---- source/lib/ze_libddi.cpp | 90 +- source/lib/ze_tracing_register_cb_libapi.cpp | 770 +- source/lib/zes_libapi.cpp | 136 +- source/lib/zet_libapi.cpp | 1700 +-- source/loader/ze_ldrddi.cpp | 3242 ++--- source/loader/ze_ldrddi.h | 784 +- source/loader/ze_ldrddi_driver_ddi.cpp | 1966 +-- source/loader/zes_ldrddi.cpp | 54 +- source/loader/zes_ldrddi.h | 14 +- source/loader/zes_ldrddi_driver_ddi.cpp | 66 +- source/loader/zet_ldrddi.cpp | 1168 +- source/loader/zet_ldrddi.h | 294 +- source/loader/zet_ldrddi_driver_ddi.cpp | 1016 +- source/utils/ze_to_string.h | 1060 +- source/utils/zes_to_string.h | 144 +- source/utils/zet_to_string.h | 122 +- 60 files changed, 28742 insertions(+), 28742 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9489728b..2ca4dcd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Level zero loader changelog ## v1.32.0 - * Update to L0 Zero Spec v1.17.23: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-17-23 + * 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 * Fix: CONTRIBUTING.md minor updates to versioning and command lines ## v1.31.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68c32235..475899d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ To generate the code from the scripts, run the following commands: * Clone the specification repo: `git clone https://github.com/oneapi-src/level-zero-spec.git level-zero-spec` * Checkout the specification version in the specification repo, for example: * `cd level-zero-spec` - * `git checkout v1.17.23` + * `git checkout v1.17.24` * Generate the specification JSON file and Headers: * `cd level-zero-spec/scripts` * `python3 ./run.py --debug '--!html' '--!rst' '--!build' --ver 1.16` diff --git a/include/layers/zel_tracing_register_cb.h b/include/layers/zel_tracing_register_cb.h index b85f467f..4a4e9fde 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -58,242 +58,6 @@ typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeExecutableGraphGetSourceGraphExt -/// @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_executable_graph_get_source_graph_ext_params_t -{ - ze_executable_graph_handle_t* phGraph; - ze_graph_handle_t** pphSourceGraph; -} ze_executable_graph_get_source_graph_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeExecutableGraphGetSourceGraphExt -/// @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_pfnExecutableGraphGetSourceGraphExtCb_t)( - ze_executable_graph_get_source_graph_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeExecutableGraphDestroyExt -/// @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_executable_graph_destroy_ext_params_t -{ - ze_executable_graph_handle_t* phGraph; -} ze_executable_graph_destroy_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeExecutableGraphDestroyExt -/// @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_pfnExecutableGraphDestroyExtCb_t)( - ze_executable_graph_destroy_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphCreateExt -/// @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_create_ext_params_t -{ - ze_context_handle_t* phContext; - const void** ppNext; - ze_graph_handle_t** pphGraph; -} ze_graph_create_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphCreateExt -/// @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_pfnGraphCreateExtCb_t)( - ze_graph_create_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphGetPrimaryCommandListExt -/// @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_primary_command_list_ext_params_t -{ - ze_graph_handle_t* phGraph; - ze_command_list_handle_t** pphCommandList; -} ze_graph_get_primary_command_list_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphGetPrimaryCommandListExt -/// @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_pfnGraphGetPrimaryCommandListExtCb_t)( - ze_graph_get_primary_command_list_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphSetDestructionCallbackExt -/// @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_set_destruction_callback_ext_params_t -{ - ze_graph_handle_t* phGraph; - zex_mem_graph_free_callback_fn_t* ppfnCallback; - void** ppUserData; - const void** ppNext; -} ze_graph_set_destruction_callback_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphSetDestructionCallbackExt -/// @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_pfnGraphSetDestructionCallbackExtCb_t)( - ze_graph_set_destruction_callback_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphInstantiateExt -/// @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_instantiate_ext_params_t -{ - ze_graph_handle_t* phGraph; - const void** ppNext; - ze_executable_graph_handle_t** pphExecutableGraph; -} ze_graph_instantiate_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphInstantiateExt -/// @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_pfnGraphInstantiateExtCb_t)( - ze_graph_instantiate_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphIsEmptyExt -/// @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_is_empty_ext_params_t -{ - ze_graph_handle_t* phGraph; -} ze_graph_is_empty_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphIsEmptyExt -/// @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_pfnGraphIsEmptyExtCb_t)( - ze_graph_is_empty_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphDumpContentsExt -/// @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_dump_contents_ext_params_t -{ - ze_graph_handle_t* phGraph; - const char** pfilePath; - const void** ppNext; -} ze_graph_dump_contents_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphDumpContentsExt -/// @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_pfnGraphDumpContentsExtCb_t)( - ze_graph_dump_contents_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeGraphDestroyExt -/// @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_destroy_ext_params_t -{ - ze_graph_handle_t* phGraph; -} ze_graph_destroy_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeGraphDestroyExt -/// @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_pfnGraphDestroyExtCb_t)( - ze_graph_destroy_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -1827,42 +1591,68 @@ typedef void (ZE_APICALL *ze_pfnCommandListImmediateGetPriorityCb_t)( ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListBeginGraphCaptureExt +/// @brief Callback function parameters for zeCommandListIsMutableExp /// @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_begin_graph_capture_ext_params_t +typedef struct _ze_command_list_is_mutable_exp_params_t { ze_command_list_handle_t* phCommandList; - const void** ppNext; -} ze_command_list_begin_graph_capture_ext_params_t; + ze_bool_t** ppIsMutable; +} ze_command_list_is_mutable_exp_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListBeginGraphCaptureExt +/// @brief Callback function-pointer for zeCommandListIsMutableExp /// @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_pfnCommandListBeginGraphCaptureExtCb_t)( - ze_command_list_begin_graph_capture_ext_params_t* params, +typedef void (ZE_APICALL *ze_pfnCommandListIsMutableExpCb_t)( + ze_command_list_is_mutable_exp_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListBeginCaptureIntoGraphExt +/// @brief Callback function parameters for zeCommandListBeginGraphCaptureExt /// @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_begin_capture_into_graph_ext_params_t +typedef struct _ze_command_list_begin_graph_capture_ext_params_t { ze_command_list_handle_t* phCommandList; - ze_graph_handle_t* phGraph; const void** ppNext; -} ze_command_list_begin_capture_into_graph_ext_params_t; +} ze_command_list_begin_graph_capture_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListBeginGraphCaptureExt +/// @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_pfnCommandListBeginGraphCaptureExtCb_t)( + ze_command_list_begin_graph_capture_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListBeginCaptureIntoGraphExt +/// @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_begin_capture_into_graph_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + ze_graph_handle_t* phGraph; + const void** ppNext; +} ze_command_list_begin_capture_into_graph_ext_params_t; /////////////////////////////////////////////////////////////////////////////// @@ -2018,32 +1808,6 @@ typedef void (ZE_APICALL *ze_pfnCommandListAppendHostFunctionCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeCommandListIsMutableExp -/// @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_is_mutable_exp_params_t -{ - ze_command_list_handle_t* phCommandList; - ze_bool_t** ppIsMutable; -} ze_command_list_is_mutable_exp_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeCommandListIsMutableExp -/// @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_pfnCommandListIsMutableExpCb_t)( - ze_command_list_is_mutable_exp_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; @@ -3512,192 +3276,428 @@ typedef void (ZE_APICALL *ze_pfnFabricVertexGetDeviceExpCb_t)( ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zerGetLastErrorDescription +/// @brief Callback function parameters for zeExecutableGraphGetSourceGraphExt /// @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 _zer_get_last_error_description_params_t +typedef struct _ze_executable_graph_get_source_graph_ext_params_t { - const char*** pppString; -} zer_get_last_error_description_params_t; + ze_executable_graph_handle_t* phGraph; + ze_graph_handle_t** pphSourceGraph; +} ze_executable_graph_get_source_graph_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zerGetLastErrorDescription +/// @brief Callback function-pointer for zeExecutableGraphGetSourceGraphExt /// @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 *zer_pfnGetLastErrorDescriptionCb_t)( - zer_get_last_error_description_params_t* params, +typedef void (ZE_APICALL *ze_pfnExecutableGraphGetSourceGraphExtCb_t)( + ze_executable_graph_get_source_graph_ext_params_t* params, ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zerTranslateDeviceHandleToIdentifier +/// @brief Callback function parameters for zeExecutableGraphDestroyExt /// @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 _zer_translate_device_handle_to_identifier_params_t +typedef struct _ze_executable_graph_destroy_ext_params_t { - ze_device_handle_t* phDevice; -} zer_translate_device_handle_to_identifier_params_t; + ze_executable_graph_handle_t* phGraph; +} ze_executable_graph_destroy_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zerTranslateDeviceHandleToIdentifier +/// @brief Callback function-pointer for zeExecutableGraphDestroyExt /// @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 *zer_pfnTranslateDeviceHandleToIdentifierCb_t)( - zer_translate_device_handle_to_identifier_params_t* params, - uint32_t result, +typedef void (ZE_APICALL *ze_pfnExecutableGraphDestroyExtCb_t)( + ze_executable_graph_destroy_ext_params_t* params, + ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zerTranslateIdentifierToDeviceHandle +/// @brief Callback function parameters for zeGraphCreateExt /// @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 _zer_translate_identifier_to_device_handle_params_t +typedef struct _ze_graph_create_ext_params_t { - uint32_t* pidentifier; -} zer_translate_identifier_to_device_handle_params_t; + ze_context_handle_t* phContext; + const void** ppNext; + ze_graph_handle_t** pphGraph; +} ze_graph_create_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zerTranslateIdentifierToDeviceHandle +/// @brief Callback function-pointer for zeGraphCreateExt /// @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 *zer_pfnTranslateIdentifierToDeviceHandleCb_t)( - zer_translate_identifier_to_device_handle_params_t* params, - ze_device_handle_t result, +typedef void (ZE_APICALL *ze_pfnGraphCreateExtCb_t)( + ze_graph_create_ext_params_t* params, + ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zerGetDefaultContext +/// @brief Callback function parameters for zeGraphGetPrimaryCommandListExt /// @details Each entry is a pointer to the parameter passed to the function; /// allowing the callback the ability to modify the parameter's value -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wextern-c-compat" -#endif -typedef struct _zer_get_default_context_params_t +typedef struct _ze_graph_get_primary_command_list_ext_params_t { -} zer_get_default_context_params_t; -#ifdef __clang__ -#pragma clang diagnostic pop -#endif + ze_graph_handle_t* phGraph; + ze_command_list_handle_t** pphCommandList; +} ze_graph_get_primary_command_list_ext_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zerGetDefaultContext +/// @brief Callback function-pointer for zeGraphGetPrimaryCommandListExt /// @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 *zer_pfnGetDefaultContextCb_t)( - zer_get_default_context_params_t* params, - ze_context_handle_t result, +typedef void (ZE_APICALL *ze_pfnGraphGetPrimaryCommandListExtCb_t)( + ze_graph_get_primary_command_list_ext_params_t* params, + ze_result_t result, void* pTracerUserData, void** ppTracerInstanceUserData ); -#if !defined(__GNUC__) -#pragma endregion -#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphSetDestructionCallbackExt +/// @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 enum _zel_tracer_reg_t +typedef struct _ze_graph_set_destruction_callback_ext_params_t { - ZEL_REGISTER_PROLOGUE = 0, - ZEL_REGISTER_EPILOGUE = 1 -} zel_tracer_reg_t; + ze_graph_handle_t* phGraph; + zex_mem_graph_free_callback_fn_t* ppfnCallback; + void** ppUserData; + const void** ppNext; +} ze_graph_set_destruction_callback_ext_params_t; -/// APIs to register callbacks for each core API -#if !defined(__GNUC__) -#pragma region register_callbacks -#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphSetDestructionCallbackExt +/// @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 -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerInitRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnInitCb_t pfnInitCb +typedef void (ZE_APICALL *ze_pfnGraphSetDestructionCallbackExtCb_t)( + ze_graph_set_destruction_callback_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphInstantiateExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetCb_t pfnGetCb - ); - +typedef struct _ze_graph_instantiate_ext_params_t +{ + ze_graph_handle_t* phGraph; + const void** ppNext; + ze_executable_graph_handle_t** pphExecutableGraph; +} ze_graph_instantiate_ext_params_t; -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerInitDriversRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnInitDriversCb_t pfnInitDriversCb - ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphInstantiateExt +/// @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 -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetApiVersionRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetApiVersionCb_t pfnGetApiVersionCb +typedef void (ZE_APICALL *ze_pfnGraphInstantiateExtCb_t)( + ze_graph_instantiate_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphIsEmptyExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetPropertiesRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetPropertiesCb_t pfnGetPropertiesCb - ); - +typedef struct _ze_graph_is_empty_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_is_empty_ext_params_t; -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetIpcPropertiesRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb - ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphIsEmptyExt +/// @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 -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetExtensionPropertiesRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb +typedef void (ZE_APICALL *ze_pfnGraphIsEmptyExtCb_t)( + ze_graph_is_empty_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphDumpContentsExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverGetExtensionFunctionAddressRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverGetExtensionFunctionAddressCb_t pfnGetExtensionFunctionAddressCb - ); +typedef struct _ze_graph_dump_contents_ext_params_t +{ + ze_graph_handle_t* phGraph; + const char** pfilePath; + const void** ppNext; +} ze_graph_dump_contents_ext_params_t; -ZE_APIEXPORT ze_result_t ZE_APICALL +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphDumpContentsExt +/// @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_pfnGraphDumpContentsExtCb_t)( + ze_graph_dump_contents_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphDestroyExt +/// @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_destroy_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphDestroyExt +/// @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_pfnGraphDestroyExtCb_t)( + ze_graph_destroy_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; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _zer_get_last_error_description_params_t +{ + const char*** pppString; +} zer_get_last_error_description_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zerGetLastErrorDescription +/// @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 *zer_pfnGetLastErrorDescriptionCb_t)( + zer_get_last_error_description_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zerTranslateDeviceHandleToIdentifier +/// @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 _zer_translate_device_handle_to_identifier_params_t +{ + ze_device_handle_t* phDevice; +} zer_translate_device_handle_to_identifier_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zerTranslateDeviceHandleToIdentifier +/// @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 *zer_pfnTranslateDeviceHandleToIdentifierCb_t)( + zer_translate_device_handle_to_identifier_params_t* params, + uint32_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zerTranslateIdentifierToDeviceHandle +/// @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 _zer_translate_identifier_to_device_handle_params_t +{ + uint32_t* pidentifier; +} zer_translate_identifier_to_device_handle_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zerTranslateIdentifierToDeviceHandle +/// @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 *zer_pfnTranslateIdentifierToDeviceHandleCb_t)( + zer_translate_identifier_to_device_handle_params_t* params, + ze_device_handle_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zerGetDefaultContext +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wextern-c-compat" +#endif +typedef struct _zer_get_default_context_params_t +{ +} zer_get_default_context_params_t; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zerGetDefaultContext +/// @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 *zer_pfnGetDefaultContextCb_t)( + zer_get_default_context_params_t* params, + ze_context_handle_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif + +typedef enum _zel_tracer_reg_t +{ + ZEL_REGISTER_PROLOGUE = 0, + ZEL_REGISTER_EPILOGUE = 1 +} zel_tracer_reg_t; + +/// APIs to register callbacks for each core API + +#if !defined(__GNUC__) +#pragma region register_callbacks +#endif + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerInitRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnInitCb_t pfnInitCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetCb_t pfnGetCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerInitDriversRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnInitDriversCb_t pfnInitDriversCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetApiVersionRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetApiVersionCb_t pfnGetApiVersionCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetPropertiesRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetPropertiesCb_t pfnGetPropertiesCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetIpcPropertiesRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetExtensionPropertiesRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverGetExtensionFunctionAddressRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverGetExtensionFunctionAddressCb_t pfnGetExtensionFunctionAddressCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDriverGetLastErrorDescriptionRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, @@ -5002,618 +5002,618 @@ zelTracerKernelSetGlobalOffsetExpRegisterCallback( ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetBinaryExpRegisterCallback( +zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb + ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( +zelTracerDeviceSetCacheAdviceExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb + ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( +zelTracerEventQueryTimestampsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb + ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( +zelTracerImageGetMemoryPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb + ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( +zelTracerImageViewCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb + ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( +zelTracerImageViewCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( +zelTracerKernelSchedulingHintExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( +zelTracerDevicePciGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( +zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( +zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( +zelTracerImageGetAllocPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( +zelTracerModuleInspectLinkageExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( +zelTracerMemFreeExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ze_pfnMemFreeExtCb_t pfnFreeExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( +zelTracerFabricVertexGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ze_pfnFabricVertexGetExpCb_t pfnGetExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( +zelTracerFabricVertexGetSubVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( +zelTracerFabricVertexGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetAllocationPropertiesExpRegisterCallback( +zelTracerFabricVertexGetDeviceExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb + ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( +zelTracerDeviceGetFabricVertexExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb + ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphCreateExtRegisterCallback( +zelTracerFabricEdgeGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginGraphCaptureExtRegisterCallback( +zelTracerFabricEdgeGetVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( +zelTracerFabricEdgeGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( +zelTracerEventQueryKernelTimestampsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListEndGraphCaptureExtRegisterCallback( +zelTracerRTASBuilderCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetGraphExtRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphGetPrimaryCommandListExtRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphSetDestructionCallbackExtRegisterCallback( +zelTracerRTASBuilderBuildExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphInstantiateExtRegisterCallback( +zelTracerRTASBuilderDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendGraphExtRegisterCallback( +zelTracerRTASParallelOperationCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphIsEmptyExtRegisterCallback( +zelTracerRTASParallelOperationJoinExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphDumpContentsExtRegisterCallback( +zelTracerRTASParallelOperationDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphDestroyExtRegisterCallback( +zelTracerMemGetPitchFor2dImageRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphDestroyExtRegisterCallback( +zelTracerImageGetDeviceOffsetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendHostFunctionRegisterCallback( +zelTracerCommandListCreateCloneExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReserveCacheExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceSetCacheAdviceExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryTimestampsExpRegisterCallback( +zelTracerCommandListGetNextCommandIdExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetMemoryPropertiesExpRegisterCallback( +zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExpRegisterCallback( +zelTracerCommandListIsMutableExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelSchedulingHintExpRegisterCallback( +zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDevicePciGetPropertiesExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( +zelTracerKernelGetBinaryExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetAllocPropertiesExtRegisterCallback( +zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerModuleInspectLinkageExtRegisterCallback( +zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemFreeExtRegisterCallback( +zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetExpRegisterCallback( +zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetSubVerticesExpRegisterCallback( +zelTracerRTASBuilderCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetPropertiesExpRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetDeviceExpRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetFabricVertexExpRegisterCallback( +zelTracerRTASBuilderBuildExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetExpRegisterCallback( +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetVerticesExpRegisterCallback( +zelTracerRTASBuilderDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryKernelTimestampsExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExpRegisterCallback( +zelTracerRTASParallelOperationJoinExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExpRegisterCallback( +zelTracerKernelGetAllocationPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb + ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExpRegisterCallback( +zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb + ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExpRegisterCallback( +zelTracerGraphCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExpRegisterCallback( +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExpRegisterCallback( +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemGetPitchFor2dImageRegisterCallback( +zelTracerCommandListEndGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetDeviceOffsetExpRegisterCallback( +zelTracerCommandListGetGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListCreateCloneExpRegisterCallback( +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( +zelTracerGraphSetDestructionCallbackExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( +zelTracerGraphInstantiateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdExpRegisterCallback( +zelTracerCommandListAppendGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( +zelTracerGraphIsEmptyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsMutableExpRegisterCallback( +zelTracerGraphDumpContentsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( +zelTracerExecutableGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( +zelTracerGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb ); ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( +zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb ); ZE_APIEXPORT ze_result_t ZE_APICALL diff --git a/include/ze.py b/include/ze.py index c35e5c57..a1ceb12f 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.23 + @version v1.17-r1.17.24 """ import platform @@ -2591,2238 +2591,2196 @@ class ze_relaxed_allocation_limits_exp_desc_t(Structure): ] ############################################################################### -## @brief Get Kernel Binary Extension Name -ZE_GET_KERNEL_BINARY_EXP_NAME = "ZE_extension_kernel_binary_exp" +## @brief Cache_Reservation Extension Name +ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" ############################################################################### -## @brief Get Kernel Binary Extension Version(s) -class ze_kernel_get_binary_exp_version_v(IntEnum): +## @brief Cache_Reservation Extension Version(s) +class ze_cache_reservation_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_kernel_get_binary_exp_version_t(c_int): - def __str__(self): - return str(ze_kernel_get_binary_exp_version_v(self.value)) - - -############################################################################### -## @brief Driver Direct Device Interface (DDI) Handles Extension Name -ZE_DRIVER_DDI_HANDLES_EXT_NAME = "ZE_extension_driver_ddi_handles" - -############################################################################### -## @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) -class ze_driver_ddi_handles_ext_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - _1_1 = ZE_MAKE_VERSION( 1, 1 ) ## version 1.1 - CURRENT = ZE_MAKE_VERSION( 1, 1 ) ## latest known version - -class ze_driver_ddi_handles_ext_version_t(c_int): +class ze_cache_reservation_ext_version_t(c_int): def __str__(self): - return str(ze_driver_ddi_handles_ext_version_v(self.value)) + return str(ze_cache_reservation_ext_version_v(self.value)) ############################################################################### -## @brief Driver Direct Device Interface (DDI) Handle Extension Flags -class ze_driver_ddi_handle_ext_flags_v(IntEnum): - DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0) ## Driver Supports DDI Handles Extension +## @brief Cache Reservation Region +class ze_cache_ext_region_v(IntEnum): + ZE_CACHE_REGION_DEFAULT = 0 ## [DEPRECATED] utilize driver default scheme. Use + ## ::ZE_CACHE_EXT_REGION_DEFAULT. + ZE_CACHE_RESERVE_REGION = 1 ## [DEPRECATED] utilize reserved region. Use + ## ::ZE_CACHE_EXT_REGION_RESERVED. + ZE_CACHE_NON_RESERVED_REGION = 2 ## [DEPRECATED] utilize non-reserverd region. Use + ## ::ZE_CACHE_EXT_REGION_NON_RESERVED. + DEFAULT = 0 ## utilize driver default scheme + RESERVED = 1 ## utilize reserved region + NON_RESERVED = 2 ## utilize non-reserverd region -class ze_driver_ddi_handle_ext_flags_t(c_int): +class ze_cache_ext_region_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_cache_ext_region_v(self.value)) ############################################################################### -## @brief Driver DDI Handles properties queried using ::zeDriverGetProperties +## @brief CacheReservation structure ## ## @details -## - This structure may be returned from ::zeDriverGetProperties, via the -## `pNext` member of ::ze_driver_properties_t. -## - Starting from spec version 1.17, support for this extension is assumed -## for any driver reporting API version 1.17 or later via -## ::zeDriverGetApiVersion; the loader does NOT need to query the -## extension property for such drivers. -## - For drivers reporting API version 1.16 or earlier, the loader must -## check for this extension before using DDI handles. -## - This guarantee enables Level Zero extensions introduced in spec v1.17 -## or later to embed handles directly inside Level Zero structures (e.g., -## via pNext chains) without requiring the loader to translate or unwrap -## handles. -## - Additionally, drivers may assume the loader will dispatch calls -## exclusively via the DDI tables embedded in their handles; the only -## exception is the global DDI table used during driver initialization -## and to read the reported API version. -class ze_driver_ddi_handles_ext_properties_t(Structure): +## - This structure must be passed to ::zeDeviceGetCacheProperties via the +## `pNext` member of ::ze_device_cache_properties_t +## - Used for determining the max cache reservation allowed on device. Size +## of zero means no reservation available. +class ze_cache_reservation_ext_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("flags", ze_driver_ddi_handle_ext_flags_t) ## [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t + ("maxCacheReservationSize", c_size_t) ## [out] max cache reservation size ] ############################################################################### -## @brief External Semaphores Extension Name -ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME = "ZE_extension_external_semaphores" +## @brief Event Query Timestamps Extension Name +ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME = "ZE_experimental_event_query_timestamps" ############################################################################### -## @brief External Semaphores Extension Version -class ze_external_semaphore_ext_version_v(IntEnum): +## @brief Event Query Timestamps Extension Version(s) +class ze_event_query_timestamps_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_external_semaphore_ext_version_t(c_int): +class ze_event_query_timestamps_exp_version_t(c_int): def __str__(self): - return str(ze_external_semaphore_ext_version_v(self.value)) + return str(ze_event_query_timestamps_exp_version_v(self.value)) ############################################################################### -## @brief Handle of external semaphore object -class ze_external_semaphore_ext_handle_t(c_void_p): - pass +## @brief Image Memory Properties Extension Name +ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME = "ZE_experimental_image_memory_properties" ############################################################################### -## @brief External Semaphores Type Flags -class ze_external_semaphore_ext_flags_v(IntEnum): - OPAQUE_FD = ZE_BIT(0) ## Semaphore is an Linux opaque file descriptor - OPAQUE_WIN32 = ZE_BIT(1) ## Semaphore is an opaque Win32 handle for monitored fence - OPAQUE_WIN32_KMT = ZE_BIT(2) ## Semaphore is an opaque Win32 KMT handle for monitored fence - D3D12_FENCE = ZE_BIT(3) ## Semaphore is a D3D12 fence - D3D11_FENCE = ZE_BIT(4) ## Semaphore is a D3D11 fence - KEYED_MUTEX = ZE_BIT(5) ## Semaphore is a keyed mutex for Win32 - KEYED_MUTEX_KMT = ZE_BIT(6) ## Semaphore is a keyed mutex for Win32 KMT - VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7) ## Semaphore is a Vulkan Timeline semaphore for Linux - VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8) ## Semaphore is a Vulkan Timeline semaphore for Win32 +## @brief Image Memory Properties Extension Version(s) +class ze_image_memory_properties_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_external_semaphore_ext_flags_t(c_int): +class ze_image_memory_properties_exp_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_image_memory_properties_exp_version_v(self.value)) ############################################################################### -## @brief External Semaphore Descriptor -class ze_external_semaphore_ext_desc_t(Structure): +## @brief Image memory properties +class ze_image_memory_properties_exp_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). - ("flags", ze_external_semaphore_ext_flags_t) ## [in] The flags describing the type of the semaphore. - ## must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. - ## When importing a semaphore, pNext should be pointing to one of the - ## following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. + ("size", c_ulonglong), ## [out] size of image allocation in bytes. + ("rowPitch", c_ulonglong), ## [out] size of image row in bytes. + ("slicePitch", c_ulonglong) ## [out] size of image slice in bytes. ] ############################################################################### -## @brief External Semaphore Win32 Descriptor -class ze_external_semaphore_win32_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). - ("handle", c_void_p), ## [in] Win32 handle of the semaphore. - ## Must be a valid Win32 handle. - ("name", c_char_p) ## [in] Name of the semaphore. - ## Must be a valid null-terminated string. - ] +## @brief Image View Extension Name +ZE_IMAGE_VIEW_EXT_NAME = "ZE_extension_image_view" ############################################################################### -## @brief External Semaphore FD Descriptor -class ze_external_semaphore_fd_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). - ("fd", c_int) ## [in] File descriptor of the semaphore. - ## Must be a valid file descriptor. - ] +## @brief Image View Extension Version(s) +class ze_image_view_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_image_view_ext_version_t(c_int): + def __str__(self): + return str(ze_image_view_ext_version_v(self.value)) + ############################################################################### -## @brief External Semaphore Signal parameters -class ze_external_semaphore_signal_params_ext_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). - ("value", c_ulonglong) ## [in] [optional] Value to signal. - ## Specified by user as an expected value with some of semaphore types, - ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. - ] +## @brief Image View Extension Name +ZE_IMAGE_VIEW_EXP_NAME = "ZE_experimental_image_view" ############################################################################### -## @brief External Semaphore Wait parameters -class ze_external_semaphore_wait_params_ext_t(Structure): +## @brief Image View Extension Version(s) +class ze_image_view_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_image_view_exp_version_t(c_int): + def __str__(self): + return str(ze_image_view_exp_version_v(self.value)) + + +############################################################################### +## @brief Image View Planar Extension Name +ZE_IMAGE_VIEW_PLANAR_EXT_NAME = "ZE_extension_image_view_planar" + +############################################################################### +## @brief Image View Planar Extension Version(s) +class ze_image_view_planar_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_image_view_planar_ext_version_t(c_int): + def __str__(self): + return str(ze_image_view_planar_ext_version_v(self.value)) + + +############################################################################### +## @brief Image view planar descriptor +class ze_image_view_planar_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). - ("value", c_ulonglong) ## [in] [optional] Value to wait for. - ## Specified by user as an expected value with some of semaphore types, - ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + ("planeIndex", c_ulong) ## [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) ] ############################################################################### -## @brief CacheLine Size Extension Name -ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" +## @brief Image View Planar Extension Name +ZE_IMAGE_VIEW_PLANAR_EXP_NAME = "ZE_experimental_image_view_planar" ############################################################################### -## @brief CacheLine Size Extension Version(s) -class ze_device_cache_line_size_ext_version_v(IntEnum): +## @brief Image View Planar Extension Version(s) +class ze_image_view_planar_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_device_cache_line_size_ext_version_t(c_int): +class ze_image_view_planar_exp_version_t(c_int): def __str__(self): - return str(ze_device_cache_line_size_ext_version_v(self.value)) + return str(ze_image_view_planar_exp_version_v(self.value)) ############################################################################### -## @brief CacheLine Size queried using ::zeDeviceGetCacheProperties -## -## @details -## - This structure may be returned from ::zeDeviceGetCacheProperties via -## the `pNext` member of ::ze_device_cache_properties_t. -## - Used for determining the cache line size supported on a device. -class ze_device_cache_line_size_ext_t(Structure): +## @brief Image view planar descriptor +class ze_image_view_planar_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). - ("cacheLineSize", c_size_t) ## [out] The cache line size in bytes. + ("planeIndex", c_ulong) ## [DEPRECATED] no longer supported, use + ## ::ze_image_view_planar_ext_desc_t instead ] ############################################################################### -## @brief Ray Tracing Acceleration Structure Extension Name -ZE_RTAS_EXT_NAME = "ZE_extension_rtas" +## @brief Kernel Scheduling Hints Extension Name +ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME = "ZE_experimental_scheduling_hints" ############################################################################### -## @brief Ray Tracing Acceleration Structure Builder Extension Version(s) -class ze_rtas_builder_ext_version_v(IntEnum): +## @brief Kernel Scheduling Hints Extension Version(s) +class ze_scheduling_hints_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_rtas_builder_ext_version_t(c_int): +class ze_scheduling_hints_exp_version_t(c_int): def __str__(self): - return str(ze_rtas_builder_ext_version_v(self.value)) + return str(ze_scheduling_hints_exp_version_v(self.value)) ############################################################################### -## @brief Ray tracing acceleration structure device flags -class ze_rtas_device_ext_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## reserved for future use +## @brief Supported kernel scheduling hint flags +class ze_scheduling_hint_exp_flags_v(IntEnum): + OLDEST_FIRST = ZE_BIT(0) ## Hint that the kernel prefers oldest-first scheduling + ROUND_ROBIN = ZE_BIT(1) ## Hint that the kernel prefers round-robin scheduling + STALL_BASED_ROUND_ROBIN = ZE_BIT(2) ## Hint that the kernel prefers stall-based round-robin scheduling -class ze_rtas_device_ext_flags_t(c_int): +class ze_scheduling_hint_exp_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Ray tracing acceleration structure format +## @brief Device kernel scheduling hint properties queried using +## ::zeDeviceGetModuleProperties ## ## @details -## - This is an opaque ray tracing acceleration structure format -## identifier. -class ze_rtas_format_ext_v(IntEnum): - INVALID = 0x0 ## Invalid acceleration structure format code - MAX = 0x7ffffffe ## Maximum acceleration structure format code - -class ze_rtas_format_ext_t(c_int): - def __str__(self): - return str(ze_rtas_format_ext_v(self.value)) +## - This structure may be returned from ::zeDeviceGetModuleProperties, via +## the `pNext` member of ::ze_device_module_properties_t. +class ze_scheduling_hint_exp_properties_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). + ("schedulingHintFlags", ze_scheduling_hint_exp_flags_t) ## [out] Supported kernel scheduling hints. + ## May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + ] +############################################################################### +## @brief Kernel scheduling hint descriptor +## +## @details +## - This structure may be passed to ::zeKernelSchedulingHintExp. +class ze_scheduling_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). + ("flags", ze_scheduling_hint_exp_flags_t) ## [in] flags specifying kernel scheduling hints. + ## must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + ] ############################################################################### -## @brief Ray tracing acceleration structure builder flags -class ze_rtas_builder_ext_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## Reserved for future use +## @brief Linkonce ODR Extension Name +ZE_LINKONCE_ODR_EXT_NAME = "ZE_extension_linkonce_odr" -class ze_rtas_builder_ext_flags_t(c_int): +############################################################################### +## @brief Linkonce ODR Extension Version(s) +class ze_linkonce_odr_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_linkonce_odr_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_linkonce_odr_ext_version_v(self.value)) ############################################################################### -## @brief Ray tracing acceleration structure builder parallel operation flags -class ze_rtas_parallel_operation_ext_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## Reserved for future use +## @brief Power Saving Hint Extension Name +ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME = "ZE_experimental_power_saving_hint" -class ze_rtas_parallel_operation_ext_flags_t(c_int): +############################################################################### +## @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 hex(self.value) + return str(ze_power_saving_hint_exp_version_v(self.value)) ############################################################################### -## @brief Ray tracing acceleration structure builder geometry flags -class ze_rtas_builder_geometry_ext_flags_v(IntEnum): - NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader +## @brief Supported device types +class ze_power_saving_hint_type_v(IntEnum): + MIN = 0 ## Minumum 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_rtas_builder_geometry_ext_flags_t(c_int): +class ze_power_saving_hint_type_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_power_saving_hint_type_v(self.value)) ############################################################################### -## @brief Packed ray tracing acceleration structure builder geometry flags (see -## ::ze_rtas_builder_geometry_ext_flags_t) -class ze_rtas_builder_packed_geometry_ext_flags_t(c_ubyte): - pass +## @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 Ray tracing acceleration structure builder instance flags -class ze_rtas_builder_instance_ext_flags_v(IntEnum): - TRIANGLE_CULL_DISABLE = ZE_BIT(0) ## disables culling of front-facing and back-facing triangles - TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1) ## reverses front and back face of triangles - TRIANGLE_FORCE_OPAQUE = ZE_BIT(2) ## forces instanced geometry to be opaque, unless ray flag forces it to - ## be non-opaque - TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3) ## forces instanced geometry to be non-opaque, unless ray flag forces it - ## to be opaque +## @brief Subgroups Extension Name +ZE_SUBGROUPS_EXT_NAME = "ZE_extension_subgroups" -class ze_rtas_builder_instance_ext_flags_t(c_int): +############################################################################### +## @brief Subgroups Extension Version(s) +class ze_subgroup_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_subgroup_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_subgroup_ext_version_v(self.value)) ############################################################################### -## @brief Packed ray tracing acceleration structure builder instance flags (see -## ::ze_rtas_builder_instance_ext_flags_t) -class ze_rtas_builder_packed_instance_ext_flags_t(c_ubyte): - pass +## @brief EU Count Extension Name +ZE_EU_COUNT_EXT_NAME = "ZE_extension_eu_count" ############################################################################### -## @brief Ray tracing acceleration structure builder build operation flags -## -## @details -## - These flags allow the application to tune the acceleration structure -## build operation. -## - The acceleration structure builder implementation might choose to use -## spatial splitting to split large or long primitives into smaller -## pieces. This may result in any-hit shaders being invoked multiple -## times for non-opaque primitives, unless -## ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. -## - Usage of any of these flags may reduce ray tracing performance. -class ze_rtas_builder_build_op_ext_flags_v(IntEnum): - COMPACT = ZE_BIT(0) ## build more compact acceleration structure - NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1) ## guarantees single any-hit shader invocation per primitive +## @brief EU Count Extension Version(s) +class ze_eu_count_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_rtas_builder_build_op_ext_flags_t(c_int): +class ze_eu_count_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_eu_count_ext_version_v(self.value)) ############################################################################### -## @brief Ray tracing acceleration structure builder build quality hint +## @brief EU count queried using ::zeDeviceGetProperties ## ## @details -## - Depending on use case different quality modes for acceleration -## structure build are supported. -## - A low-quality build builds an acceleration structure fast, but at the -## cost of some reduction in ray tracing performance. This mode is -## recommended for dynamic content, such as animated characters. -## - A medium-quality build uses a compromise between build quality and ray -## tracing performance. This mode should be used by default. -## - Higher ray tracing performance can be achieved by using a high-quality -## build, but acceleration structure build performance might be -## significantly reduced. -class ze_rtas_builder_build_quality_hint_ext_v(IntEnum): - LOW = 0 ## build low-quality acceleration structure (fast) - MEDIUM = 1 ## build medium-quality acceleration structure (slower) - HIGH = 2 ## build high-quality acceleration structure (slow) - -class ze_rtas_builder_build_quality_hint_ext_t(c_int): - def __str__(self): - return str(ze_rtas_builder_build_quality_hint_ext_v(self.value)) +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t. +## - Used for determining the total number of EUs available on device. +class ze_eu_count_ext_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). + ("numTotalEUs", c_ulong) ## [out] Total number of EUs available + ] +############################################################################### +## @brief PCI Properties Extension Name +ZE_PCI_PROPERTIES_EXT_NAME = "ZE_extension_pci_properties" ############################################################################### -## @brief Ray tracing acceleration structure builder geometry type -class ze_rtas_builder_geometry_type_ext_v(IntEnum): - TRIANGLES = 0 ## triangle mesh geometry type - QUADS = 1 ## quad mesh geometry type - PROCEDURAL = 2 ## procedural geometry type - INSTANCE = 3 ## instance geometry type +## @brief PCI Properties Extension Version(s) +class ze_pci_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_rtas_builder_geometry_type_ext_t(c_int): +class ze_pci_properties_ext_version_t(c_int): def __str__(self): - return str(ze_rtas_builder_geometry_type_ext_v(self.value)) - + return str(ze_pci_properties_ext_version_v(self.value)) -############################################################################### -## @brief Packed ray tracing acceleration structure builder geometry type (see -## ::ze_rtas_builder_geometry_type_ext_t) -class ze_rtas_builder_packed_geometry_type_ext_t(c_ubyte): - pass ############################################################################### -## @brief Ray tracing acceleration structure data buffer element format +## @brief Device PCI address ## ## @details -## - Specifies the format of data buffer elements. -## - Data buffers may contain instancing transform matrices, triangle/quad -## vertex indices, etc... -class ze_rtas_builder_input_data_format_ext_v(IntEnum): - FLOAT3 = 0 ## 3-component float vector (see ::ze_rtas_float3_ext_t) - FLOAT3X4_COLUMN_MAJOR = 1 ## 3x4 affine transformation in column-major format (see - ## ::ze_rtas_transform_float3x4_column_major_ext_t) - FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2 ## 3x4 affine transformation in column-major format (see - ## ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) - FLOAT3X4_ROW_MAJOR = 3 ## 3x4 affine transformation in row-major format (see - ## ::ze_rtas_transform_float3x4_row_major_ext_t) - AABB = 4 ## 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) - TRIANGLE_INDICES_UINT32 = 5 ## Unsigned 32-bit triangle indices (see - ## ::ze_rtas_triangle_indices_uint32_ext_t) - QUAD_INDICES_UINT32 = 6 ## Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) - -class ze_rtas_builder_input_data_format_ext_t(c_int): - def __str__(self): - return str(ze_rtas_builder_input_data_format_ext_v(self.value)) - - -############################################################################### -## @brief Packed ray tracing acceleration structure data buffer element format -## (see ::ze_rtas_builder_input_data_format_ext_t) -class ze_rtas_builder_packed_input_data_format_ext_t(c_ubyte): - pass - -############################################################################### -## @brief Handle of ray tracing acceleration structure builder object -class ze_rtas_builder_ext_handle_t(c_void_p): - pass - -############################################################################### -## @brief Handle of ray tracing acceleration structure builder parallel -## operation object -class ze_rtas_parallel_operation_ext_handle_t(c_void_p): - pass +## - This structure may be passed to ::zeDevicePciGetPropertiesExt as an +## attribute of ::ze_pci_ext_properties_t. +## - A PCI BDF address is the bus:device:function address of the device and +## is useful for locating the device in the PCI switch fabric. +class ze_pci_address_ext_t(Structure): + _fields_ = [ + ("domain", c_ulong), ## [out] PCI domain number + ("bus", c_ulong), ## [out] PCI BDF bus number + ("device", c_ulong), ## [out] PCI BDF device number + ("function", c_ulong) ## [out] PCI BDF function number + ] ############################################################################### -## @brief Ray tracing acceleration structure builder descriptor -class ze_rtas_builder_ext_desc_t(Structure): +## @brief Device PCI speed +class ze_pci_speed_ext_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). - ("builderVersion", ze_rtas_builder_ext_version_t) ## [in] ray tracing acceleration structure builder version + ("genVersion", c_int32_t), ## [out] The link generation. A value of -1 means that this property is + ## unknown. + ("width", c_int32_t), ## [out] The number of lanes. A value of -1 means that this property is + ## unknown. + ("maxBandwidth", c_int64_t) ## [out] The theoretical maximum bandwidth in bytes/sec (sum of all + ## lanes). A value of -1 means that this property is unknown. ] ############################################################################### -## @brief Ray tracing acceleration structure builder properties -class ze_rtas_builder_ext_properties_t(Structure): +## @brief Static PCI properties +class ze_pci_ext_properties_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). - ("flags", ze_rtas_builder_ext_flags_t), ## [out] ray tracing acceleration structure builder flags - ("rtasBufferSizeBytesExpected", c_size_t), ## [out] expected size (in bytes) required for acceleration structure buffer - ## - When using an acceleration structure buffer of this size, the - ## build is expected to succeed; however, it is possible that the build - ## may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY - ("rtasBufferSizeBytesMaxRequired", c_size_t), ## [out] worst-case size (in bytes) required for acceleration structure buffer - ## - When using an acceleration structure buffer of this size, the - ## build is guaranteed to not run out of memory. - ("scratchBufferSizeBytes", c_size_t) ## [out] scratch buffer size (in bytes) required for acceleration - ## structure build. + ("address", ze_pci_address_ext_t), ## [out] The BDF address + ("maxSpeed", ze_pci_speed_ext_t) ## [out] Fastest port configuration supported by the device (sum of all + ## lanes) ] ############################################################################### -## @brief Ray tracing acceleration structure builder parallel operation -## properties -class ze_rtas_parallel_operation_ext_properties_t(Structure): +## @brief sRGB Extension Name +ZE_SRGB_EXT_NAME = "ZE_extension_srgb" + +############################################################################### +## @brief sRGB Extension Version(s) +class ze_srgb_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_srgb_ext_version_t(c_int): + def __str__(self): + return str(ze_srgb_ext_version_v(self.value)) + + +############################################################################### +## @brief sRGB image descriptor +## +## @details +## - This structure may be passed to ::zeImageCreate via the `pNext` member +## of ::ze_image_desc_t +## - Used for specifying that the image is in sRGB format. +class ze_srgb_ext_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("flags", ze_rtas_parallel_operation_ext_flags_t), ## [out] ray tracing acceleration structure builder parallel operation - ## flags - ("maxConcurrency", c_ulong) ## [out] maximum number of threads that may join the parallel operation + ("sRGB", ze_bool_t) ## [in] Is sRGB. ] ############################################################################### -## @brief Ray tracing acceleration structure device properties -## -## @details -## - This structure may be passed to ::zeDeviceGetProperties, via `pNext` -## member of ::ze_device_properties_t. -## - The implementation shall populate `format` with a value other than -## ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. -class ze_rtas_device_ext_properties_t(Structure): +## @brief Image Copy Extension Name +ZE_IMAGE_COPY_EXT_NAME = "ZE_extension_image_copy" + +############################################################################### +## @brief Image Copy Extension Version(s) +class ze_image_copy_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_image_copy_ext_version_t(c_int): + def __str__(self): + return str(ze_image_copy_ext_version_v(self.value)) + + +############################################################################### +## @brief Image Query Allocation Properties Extension Name +ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME = "ZE_extension_image_query_alloc_properties" + +############################################################################### +## @brief Image Query Allocation Properties Extension Version(s) +class ze_image_query_alloc_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_image_query_alloc_properties_ext_version_t(c_int): + def __str__(self): + return str(ze_image_query_alloc_properties_ext_version_v(self.value)) + + +############################################################################### +## @brief Image allocation properties queried using +## ::zeImageGetAllocPropertiesExt +class ze_image_allocation_ext_properties_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). - ("flags", ze_rtas_device_ext_flags_t), ## [out] ray tracing acceleration structure device flags - ("rtasFormat", ze_rtas_format_ext_t), ## [out] ray tracing acceleration structure format - ("rtasBufferAlignment", c_ulong) ## [out] required alignment of acceleration structure buffer + ("id", c_ulonglong) ## [out] identifier for this allocation ] ############################################################################### -## @brief A 3-component vector type -class ze_rtas_float3_ext_t(Structure): - _fields_ = [ - ("x", c_float), ## [in] x-coordinate of float3 vector - ("y", c_float), ## [in] y-coordinate of float3 vector - ("z", c_float) ## [in] z-coordinate of float3 vector - ] +## @brief Linkage Inspection Extension Name +ZE_LINKAGE_INSPECTION_EXT_NAME = "ZE_extension_linkage_inspection" ############################################################################### -## @brief 3x4 affine transformation in column-major layout -## -## @details -## - A 3x4 affine transformation in column major layout, consisting of vectors -## - vx=(vx_x, vx_y, vx_z), -## - vy=(vy_x, vy_y, vy_z), -## - vz=(vz_x, vz_y, vz_z), and -## - p=(p_x, p_y, p_z) -## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -## z*vz + p`. -class ze_rtas_transform_float3x4_column_major_ext_t(Structure): - _fields_ = [ - ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix - ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix - ("vx_z", c_float), ## [in] element 2 of column 0 of 3x4 matrix - ("vy_x", c_float), ## [in] element 0 of column 1 of 3x4 matrix - ("vy_y", c_float), ## [in] element 1 of column 1 of 3x4 matrix - ("vy_z", c_float), ## [in] element 2 of column 1 of 3x4 matrix - ("vz_x", c_float), ## [in] element 0 of column 2 of 3x4 matrix - ("vz_y", c_float), ## [in] element 1 of column 2 of 3x4 matrix - ("vz_z", c_float), ## [in] element 2 of column 2 of 3x4 matrix - ("p_x", c_float), ## [in] element 0 of column 3 of 3x4 matrix - ("p_y", c_float), ## [in] element 1 of column 3 of 3x4 matrix - ("p_z", c_float) ## [in] element 2 of column 3 of 3x4 matrix - ] +## @brief Linkage Inspection Extension Version(s) +class ze_linkage_inspection_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_linkage_inspection_ext_version_t(c_int): + def __str__(self): + return str(ze_linkage_inspection_ext_version_v(self.value)) + ############################################################################### -## @brief 3x4 affine transformation in column-major layout with aligned column -## vectors -## -## @details -## - A 3x4 affine transformation in column major layout, consisting of vectors -## - vx=(vx_x, vx_y, vx_z), -## - vy=(vy_x, vy_y, vy_z), -## - vz=(vz_x, vz_y, vz_z), and -## - p=(p_x, p_y, p_z) -## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -## z*vz + p`. -## - The column vectors are aligned to 16-bytes and pad members are -## ignored. -class ze_rtas_transform_float3x4_aligned_column_major_ext_t(Structure): - _fields_ = [ - ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix - ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix - ("vx_z", c_float), ## [in] element 2 of column 0 of 3x4 matrix - ("pad0", c_float), ## [in] ignored padding - ("vy_x", c_float), ## [in] element 0 of column 1 of 3x4 matrix - ("vy_y", c_float), ## [in] element 1 of column 1 of 3x4 matrix - ("vy_z", c_float), ## [in] element 2 of column 1 of 3x4 matrix - ("pad1", c_float), ## [in] ignored padding - ("vz_x", c_float), ## [in] element 0 of column 2 of 3x4 matrix - ("vz_y", c_float), ## [in] element 1 of column 2 of 3x4 matrix - ("vz_z", c_float), ## [in] element 2 of column 2 of 3x4 matrix - ("pad2", c_float), ## [in] ignored padding - ("p_x", c_float), ## [in] element 0 of column 3 of 3x4 matrix - ("p_y", c_float), ## [in] element 1 of column 3 of 3x4 matrix - ("p_z", c_float), ## [in] element 2 of column 3 of 3x4 matrix - ("pad3", c_float) ## [in] ignored padding - ] +## @brief Supported module linkage inspection flags +class ze_linkage_inspection_ext_flags_v(IntEnum): + IMPORTS = ZE_BIT(0) ## List all imports of modules + UNRESOLVABLE_IMPORTS = ZE_BIT(1) ## List all imports of modules that do not have a corresponding export + EXPORTS = ZE_BIT(2) ## List all exports of modules + +class ze_linkage_inspection_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + ############################################################################### -## @brief 3x4 affine transformation in row-major layout +## @brief Module linkage inspection descriptor ## ## @details -## - A 3x4 affine transformation in row-major layout, consisting of vectors -## - vx=(vx_x, vx_y, vx_z), -## - vy=(vy_x, vy_y, vy_z), -## - vz=(vz_x, vz_y, vz_z), and -## - p=(p_x, p_y, p_z) -## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -## z*vz + p`. -class ze_rtas_transform_float3x4_row_major_ext_t(Structure): +## - This structure may be passed to ::zeModuleInspectLinkageExt. +class ze_linkage_inspection_ext_desc_t(Structure): _fields_ = [ - ("vx_x", c_float), ## [in] element 0 of row 0 of 3x4 matrix - ("vy_x", c_float), ## [in] element 1 of row 0 of 3x4 matrix - ("vz_x", c_float), ## [in] element 2 of row 0 of 3x4 matrix - ("p_x", c_float), ## [in] element 3 of row 0 of 3x4 matrix - ("vx_y", c_float), ## [in] element 0 of row 1 of 3x4 matrix - ("vy_y", c_float), ## [in] element 1 of row 1 of 3x4 matrix - ("vz_y", c_float), ## [in] element 2 of row 1 of 3x4 matrix - ("p_y", c_float), ## [in] element 3 of row 1 of 3x4 matrix - ("vx_z", c_float), ## [in] element 0 of row 2 of 3x4 matrix - ("vy_z", c_float), ## [in] element 1 of row 2 of 3x4 matrix - ("vz_z", c_float), ## [in] element 2 of row 2 of 3x4 matrix - ("p_z", c_float) ## [in] element 3 of row 2 of 3x4 matrix + ("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). + ("flags", ze_linkage_inspection_ext_flags_t) ## [in] flags specifying module linkage inspection. + ## must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. ] ############################################################################### -## @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds -## in each dimension -class ze_rtas_aabb_ext_t(Structure): - _fields_ = [ - ("lower", ze_rtas_c_float3_ext_t), ## [in] lower bounds of AABB - ("upper", ze_rtas_c_float3_ext_t) ## [in] upper bounds of AABB - ] +## @brief Memory Compression Hints Extension Name +ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME = "ZE_extension_memory_compression_hints" ############################################################################### -## @brief Triangle represented using 3 vertex indices +## @brief Memory Compression Hints Extension Version(s) +class ze_memory_compression_hints_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_memory_compression_hints_ext_version_t(c_int): + def __str__(self): + return str(ze_memory_compression_hints_ext_version_v(self.value)) + + +############################################################################### +## @brief Supported memory compression hints flags +class ze_memory_compression_hints_ext_flags_v(IntEnum): + COMPRESSED = ZE_BIT(0) ## Hint Driver implementation to make allocation compressible + UNCOMPRESSED = ZE_BIT(1) ## Hint Driver implementation to make allocation not compressible + +class ze_memory_compression_hints_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Compression hints memory allocation descriptor ## ## @details -## - Represents a triangle using 3 vertex indices that index into a vertex -## array that needs to be provided together with the index array. -## - The linear barycentric u/v parametrization of the triangle is defined as: -## - (u=0, v=0) at v0, -## - (u=1, v=0) at v1, and -## - (u=0, v=1) at v2 -class ze_rtas_triangle_indices_uint32_ext_t(Structure): +## - This structure may be passed to ::zeMemAllocShared or +## ::zeMemAllocDevice, via the `pNext` member of +## ::ze_device_mem_alloc_desc_t. +## - This structure may be passed to ::zeMemAllocHost, via the `pNext` +## member of ::ze_host_mem_alloc_desc_t. +## - This structure may be passed to ::zeImageCreate, via the `pNext` +## member of ::ze_image_desc_t. +class ze_memory_compression_hints_ext_desc_t(Structure): _fields_ = [ - ("v0", c_ulong), ## [in] first index pointing to the first triangle vertex in vertex array - ("v1", c_ulong), ## [in] second index pointing to the second triangle vertex in vertex - ## array - ("v2", c_ulong) ## [in] third index pointing to the third triangle vertex in vertex array + ("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). + ("flags", ze_memory_compression_hints_ext_flags_t) ## [in] flags specifying if allocation should be compressible or not. + ## Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; ] ############################################################################### -## @brief Quad represented using 4 vertex indices -## -## @details -## - Represents a quad composed of 4 indices that index into a vertex array -## that needs to be provided together with the index array. -## - A quad is a triangle pair represented using 4 vertex indices v0, v1, -## v2, v3. -## The first triangle is made out of indices v0, v1, v3 and the second triangle -## from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -## of the quad is defined as: -## - (u=0, v=0) at v0, -## - (u=1, v=0) at v1, -## - (u=0, v=1) at v3, and -## - (u=1, v=1) at v2 -## This is achieved by correcting the u'/v' coordinates of the second -## triangle by -## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -class ze_rtas_quad_indices_uint32_ext_t(Structure): - _fields_ = [ - ("v0", c_ulong), ## [in] first index pointing to the first quad vertex in vertex array - ("v1", c_ulong), ## [in] second index pointing to the second quad vertex in vertex array - ("v2", c_ulong), ## [in] third index pointing to the third quad vertex in vertex array - ("v3", c_ulong) ## [in] fourth index pointing to the fourth quad vertex in vertex array - ] +## @brief Memory Free Policies Extension Name +ZE_MEMORY_FREE_POLICIES_EXT_NAME = "ZE_extension_memory_free_policies" ############################################################################### -## @brief Ray tracing acceleration structure builder geometry info -class ze_rtas_builder_geometry_info_ext_t(Structure): - _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t) ## [in] geometry type - ] +## @brief Memory Free Policies Extension Version(s) +class ze_memory_free_policies_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_memory_free_policies_ext_version_t(c_int): + def __str__(self): + return str(ze_memory_free_policies_ext_version_v(self.value)) + ############################################################################### -## @brief Ray tracing acceleration structure builder triangle mesh geometry info -## -## @details -## - The linear barycentric u/v parametrization of the triangle is defined as: -## - (u=0, v=0) at v0, -## - (u=1, v=0) at v1, and -## - (u=0, v=1) at v2 -class ze_rtas_builder_triangles_geometry_info_ext_t(Structure): - _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES - ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ## bits representing the geometry flags for all primitives of this - ## geometry - ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("triangleFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of triangle buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 - ("vertexFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of vertex buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 - ("triangleCount", c_ulong), ## [in] number of triangles in triangle buffer - ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer - ("triangleStride", c_ulong), ## [in] stride (in bytes) of triangles in triangle buffer - ("vertexStride", c_ulong), ## [in] stride (in bytes) of vertices in vertex buffer - ("pTriangleBuffer", c_void_p), ## [in] pointer to array of triangle indices in specified format - ("pVertexBuffer", c_void_p) ## [in] pointer to array of triangle vertices in specified format - ] +## @brief Supported memory free policy capability flags +class ze_driver_memory_free_policy_ext_flags_v(IntEnum): + BLOCKING_FREE = ZE_BIT(0) ## Blocks until all commands using the memory are complete before + ## scheduling memory to be freed. Does not guarantee memory is freed upon + ## return, only that it is safe and is scheduled to be freed. Actual + ## freeing of memory is specific to user mode driver and kernel mode + ## driver implementation and may be done asynchronously. + DEFER_FREE = ZE_BIT(1) ## Immediately schedules the memory to be freed and returns without + ## blocking. Memory may be freed after all commands using the memory are + ## complete. Actual freeing of memory is specific to user mode driver and + ## kernel mode driver implementation and may be done asynchronously. + +class ze_driver_memory_free_policy_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + ############################################################################### -## @brief Ray tracing acceleration structure builder quad mesh geometry info +## @brief Driver memory free properties queried using ::zeDriverGetProperties ## ## @details -## - A quad is a triangle pair represented using 4 vertex indices v0, v1, -## v2, v3. -## The first triangle is made out of indices v0, v1, v3 and the second triangle -## from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -## of the quad is defined as: -## - (u=0, v=0) at v0, -## - (u=1, v=0) at v1, -## - (u=0, v=1) at v3, and -## - (u=1, v=1) at v2 -## This is achieved by correcting the u'/v' coordinates of the second -## triangle by -## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -class ze_rtas_builder_quads_geometry_info_ext_t(Structure): +## - All drivers must support an immediate free policy, which is the +## default free policy. +## - This structure may be returned from ::zeDriverGetProperties, via the +## `pNext` member of ::ze_driver_properties_t. +class ze_driver_memory_free_ext_properties_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS - ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ## bits representing the geometry flags for all primitives of this - ## geometry - ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("quadFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of quad buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 - ("vertexFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of vertex buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 - ("quadCount", c_ulong), ## [in] number of quads in quad buffer - ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer - ("quadStride", c_ulong), ## [in] stride (in bytes) of quads in quad buffer - ("vertexStride", c_ulong), ## [in] stride (in bytes) of vertices in vertex buffer - ("pQuadBuffer", c_void_p), ## [in] pointer to array of quad indices in specified format - ("pVertexBuffer", c_void_p) ## [in] pointer to array of quad vertices in specified format + ("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). + ("freePolicies", ze_driver_memory_free_policy_ext_flags_t) ## [out] Supported memory free policies. + ## must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. ] ############################################################################### -## @brief AABB callback function parameters -class ze_rtas_geometry_aabbs_ext_cb_params_t(Structure): +## @brief Memory free descriptor with free policy +class ze_memory_free_ext_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("primID", c_ulong), ## [in] first primitive to return bounds for - ("primIDCount", c_ulong), ## [in] number of primitives to return bounds for - ("pGeomUserPtr", c_void_p), ## [in] pointer provided through geometry descriptor - ("pBuildUserPtr", c_void_p), ## [in] pointer provided through ::zeRTASBuilderBuildExt function - ("pBoundsOut", POINTER(ze_rtas_aabb_ext_t)) ## [out] destination buffer to write AABB bounds to + ("freePolicy", ze_driver_memory_free_policy_ext_flags_t) ## [in] flags specifying the memory free policy. + ## must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; + ## default behavior is to free immediately. ] ############################################################################### -## @brief Callback function pointer type to return AABBs for a range of -## procedural primitives +## @brief Bandwidth Extension Name +ZE_BANDWIDTH_PROPERTIES_EXP_NAME = "ZE_experimental_bandwidth_properties" ############################################################################### -## @brief Ray tracing acceleration structure builder procedural primitives -## geometry info -## -## @details -## - A host-side bounds callback function is invoked by the acceleration -## structure builder to query the bounds of procedural primitives on -## demand. The callback is passed some `pGeomUserPtr` that can point to -## an application-side representation of the procedural primitives. -## Further, a second `pBuildUserPtr`, which is set by a parameter to -## ::zeRTASBuilderBuildExt, is passed to the callback. This allows the -## build to change the bounds of the procedural geometry, for example, to -## build a BVH only over a short time range to implement multi-segment -## motion blur. -class ze_rtas_builder_procedural_geometry_info_ext_t(Structure): - _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL - ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ## bits representing the geometry flags for all primitives of this - ## geometry - ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("reserved", c_ubyte), ## [in] reserved for future use - ("primCount", c_ulong), ## [in] number of primitives in geometry - ("pfnGetBoundsCb", ze_rtas_geometry_aabbs_cb_ext_t), ## [in] pointer to callback function to get the axis-aligned bounding-box - ## for a range of primitives - ("pGeomUserPtr", c_void_p) ## [in] user data pointer passed to callback - ] +## @brief Bandwidth Extension Version(s) +class ze_bandwidth_properties_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_bandwidth_properties_exp_version_t(c_int): + def __str__(self): + return str(ze_bandwidth_properties_exp_version_v(self.value)) + ############################################################################### -## @brief Ray tracing acceleration structure builder instance geometry info -class ze_rtas_builder_instance_geometry_info_ext_t(Structure): +## @brief P2P Bandwidth Properties +## +## @details +## - This structure may be passed to ::zeDeviceGetP2PProperties by having +## the pNext member of ::ze_device_p2p_properties_t point at this struct. +class ze_device_p2p_bandwidth_exp_properties_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE - ("instanceFlags", ze_rtas_builder_packed_instance_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ## bits representing the geometry flags for all primitives of this - ## geometry - ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("transformFormat", ze_rtas_builder_packed_input_data_format_ext_t),## [in] format of the specified transformation - ("instanceUserID", c_ulong), ## [in] user-specified identifier for the instance - ("pTransform", c_void_p), ## [in] object-to-world instance transformation in specified format - ("pBounds", POINTER(ze_rtas_aabb_ext_t)), ## [in] object-space axis-aligned bounding-box of the instanced - ## acceleration structure - ("pAccelerationStructure", c_void_p) ## [in] device pointer to acceleration structure to instantiate + ("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). + ("logicalBandwidth", c_ulong), ## [out] total logical design bandwidth for all links connecting the two + ## devices + ("physicalBandwidth", c_ulong), ## [out] total physical design bandwidth for all links connecting the two + ## devices + ("bandwidthUnit", ze_bandwidth_unit_t), ## [out] bandwidth unit + ("logicalLatency", c_ulong), ## [out] average logical design latency for all links connecting the two + ## devices + ("physicalLatency", c_ulong), ## [out] average physical design latency for all links connecting the two + ## devices + ("latencyUnit", ze_latency_unit_t) ## [out] latency unit ] ############################################################################### -## @brief -class ze_rtas_builder_build_op_ext_desc_t(Structure): +## @brief Copy Bandwidth Properties +## +## @details +## - This structure may be passed to +## ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of +## ::ze_command_queue_group_properties_t point at this struct. +## - [DEPRECATED] +class ze_copy_bandwidth_exp_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("rtasFormat", ze_rtas_format_ext_t), ## [in] ray tracing acceleration structure format - ("buildQuality", ze_rtas_builder_build_quality_hint_ext_t), ## [in] acceleration structure build quality hint - ("buildFlags", ze_rtas_builder_build_op_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t - ## flags - ("ppGeometries", POINTER(ze_rtas_builder_geometry_info_ext_t*)),## [in][optional][range(0, `numGeometries`)] NULL or a valid array of - ## pointers to geometry infos - ("numGeometries", c_ulong) ## [in] number of geometries in geometry infos array, can be zero when - ## `ppGeometries` is NULL + ("copyBandwidth", c_ulong), ## [out] design bandwidth supported by this engine type for copy + ## operations + ("copyBandwidthUnit", ze_bandwidth_unit_t) ## [out] copy bandwidth unit ] ############################################################################### -## @brief Device Vector Sizes Query Extension Name -ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" +## @brief Device Local Identifier (LUID) Extension Name +ZE_DEVICE_LUID_EXT_NAME = "ZE_extension_device_luid" ############################################################################### -## @brief Device Vector Sizes Query Extension Version(s) -class ze_device_vector_sizes_ext_version_v(IntEnum): +## @brief Device Local Identifier (LUID) Extension Version(s) +class ze_device_luid_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_vector_sizes_ext_version_t(c_int): +class ze_device_luid_ext_version_t(c_int): def __str__(self): - return str(ze_device_vector_sizes_ext_version_v(self.value)) + return str(ze_device_luid_ext_version_v(self.value)) ############################################################################### -## @brief Device Vector Width Properties queried using -## $DeviceGetVectorWidthPropertiesExt -class ze_device_vector_width_properties_ext_t(Structure): +## @brief Maximum device local identifier (LUID) size in bytes +ZE_MAX_DEVICE_LUID_SIZE_EXT = 8 + +############################################################################### +## @brief Device local identifier (LUID) +class ze_device_luid_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). - ("vector_width_size", c_ulong), ## [out] The associated vector width size supported by the device. - ("preferred_vector_width_char", c_ulong), ## [out] The preferred vector width size for char type supported by the device. - ("preferred_vector_width_short", c_ulong), ## [out] The preferred vector width size for short type supported by the device. - ("preferred_vector_width_int", c_ulong), ## [out] The preferred vector width size for int type supported by the device. - ("preferred_vector_width_long", c_ulong), ## [out] The preferred vector width size for long type supported by the device. - ("preferred_vector_width_float", c_ulong), ## [out] The preferred vector width size for float type supported by the device. - ("preferred_vector_width_double", c_ulong), ## [out] The preferred vector width size for double type supported by the device. - ("preferred_vector_width_half", c_ulong), ## [out] The preferred vector width size for half type supported by the device. - ("native_vector_width_char", c_ulong), ## [out] The native vector width size for char type supported by the device. - ("native_vector_width_short", c_ulong), ## [out] The native vector width size for short type supported by the device. - ("native_vector_width_int", c_ulong), ## [out] The native vector width size for int type supported by the device. - ("native_vector_width_long", c_ulong), ## [out] The native vector width size for long type supported by the device. - ("native_vector_width_float", c_ulong), ## [out] The native vector width size for float type supported by the device. - ("native_vector_width_double", c_ulong), ## [out] The native vector width size for double type supported by the device. - ("native_vector_width_half", c_ulong) ## [out] The native vector width size for half type supported by the device. + ("id", c_ubyte * ZE_MAX_DEVICE_LUID_SIZE_EXT) ## [out] opaque data representing a device LUID ] ############################################################################### -## @brief External Memory Mapping Extension Name -ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME = "ZE_extension_external_memmap_sysmem" - -############################################################################### -## @brief External Memory Mapping Extension Version(s) -class ze_external_memmap_sysmem_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_external_memmap_sysmem_ext_version_t(c_int): - def __str__(self): - return str(ze_external_memmap_sysmem_ext_version_v(self.value)) - - -############################################################################### -## @brief Maps external system memory for an allocation +## @brief Device LUID properties queried using ::zeDeviceGetProperties ## ## @details -## - This structure may be passed to ::zeMemAllocHost, via the `pNext` -## member of ::ze_host_mem_alloc_desc_t to map system memory for a host -## allocation. -## - The `pSystemMemory` pointer and `size` being mapped must be aligned to -## the host page size. The host page size must be queried using -## operating-system-specific calls, as the mapped memory originates from -## the system allocator rather than from Level-Zero; there is no -## Level-Zero query for this value. -## - On success, the pointer returned from ::zeMemAllocHost is identical to -## `pSystemMemory`; the mapping preserves the virtual address, so the -## same address is valid on both the host and the device. -## - Memory from the application's heap, stack, or statically-allocated -## (global) storage is supported. Support for memory obtained by other -## means is platform- and driver-dependent and is not guaranteed. If -## `pSystemMemory` points to a memory type that cannot be mapped, -## ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. -## - Host memory that is read-only can only be mapped successfully when the -## ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in -## ::ze_host_mem_alloc_desc_t; in that case device access to the mapped -## memory is read-only. -## - The system memory referenced by `pSystemMemory` must remain valid for -## the entire lifetime of the resulting allocation. Freeing or unmapping -## the underlying system memory before the allocation is released results -## in undefined behavior. -## - Mapped memory ranges must not overlap. Releasing a mapping with -## ::zeMemFree tears down the device page-table entries for its virtual -## address range. Because these page tables are shared across imports, -## releasing a mapping that overlaps another import also tears down the -## overlapping device page-table entries, leaving the other allocation -## invalid for device access. The host system memory itself is -## unaffected. -## - After mapping, ::zeMemGetAllocProperties reports the allocation type -## as ::ZE_MEMORY_TYPE_HOST_IMPORTED. -## - The mapping is released by passing the pointer to ::zeMemFree, like -## any other host allocation. -class ze_external_memmap_sysmem_ext_desc_t(Structure): +## - This structure may be returned from ::zeDeviceGetProperties, via the +## `pNext` member of ::ze_device_properties_t. +class ze_device_luid_ext_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("pSystemMemory", c_void_p), ## [in] system memory pointer to map; must be page-aligned. - ("size", c_ulonglong) ## [in] size of the system memory to map; must be a multiple of the page - ## size. + ("luid", ze_device_luid_ext_t), ## [out] locally unique identifier (LUID). + ## The returned LUID can be cast to a LUID object and must be equal to + ## the locally + ## unique identifier of an IDXGIAdapter1 object that corresponds to the device. + ("nodeMask", c_ulong) ## [out] node mask. + ## The returned node mask must contain exactly one bit. + ## If the device is running on an operating system that supports the + ## Direct3D 12 API + ## and the device corresponds to an individual device in a linked device + ## adapter, the + ## returned node mask identifies the Direct3D 12 node corresponding to + ## the device. + ## Otherwise, the returned node mask must be 1. ] ############################################################################### -## @brief Get Kernel Allocation Properties Extension Name -ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME = "ZE_experimental_kernel_allocation_properties" +## @brief Fabric Topology Discovery Extension Name +ZE_FABRIC_EXP_NAME = "ZE_experimental_fabric" ############################################################################### -## @brief Get Kernel Allocation Properties Extension Version(s) -class ze_kernel_get_allocation_properties_exp_version_v(IntEnum): +## @brief Fabric Topology Discovery Extension Version(s) +class ze_fabric_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_kernel_get_allocation_properties_exp_version_t(c_int): +class ze_fabric_exp_version_t(c_int): def __str__(self): - return str(ze_kernel_get_allocation_properties_exp_version_v(self.value)) + return str(ze_fabric_exp_version_v(self.value)) ############################################################################### -## @brief Kernel allocation properties -class ze_kernel_allocation_exp_properties_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). - ("base", c_ulonglong), ## [out] base address of the allocation - ("size", c_size_t), ## [out] size of allocation - ("type", ze_memory_type_t), ## [out] type of allocation - ("argIndex", c_ulong) ## [out] kernel argument index for current allocation, -1 for driver - ## internal (not kernel argument) allocations - ] +## @brief Maximum fabric edge model string size +ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE = 256 ############################################################################### -## @brief Device Usable Memory Size Properties Extension Name -ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_device_usablemem_size_properties" +## @brief Fabric Vertex types +class ze_fabric_vertex_exp_type_v(IntEnum): + UNKNOWN = 0 ## Fabric vertex type is unknown + DEVICE = 1 ## Fabric vertex represents a device + SUBDEVICE = 2 ## Fabric vertex represents a subdevice + SWITCH = 3 ## Fabric vertex represents a switch + +class ze_fabric_vertex_exp_type_t(c_int): + def __str__(self): + return str(ze_fabric_vertex_exp_type_v(self.value)) + ############################################################################### -## @brief Device Usable Mem Size Extension Version(s) -class ze_device_usablemem_size_properties_ext_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Fabric edge duplexity +class ze_fabric_edge_exp_duplexity_v(IntEnum): + UNKNOWN = 0 ## Fabric edge duplexity is unknown + HALF_DUPLEX = 1 ## Fabric edge is half duplex, i.e. stated bandwidth is obtained in only + ## one direction at time + FULL_DUPLEX = 2 ## Fabric edge is full duplex, i.e. stated bandwidth is supported in both + ## directions simultaneously -class ze_device_usablemem_size_properties_ext_version_t(c_int): +class ze_fabric_edge_exp_duplexity_t(c_int): def __str__(self): - return str(ze_device_usablemem_size_properties_ext_version_v(self.value)) + return str(ze_fabric_edge_exp_duplexity_v(self.value)) ############################################################################### -## @brief Memory access property to discover current status of usable memory +## @brief PCI address ## ## @details -## - This structure may be returned from ::zeDeviceGetProperties via the -## `pNext` member of ::ze_device_properties_t -class ze_device_usablemem_size_ext_properties_t(Structure): +## - A PCI BDF address is the bus:device:function address of the device and +## is useful for locating the device in the PCI switch fabric. +class ze_fabric_vertex_pci_exp_address_t(Structure): + _fields_ = [ + ("domain", c_ulong), ## [out] PCI domain number + ("bus", c_ulong), ## [out] PCI BDF bus number + ("device", c_ulong), ## [out] PCI BDF device number + ("function", c_ulong) ## [out] PCI BDF function number + ] + +############################################################################### +## @brief Fabric Vertex properties +class ze_fabric_vertex_exp_properties_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). - ("currUsableMemSize", c_ulonglong) ## [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. + ("uuid", ze_uuid_t), ## [out] universal unique identifier. If the vertex is co-located with a + ## device/subdevice, then this uuid will match that of the corresponding + ## device/subdevice + ("type", ze_fabric_vertex_exp_type_t), ## [out] does the fabric vertex represent a device, subdevice, or switch? + ("remote", ze_bool_t), ## [out] does the fabric vertex live on the local node or on a remote + ## node? + ("address", ze_fabric_vertex_pci_exp_address_t) ## [out] B/D/F address of fabric vertex & associated device/subdevice if + ## available ] ############################################################################### -## @brief Image Format Support Extension Name -ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME = "ZE_extension_image_format_support" - -############################################################################### -## @brief Image Format Support Extension Version(s) -class ze_image_format_support_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_image_format_support_ext_version_t(c_int): - def __str__(self): - return str(ze_image_format_support_ext_version_v(self.value)) - - -############################################################################### -## @brief Image format support query properties -## -## @details -## - This structure may be passed to ::zeImageGetProperties via the pNext -## member of ::ze_image_properties_t. -## - The implementation shall populate the supported field based on the -## ::ze_image_desc_t and ::ze_device_handle_t passed to -## ::zeImageGetProperties. -## - This provides a mechanism to query format support without requiring -## image creation. -class ze_image_format_support_ext_properties_t(Structure): +## @brief Fabric Edge properties +class ze_fabric_edge_exp_properties_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). - ("supported", ze_bool_t) ## [out] boolean flag indicating whether the image format is supported on - ## the queried device + ("uuid", ze_uuid_t), ## [out] universal unique identifier. + ("model", c_char * ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE), ## [out] Description of fabric edge technology. Will be set to the string + ## "unkown" if this cannot be determined for this edge + ("bandwidth", c_ulong), ## [out] design bandwidth + ("bandwidthUnit", ze_bandwidth_unit_t), ## [out] bandwidth unit + ("latency", c_ulong), ## [out] design latency + ("latencyUnit", ze_latency_unit_t), ## [out] latency unit + ("duplexity", ze_fabric_edge_exp_duplexity_t) ## [out] Duplexity of the fabric edge ] ############################################################################### -## @brief IPC Memory Handle Type Extension Name -ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME = "ZE_extension_ipc_mem_handle_type" +## @brief Device Memory Properties Extension Name +ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME = "ZE_extension_device_memory_properties" ############################################################################### -## @brief IPC Memory Handle Type Extension Version(s) -class ze_ipc_mem_handle_type_ext_version_v(IntEnum): +## @brief Device Memory Properties Extension Version(s) +class ze_device_memory_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_ipc_mem_handle_type_ext_version_t(c_int): - def __str__(self): - return str(ze_ipc_mem_handle_type_ext_version_v(self.value)) - - -############################################################################### -## @brief Supported IPC memory handle type flags -class ze_ipc_mem_handle_type_flags_v(IntEnum): - DEFAULT = ZE_BIT(0) ## Local IPC memory handle type for use within the same device. This is - ## the default if no flags are specified and does not indicate if the - ## handle is shareable across devices or machines. - FABRIC_ACCESSIBLE = ZE_BIT(1) ## Fabric accessible IPC memory handle type for use across devices or - ## machines via a supported fabric. - -class ze_ipc_mem_handle_type_flags_t(c_int): +class ze_device_memory_properties_ext_version_t(c_int): def __str__(self): - return hex(self.value) - - -############################################################################### -## @brief ['IPC Memory Handle Type Extension Descriptor', 'Used in -## ::zeMemGetIpcHandleWithProperties, ::zeMemAllocDevice, and -## ::zeMemAllocHost, ::zePhysicalMemCreate to specify the IPC memory -## handle type to create for this allocation.'] -class ze_ipc_mem_handle_type_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). - ("typeFlags", ze_ipc_mem_handle_type_flags_t) ## [in] valid combination of ::ze_ipc_mem_handle_type_flag_t - ] + return str(ze_device_memory_properties_ext_version_v(self.value)) -############################################################################### -## @brief Record and Replay Graph Extension Name -ZE_RECORD_REPLAY_GRAPH_EXT_NAME = "ZE_extension_record_replay_graph" ############################################################################### -## @brief Record and Replay Graph Extension Version(s) -class ze_record_replay_graph_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_record_replay_graph_ext_version_t(c_int): - def __str__(self): - return str(ze_record_replay_graph_ext_version_v(self.value)) - - -############################################################################### -## @brief Record and Replay Graph capability flags -class ze_record_replay_graph_ext_flags_v(IntEnum): - IMMUTABLE_GRAPH = ZE_BIT(0) ## Supports graphs that can't mutate - MUTABLE_GRAPH = ZE_BIT(1) ## Supports graphs that can mutate - SUBGRAPHS = ZE_BIT(2) ## Supports appending a subgraph into a graph - APPEND_COMMANDLIST = ZE_BIT(3) ## Supports appending a command list into a graph - CB_EXTERNAL_IPC = ZE_BIT(4) ## Supports waiting/signaling events that were created with both - ## ZEX_COUNTER_BASED_EVENT_FLAG_IPC and - ## ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL +## @brief Memory module types +class ze_device_memory_ext_type_v(IntEnum): + HBM = 0 ## HBM memory + HBM2 = 1 ## HBM2 memory + DDR = 2 ## DDR memory + DDR2 = 3 ## DDR2 memory + DDR3 = 4 ## DDR3 memory + DDR4 = 5 ## DDR4 memory + DDR5 = 6 ## DDR5 memory + LPDDR = 7 ## LPDDR memory + LPDDR3 = 8 ## LPDDR3 memory + LPDDR4 = 9 ## LPDDR4 memory + LPDDR5 = 10 ## LPDDR5 memory + SRAM = 11 ## SRAM memory + L1 = 12 ## L1 cache + L3 = 13 ## L3 cache + GRF = 14 ## Execution unit register file + SLM = 15 ## Execution unit shared local memory + GDDR4 = 16 ## GDDR4 memory + GDDR5 = 17 ## GDDR5 memory + GDDR5X = 18 ## GDDR5X memory + GDDR6 = 19 ## GDDR6 memory + GDDR6X = 20 ## GDDR6X memory + GDDR7 = 21 ## GDDR7 memory + HBM2E = 22 ## HBM2E memory + HBM3 = 23 ## HBM3 memory + HBM3E = 24 ## HBM3E memory + HBM4 = 25 ## HBM4 memory + LPDDR5X = 26 ## LPDDR5X memory + LPDDR6 = 27 ## LPDDR6 memory -class ze_record_replay_graph_ext_flags_t(c_int): +class ze_device_memory_ext_type_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_device_memory_ext_type_v(self.value)) ############################################################################### -## @brief Supported Record and Replay Graph properties. This structure is -## accepted as pNext to ::ze_device_properties_t -class ze_record_replay_graph_ext_properties_t(Structure): +## @brief Memory properties +## +## @details +## - This structure may be returned from ::zeDeviceGetMemoryProperties via +## the `pNext` member of ::ze_device_memory_properties_t +class ze_device_memory_ext_properties_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). - ("graphFlags", ze_record_replay_graph_ext_flags_t) ## [out] record and replay flags + ("type", ze_device_memory_ext_type_t), ## [out] The memory type + ("physicalSize", c_ulonglong), ## [out] Physical memory size in bytes. A value of 0 indicates that this + ## property is not known. However, a call to ::zesMemoryGetState() will + ## correctly return the total size of usable memory. + ("readBandwidth", c_ulong), ## [out] Design bandwidth for reads + ("writeBandwidth", c_ulong), ## [out] Design bandwidth for writes + ("bandwidthUnit", ze_bandwidth_unit_t) ## [out] bandwidth unit ] ############################################################################### -## @brief Handle of an executable graph object -class ze_executable_graph_handle_t(c_void_p): - pass +## @brief Bfloat16 Conversions Extension Name +ZE_BFLOAT16_CONVERSIONS_EXT_NAME = "ZE_extension_bfloat16_conversions" ############################################################################### -## @brief Record and Replay Graph dump mode -class ze_record_replay_graph_ext_dump_mode_v(IntEnum): - DETAILED = 0x0 ## detailed mode (default) - SIMPLE = 0x1 ## simple mode +## @brief Bfloat16 Conversions Extension Version(s) +class ze_bfloat16_conversions_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_record_replay_graph_ext_dump_mode_t(c_int): +class ze_bfloat16_conversions_ext_version_t(c_int): def __str__(self): - return str(ze_record_replay_graph_ext_dump_mode_v(self.value)) + return str(ze_bfloat16_conversions_ext_version_v(self.value)) ############################################################################### -## @brief Record and Replay Graph dump descriptor +## @brief Device IP Version Extension Name +ZE_DEVICE_IP_VERSION_EXT_NAME = "ZE_extension_device_ip_version" + +############################################################################### +## @brief Device IP Version Extension Version(s) +class ze_device_ip_version_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_ip_version_version_t(c_int): + def __str__(self): + return str(ze_device_ip_version_version_v(self.value)) + + +############################################################################### +## @brief Device IP version queried using ::zeDeviceGetProperties ## ## @details -## - Accepted as pNext in ::zeGraphDumpContentsExt. -class ze_record_replay_graph_ext_dump_desc_t(Structure): +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t +class ze_device_ip_version_ext_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). - ("mode", ze_record_replay_graph_ext_dump_mode_t) ## [in] graph dump mode + ("ipVersion", c_ulong) ## [out] Device IP version. The meaning of the device IP version is + ## implementation-defined, but newer devices should have a higher + ## version than older devices. ] ############################################################################### -## @brief Callback function pointer type invoked when a graph is destroyed - -############################################################################### -## @brief Host Function callback type - -############################################################################### -## @brief Virtual Memory Read-Only Properties Extension Name -ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME = "ZE_extension_virtual_mem_readonly_properties" +## @brief Kernel Max Group Size Properties Extension Name +ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_kernel_max_group_size_properties" ############################################################################### -## @brief Virtual Memory Read-Only Properties Extension Version(s) -class ze_virtual_mem_readonly_properties_ext_version_v(IntEnum): +## @brief Kernel Max Group Size Properties Extension Version(s) +class ze_kernel_max_group_size_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_virtual_mem_readonly_properties_ext_version_t(c_int): - def __str__(self): - return str(ze_virtual_mem_readonly_properties_ext_version_v(self.value)) - - -############################################################################### -## @brief Read-only memory page capability values -class ze_device_readonly_memory_capability_v(IntEnum): - NONE = 0 ## Read-only attribute has no effect; the driver does not act on it. - HINT = 1 ## Read-only attribute is a performance hint to the OS; writes may still - ## succeed without fault. - ENFORCED = 2 ## Read-only attribute is hardware-enforced; writes to read-only pages - ## will cause a device fault. - -class ze_device_readonly_memory_capability_t(c_int): +class ze_kernel_max_group_size_properties_ext_version_t(c_int): def __str__(self): - return str(ze_device_readonly_memory_capability_v(self.value)) + return str(ze_kernel_max_group_size_properties_ext_version_v(self.value)) ############################################################################### -## @brief Device read-only memory capability properties +## @brief Additional kernel max group size properties ## ## @details -## - This structure may be returned from ::zeDeviceGetProperties via the -## `pNext` member of ::ze_device_properties_t -class ze_device_readonly_memory_ext_properties_t(Structure): +## - This structure may be passed to ::zeKernelGetProperties, via the +## `pNext` member of ::ze_kernel_properties_t, to query additional kernel +## max group size properties. +class ze_kernel_max_group_size_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). - ("readonlyCapability", ze_device_readonly_memory_capability_t) ## [out] Indicates device behavior when - ## ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. - ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no - ## effect; writes succeed normally. - ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a - ## performance hint; writes may still succeed. - ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is - ## hardware-enforced; writes cause a device fault. + ("maxGroupSize", c_ulong) ## [out] maximum group size that can be used to execute the kernel. This + ## value may be less than or equal to the `maxTotalGroupSize` member of + ## ::ze_device_compute_properties_t. ] ############################################################################### -## @brief Cache_Reservation Extension Name -ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" +## @brief compiler-independent type +class ze_kernel_max_group_size_ext_properties_t(ze_kernel_max_group_size_properties_ext_t): + pass ############################################################################### -## @brief Cache_Reservation Extension Version(s) -class ze_cache_reservation_ext_version_v(IntEnum): +## @brief Sub-Allocations Properties Extension Name +ZE_SUB_ALLOCATIONS_EXP_NAME = "ZE_experimental_sub_allocations" + +############################################################################### +## @brief Sub-Allocations Properties Extension Version(s) +class ze_sub_allocations_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_cache_reservation_ext_version_t(c_int): +class ze_sub_allocations_exp_version_t(c_int): def __str__(self): - return str(ze_cache_reservation_ext_version_v(self.value)) + return str(ze_sub_allocations_exp_version_v(self.value)) ############################################################################### -## @brief Cache Reservation Region -class ze_cache_ext_region_v(IntEnum): - ZE_CACHE_REGION_DEFAULT = 0 ## [DEPRECATED] utilize driver default scheme. Use - ## ::ZE_CACHE_EXT_REGION_DEFAULT. - ZE_CACHE_RESERVE_REGION = 1 ## [DEPRECATED] utilize reserved region. Use - ## ::ZE_CACHE_EXT_REGION_RESERVED. - ZE_CACHE_NON_RESERVED_REGION = 2 ## [DEPRECATED] utilize non-reserverd region. Use - ## ::ZE_CACHE_EXT_REGION_NON_RESERVED. - DEFAULT = 0 ## utilize driver default scheme - RESERVED = 1 ## utilize reserved region - NON_RESERVED = 2 ## utilize non-reserverd region - -class ze_cache_ext_region_t(c_int): - def __str__(self): - return str(ze_cache_ext_region_v(self.value)) - +## @brief Properties returned for a sub-allocation +class ze_sub_allocation_t(Structure): + _fields_ = [ + ("base", c_void_p), ## [in,out][optional] base address of the sub-allocation + ("size", c_size_t) ## [in,out][optional] size of the allocation + ] ############################################################################### -## @brief CacheReservation structure +## @brief Sub-Allocations Properties ## ## @details -## - This structure must be passed to ::zeDeviceGetCacheProperties via the -## `pNext` member of ::ze_device_cache_properties_t -## - Used for determining the max cache reservation allowed on device. Size -## of zero means no reservation available. -class ze_cache_reservation_ext_desc_t(Structure): +## - This structure may be passed to ::zeMemGetAllocProperties, via the +## `pNext` member of ::ze_memory_allocation_properties_t. +class ze_memory_sub_allocations_exp_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("maxCacheReservationSize", c_size_t) ## [out] max cache reservation size + ("pCount", POINTER(c_ulong)), ## [in,out] pointer to the number of sub-allocations. + ## if count is zero, then the driver shall update the value with the + ## total number of sub-allocations on which the allocation has been divided. + ## if count is greater than the number of sub-allocations, then the + ## driver shall update the value with the correct number of sub-allocations. + ("pSubAllocations", POINTER(ze_sub_allocation_t)) ## [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. + ## if count is less than the number of sub-allocations available, then + ## driver shall only retrieve properties for that number of sub-allocations. ] ############################################################################### -## @brief Event Query Timestamps Extension Name -ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME = "ZE_experimental_event_query_timestamps" +## @brief Event Query Kernel Timestamps Extension Name +ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME = "ZE_extension_event_query_kernel_timestamps" ############################################################################### -## @brief Event Query Timestamps Extension Version(s) -class ze_event_query_timestamps_exp_version_v(IntEnum): +## @brief Event Query Kernel Timestamps Extension Version(s) +class ze_event_query_kernel_timestamps_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_event_query_timestamps_exp_version_t(c_int): +class ze_event_query_kernel_timestamps_ext_version_t(c_int): def __str__(self): - return str(ze_event_query_timestamps_exp_version_v(self.value)) - + return str(ze_event_query_kernel_timestamps_ext_version_v(self.value)) -############################################################################### -## @brief Image Memory Properties Extension Name -ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME = "ZE_experimental_image_memory_properties" ############################################################################### -## @brief Image Memory Properties Extension Version(s) -class ze_image_memory_properties_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Event query kernel timestamps flags +class ze_event_query_kernel_timestamps_ext_flags_v(IntEnum): + KERNEL = ZE_BIT(0) ## Kernel timestamp results + SYNCHRONIZED = ZE_BIT(1) ## Device event timestamps synchronized to the host time domain -class ze_image_memory_properties_exp_version_t(c_int): +class ze_event_query_kernel_timestamps_ext_flags_t(c_int): def __str__(self): - return str(ze_image_memory_properties_exp_version_v(self.value)) + return hex(self.value) ############################################################################### -## @brief Image memory properties -class ze_image_memory_properties_exp_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_ulonglong), ## [out] size of image allocation in bytes. - ("rowPitch", c_ulonglong), ## [out] size of image row in bytes. - ("slicePitch", c_ulonglong) ## [out] size of image slice in bytes. - ] - -############################################################################### -## @brief Image View Extension Name -ZE_IMAGE_VIEW_EXT_NAME = "ZE_extension_image_view" - -############################################################################### -## @brief Image View Extension Version(s) -class ze_image_view_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_image_view_ext_version_t(c_int): - def __str__(self): - return str(ze_image_view_ext_version_v(self.value)) - - -############################################################################### -## @brief Image View Extension Name -ZE_IMAGE_VIEW_EXP_NAME = "ZE_experimental_image_view" - -############################################################################### -## @brief Image View Extension Version(s) -class ze_image_view_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_image_view_exp_version_t(c_int): - def __str__(self): - return str(ze_image_view_exp_version_v(self.value)) - - -############################################################################### -## @brief Image View Planar Extension Name -ZE_IMAGE_VIEW_PLANAR_EXT_NAME = "ZE_extension_image_view_planar" - -############################################################################### -## @brief Image View Planar Extension Version(s) -class ze_image_view_planar_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_image_view_planar_ext_version_t(c_int): - def __str__(self): - return str(ze_image_view_planar_ext_version_v(self.value)) - - -############################################################################### -## @brief Image view planar descriptor -class ze_image_view_planar_ext_desc_t(Structure): +## @brief Event query kernel timestamps properties +## +## @details +## - This structure may be returned from ::zeDeviceGetProperties, via the +## `pNext` member of ::ze_device_properties_t. +class ze_event_query_kernel_timestamps_ext_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("planeIndex", c_ulong) ## [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) + ("flags", ze_event_query_kernel_timestamps_ext_flags_t) ## [out] 0 or some combination of + ## ::ze_event_query_kernel_timestamps_ext_flag_t flags ] ############################################################################### -## @brief Image View Planar Extension Name -ZE_IMAGE_VIEW_PLANAR_EXP_NAME = "ZE_experimental_image_view_planar" +## @brief Kernel timestamp clock data synchronized to the host time domain +class ze_synchronized_timestamp_data_ext_t(Structure): + _fields_ = [ + ("kernelStart", c_ulonglong), ## [out] start of kernel execution in nanoseconds, on the host time + ## domain. + ("kernelEnd", c_ulonglong) ## [out] end of kernel execution in nanoseconds, on the host time domain. + ] ############################################################################### -## @brief Image View Planar Extension Version(s) -class ze_image_view_planar_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_image_view_planar_exp_version_t(c_int): - def __str__(self): - return str(ze_image_view_planar_exp_version_v(self.value)) - +## @brief Synchronized kernel timestamp result +class ze_synchronized_timestamp_result_ext_t(Structure): + _fields_ = [ + ("global", ze_synchronized_timestamp_data_ext_t), ## [out] wall-clock data; free running device clock when device was + ## active,on the host time domain + ("context", ze_synchronized_timestamp_data_ext_t) ## [out] context specific active data; only includes clocks while context + ## was actively executing on the device, on the host time domain + ] ############################################################################### -## @brief Image view planar descriptor -class ze_image_view_planar_exp_desc_t(Structure): +## @brief Event query kernel timestamps results properties +class ze_event_query_kernel_timestamps_results_ext_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("planeIndex", c_ulong) ## [DEPRECATED] no longer supported, use - ## ::ze_image_view_planar_ext_desc_t instead + ("pKernelTimestampsBuffer", POINTER(ze_kernel_timestamp_result_t)), ## [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ## kernel timestamp results + ("pSynchronizedTimestampsBuffer", POINTER(ze_synchronized_timestamp_result_ext_t)) ## [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ## synchronized timestamp results ] ############################################################################### -## @brief Kernel Scheduling Hints Extension Name -ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME = "ZE_experimental_scheduling_hints" +## @brief Ray Tracing Acceleration Structure Builder Extension Name +ZE_RTAS_BUILDER_EXP_NAME = "ZE_experimental_rtas_builder" ############################################################################### -## @brief Kernel Scheduling Hints Extension Version(s) -class ze_scheduling_hints_exp_version_v(IntEnum): +## @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +class ze_rtas_builder_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_scheduling_hints_exp_version_t(c_int): +class ze_rtas_builder_exp_version_t(c_int): def __str__(self): - return str(ze_scheduling_hints_exp_version_v(self.value)) + return str(ze_rtas_builder_exp_version_v(self.value)) ############################################################################### -## @brief Supported kernel scheduling hint flags -class ze_scheduling_hint_exp_flags_v(IntEnum): - OLDEST_FIRST = ZE_BIT(0) ## Hint that the kernel prefers oldest-first scheduling - ROUND_ROBIN = ZE_BIT(1) ## Hint that the kernel prefers round-robin scheduling - STALL_BASED_ROUND_ROBIN = ZE_BIT(2) ## Hint that the kernel prefers stall-based round-robin scheduling +## @brief Ray tracing acceleration structure device flags +class ze_rtas_device_exp_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## reserved for future use -class ze_scheduling_hint_exp_flags_t(c_int): +class ze_rtas_device_exp_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Device kernel scheduling hint properties queried using -## ::zeDeviceGetModuleProperties +## @brief Ray tracing acceleration structure format ## ## @details -## - This structure may be returned from ::zeDeviceGetModuleProperties, via -## the `pNext` member of ::ze_device_module_properties_t. -class ze_scheduling_hint_exp_properties_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). - ("schedulingHintFlags", ze_scheduling_hint_exp_flags_t) ## [out] Supported kernel scheduling hints. - ## May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. - ] +## - This is an opaque ray tracing acceleration structure format +## identifier. +class ze_rtas_format_exp_v(IntEnum): + INVALID = 0 ## Invalid acceleration structure format + MAX = 0x7ffffffe ## Maximum acceleration structure format code -############################################################################### -## @brief Kernel scheduling hint descriptor -## -## @details -## - This structure may be passed to ::zeKernelSchedulingHintExp. -class ze_scheduling_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). - ("flags", ze_scheduling_hint_exp_flags_t) ## [in] flags specifying kernel scheduling hints. - ## must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. - ] +class ze_rtas_format_exp_t(c_int): + def __str__(self): + return str(ze_rtas_format_exp_v(self.value)) -############################################################################### -## @brief Linkonce ODR Extension Name -ZE_LINKONCE_ODR_EXT_NAME = "ZE_extension_linkonce_odr" ############################################################################### -## @brief Linkonce ODR Extension Version(s) -class ze_linkonce_odr_ext_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Ray tracing acceleration structure builder flags +class ze_rtas_builder_exp_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use -class ze_linkonce_odr_ext_version_t(c_int): +class ze_rtas_builder_exp_flags_t(c_int): def __str__(self): - return str(ze_linkonce_odr_ext_version_v(self.value)) - + return hex(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 +## @brief Ray tracing acceleration structure builder parallel operation flags +class ze_rtas_parallel_operation_exp_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use -class ze_power_saving_hint_exp_version_t(c_int): +class ze_rtas_parallel_operation_exp_flags_t(c_int): def __str__(self): - return str(ze_power_saving_hint_exp_version_v(self.value)) + return hex(self.value) ############################################################################### -## @brief Supported device types -class ze_power_saving_hint_type_v(IntEnum): - MIN = 0 ## Minumum 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. +## @brief Ray tracing acceleration structure builder geometry flags +class ze_rtas_builder_geometry_exp_flags_v(IntEnum): + NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader -class ze_power_saving_hint_type_t(c_int): +class ze_rtas_builder_geometry_exp_flags_t(c_int): def __str__(self): - return str(ze_power_saving_hint_type_v(self.value)) - + return hex(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" +## @brief Packed ray tracing acceleration structure builder geometry flags (see +## ::ze_rtas_builder_geometry_exp_flags_t) +class ze_rtas_builder_packed_geometry_exp_flags_t(c_ubyte): + pass ############################################################################### -## @brief Subgroups Extension Version(s) -class ze_subgroup_ext_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Ray tracing acceleration structure builder instance flags +class ze_rtas_builder_instance_exp_flags_v(IntEnum): + TRIANGLE_CULL_DISABLE = ZE_BIT(0) ## disables culling of front-facing and back-facing triangles + TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1) ## reverses front and back face of triangles + TRIANGLE_FORCE_OPAQUE = ZE_BIT(2) ## forces instanced geometry to be opaque, unless ray flag forces it to + ## be non-opaque + TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3) ## forces instanced geometry to be non-opaque, unless ray flag forces it + ## to be opaque -class ze_subgroup_ext_version_t(c_int): +class ze_rtas_builder_instance_exp_flags_t(c_int): def __str__(self): - return str(ze_subgroup_ext_version_v(self.value)) - + return hex(self.value) -############################################################################### -## @brief EU Count Extension Name -ZE_EU_COUNT_EXT_NAME = "ZE_extension_eu_count" ############################################################################### -## @brief EU Count Extension Version(s) -class ze_eu_count_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_eu_count_ext_version_t(c_int): - def __str__(self): - return str(ze_eu_count_ext_version_v(self.value)) - +## @brief Packed ray tracing acceleration structure builder instance flags (see +## ::ze_rtas_builder_instance_exp_flags_t) +class ze_rtas_builder_packed_instance_exp_flags_t(c_ubyte): + pass ############################################################################### -## @brief EU count queried using ::zeDeviceGetProperties +## @brief Ray tracing acceleration structure builder build operation flags ## ## @details -## - This structure may be returned from ::zeDeviceGetProperties via the -## `pNext` member of ::ze_device_properties_t. -## - Used for determining the total number of EUs available on device. -class ze_eu_count_ext_t(Structure): +## - These flags allow the application to tune the acceleration structure +## build operation. +## - The acceleration structure builder implementation might choose to use +## spatial splitting to split large or long primitives into smaller +## pieces. This may result in any-hit shaders being invoked multiple +## times for non-opaque primitives, unless +## ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +## - Usage of any of these flags may reduce ray tracing performance. +class ze_rtas_builder_build_op_exp_flags_v(IntEnum): + COMPACT = ZE_BIT(0) ## build more compact acceleration structure + NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1) ## guarantees single any-hit shader invocation per primitive + +class ze_rtas_builder_build_op_exp_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Ray tracing acceleration structure builder build quality hint +## +## @details +## - Depending on use case different quality modes for acceleration +## structure build are supported. +## - A low-quality build builds an acceleration structure fast, but at the +## cost of some reduction in ray tracing performance. This mode is +## recommended for dynamic content, such as animated characters. +## - A medium-quality build uses a compromise between build quality and ray +## tracing performance. This mode should be used by default. +## - Higher ray tracing performance can be achieved by using a high-quality +## build, but acceleration structure build performance might be +## significantly reduced. +class ze_rtas_builder_build_quality_hint_exp_v(IntEnum): + LOW = 0 ## build low-quality acceleration structure (fast) + MEDIUM = 1 ## build medium-quality acceleration structure (slower) + HIGH = 2 ## build high-quality acceleration structure (slow) + +class ze_rtas_builder_build_quality_hint_exp_t(c_int): + def __str__(self): + return str(ze_rtas_builder_build_quality_hint_exp_v(self.value)) + + +############################################################################### +## @brief Ray tracing acceleration structure builder geometry type +class ze_rtas_builder_geometry_type_exp_v(IntEnum): + TRIANGLES = 0 ## triangle mesh geometry type + QUADS = 1 ## quad mesh geometry type + PROCEDURAL = 2 ## procedural geometry type + INSTANCE = 3 ## instance geometry type + +class ze_rtas_builder_geometry_type_exp_t(c_int): + def __str__(self): + return str(ze_rtas_builder_geometry_type_exp_v(self.value)) + + +############################################################################### +## @brief Packed ray tracing acceleration structure builder geometry type (see +## ::ze_rtas_builder_geometry_type_exp_t) +class ze_rtas_builder_packed_geometry_type_exp_t(c_ubyte): + pass + +############################################################################### +## @brief Ray tracing acceleration structure data buffer element format +## +## @details +## - Specifies the format of data buffer elements. +## - Data buffers may contain instancing transform matrices, triangle/quad +## vertex indices, etc... +class ze_rtas_builder_input_data_format_exp_v(IntEnum): + FLOAT3 = 0 ## 3-component float vector (see ::ze_rtas_float3_exp_t) + FLOAT3X4_COLUMN_MAJOR = 1 ## 3x4 affine transformation in column-major format (see + ## ::ze_rtas_transform_float3x4_column_major_exp_t) + FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2 ## 3x4 affine transformation in column-major format (see + ## ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) + FLOAT3X4_ROW_MAJOR = 3 ## 3x4 affine transformation in row-major format (see + ## ::ze_rtas_transform_float3x4_row_major_exp_t) + AABB = 4 ## 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) + TRIANGLE_INDICES_UINT32 = 5 ## Unsigned 32-bit triangle indices (see + ## ::ze_rtas_triangle_indices_uint32_exp_t) + QUAD_INDICES_UINT32 = 6 ## Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) + +class ze_rtas_builder_input_data_format_exp_t(c_int): + def __str__(self): + return str(ze_rtas_builder_input_data_format_exp_v(self.value)) + + +############################################################################### +## @brief Packed ray tracing acceleration structure data buffer element format +## (see ::ze_rtas_builder_input_data_format_exp_t) +class ze_rtas_builder_packed_input_data_format_exp_t(c_ubyte): + pass + +############################################################################### +## @brief Handle of ray tracing acceleration structure builder object +class ze_rtas_builder_exp_handle_t(c_void_p): + pass + +############################################################################### +## @brief Handle of ray tracing acceleration structure builder parallel +## operation object +class ze_rtas_parallel_operation_exp_handle_t(c_void_p): + pass + +############################################################################### +## @brief Ray tracing acceleration structure builder descriptor +class ze_rtas_builder_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). - ("numTotalEUs", c_ulong) ## [out] Total number of EUs available + ("builderVersion", ze_rtas_builder_exp_version_t) ## [in] ray tracing acceleration structure builder version ] ############################################################################### -## @brief PCI Properties Extension Name -ZE_PCI_PROPERTIES_EXT_NAME = "ZE_extension_pci_properties" +## @brief Ray tracing acceleration structure builder properties +class ze_rtas_builder_exp_properties_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). + ("flags", ze_rtas_builder_exp_flags_t), ## [out] ray tracing acceleration structure builder flags + ("rtasBufferSizeBytesExpected", c_size_t), ## [out] expected size (in bytes) required for acceleration structure buffer + ## - When using an acceleration structure buffer of this size, the + ## build is expected to succeed; however, it is possible that the build + ## may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY + ("rtasBufferSizeBytesMaxRequired", c_size_t), ## [out] worst-case size (in bytes) required for acceleration structure buffer + ## - When using an acceleration structure buffer of this size, the + ## build is guaranteed to not run out of memory. + ("scratchBufferSizeBytes", c_size_t) ## [out] scratch buffer size (in bytes) required for acceleration + ## structure build. + ] ############################################################################### -## @brief PCI Properties Extension Version(s) -class ze_pci_properties_ext_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Ray tracing acceleration structure builder parallel operation +## properties +class ze_rtas_parallel_operation_exp_properties_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). + ("flags", ze_rtas_parallel_operation_exp_flags_t), ## [out] ray tracing acceleration structure builder parallel operation + ## flags + ("maxConcurrency", c_ulong) ## [out] maximum number of threads that may join the parallel operation + ] -class ze_pci_properties_ext_version_t(c_int): - def __str__(self): - return str(ze_pci_properties_ext_version_v(self.value)) +############################################################################### +## @brief Ray tracing acceleration structure device properties +## +## @details +## - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +## member of ::ze_device_properties_t. +## - The implementation shall populate `format` with a value other than +## ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. +class ze_rtas_device_exp_properties_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). + ("flags", ze_rtas_device_exp_flags_t), ## [out] ray tracing acceleration structure device flags + ("rtasFormat", ze_rtas_format_exp_t), ## [out] ray tracing acceleration structure format + ("rtasBufferAlignment", c_ulong) ## [out] required alignment of acceleration structure buffer + ] +############################################################################### +## @brief A 3-component vector type +class ze_rtas_float3_exp_t(Structure): + _fields_ = [ + ("x", c_float), ## [in] x-coordinate of float3 vector + ("y", c_float), ## [in] y-coordinate of float3 vector + ("z", c_float) ## [in] z-coordinate of float3 vector + ] ############################################################################### -## @brief Device PCI address +## @brief 3x4 affine transformation in column-major layout ## ## @details -## - This structure may be passed to ::zeDevicePciGetPropertiesExt as an -## attribute of ::ze_pci_ext_properties_t. -## - A PCI BDF address is the bus:device:function address of the device and -## is useful for locating the device in the PCI switch fabric. -class ze_pci_address_ext_t(Structure): +## - A 3x4 affine transformation in column major layout, consisting of vectors +## - vx=(vx_x, vx_y, vx_z), +## - vy=(vy_x, vy_y, vy_z), +## - vz=(vz_x, vz_y, vz_z), and +## - p=(p_x, p_y, p_z) +## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +## z*vz + p`. +class ze_rtas_transform_float3x4_column_major_exp_t(Structure): _fields_ = [ - ("domain", c_ulong), ## [out] PCI domain number - ("bus", c_ulong), ## [out] PCI BDF bus number - ("device", c_ulong), ## [out] PCI BDF device number - ("function", c_ulong) ## [out] PCI BDF function number + ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix + ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix + ("vx_z", c_float), ## [in] element 2 of column 0 of 3x4 matrix + ("vy_x", c_float), ## [in] element 0 of column 1 of 3x4 matrix + ("vy_y", c_float), ## [in] element 1 of column 1 of 3x4 matrix + ("vy_z", c_float), ## [in] element 2 of column 1 of 3x4 matrix + ("vz_x", c_float), ## [in] element 0 of column 2 of 3x4 matrix + ("vz_y", c_float), ## [in] element 1 of column 2 of 3x4 matrix + ("vz_z", c_float), ## [in] element 2 of column 2 of 3x4 matrix + ("p_x", c_float), ## [in] element 0 of column 3 of 3x4 matrix + ("p_y", c_float), ## [in] element 1 of column 3 of 3x4 matrix + ("p_z", c_float) ## [in] element 2 of column 3 of 3x4 matrix ] ############################################################################### -## @brief Device PCI speed -class ze_pci_speed_ext_t(Structure): +## @brief 3x4 affine transformation in column-major layout with aligned column +## vectors +## +## @details +## - A 3x4 affine transformation in column major layout, consisting of vectors +## - vx=(vx_x, vx_y, vx_z), +## - vy=(vy_x, vy_y, vy_z), +## - vz=(vz_x, vz_y, vz_z), and +## - p=(p_x, p_y, p_z) +## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +## z*vz + p`. +## - The column vectors are aligned to 16-bytes and pad members are +## ignored. +class ze_rtas_transform_float3x4_aligned_column_major_exp_t(Structure): _fields_ = [ - ("genVersion", c_int32_t), ## [out] The link generation. A value of -1 means that this property is - ## unknown. - ("width", c_int32_t), ## [out] The number of lanes. A value of -1 means that this property is - ## unknown. - ("maxBandwidth", c_int64_t) ## [out] The theoretical maximum bandwidth in bytes/sec (sum of all - ## lanes). A value of -1 means that this property is unknown. + ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix + ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix + ("vx_z", c_float), ## [in] element 2 of column 0 of 3x4 matrix + ("pad0", c_float), ## [in] ignored padding + ("vy_x", c_float), ## [in] element 0 of column 1 of 3x4 matrix + ("vy_y", c_float), ## [in] element 1 of column 1 of 3x4 matrix + ("vy_z", c_float), ## [in] element 2 of column 1 of 3x4 matrix + ("pad1", c_float), ## [in] ignored padding + ("vz_x", c_float), ## [in] element 0 of column 2 of 3x4 matrix + ("vz_y", c_float), ## [in] element 1 of column 2 of 3x4 matrix + ("vz_z", c_float), ## [in] element 2 of column 2 of 3x4 matrix + ("pad2", c_float), ## [in] ignored padding + ("p_x", c_float), ## [in] element 0 of column 3 of 3x4 matrix + ("p_y", c_float), ## [in] element 1 of column 3 of 3x4 matrix + ("p_z", c_float), ## [in] element 2 of column 3 of 3x4 matrix + ("pad3", c_float) ## [in] ignored padding + ] + +############################################################################### +## @brief 3x4 affine transformation in row-major layout +## +## @details +## - A 3x4 affine transformation in row-major layout, consisting of vectors +## - vx=(vx_x, vx_y, vx_z), +## - vy=(vy_x, vy_y, vy_z), +## - vz=(vz_x, vz_y, vz_z), and +## - p=(p_x, p_y, p_z) +## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +## z*vz + p`. +class ze_rtas_transform_float3x4_row_major_exp_t(Structure): + _fields_ = [ + ("vx_x", c_float), ## [in] element 0 of row 0 of 3x4 matrix + ("vy_x", c_float), ## [in] element 1 of row 0 of 3x4 matrix + ("vz_x", c_float), ## [in] element 2 of row 0 of 3x4 matrix + ("p_x", c_float), ## [in] element 3 of row 0 of 3x4 matrix + ("vx_y", c_float), ## [in] element 0 of row 1 of 3x4 matrix + ("vy_y", c_float), ## [in] element 1 of row 1 of 3x4 matrix + ("vz_y", c_float), ## [in] element 2 of row 1 of 3x4 matrix + ("p_y", c_float), ## [in] element 3 of row 1 of 3x4 matrix + ("vx_z", c_float), ## [in] element 0 of row 2 of 3x4 matrix + ("vy_z", c_float), ## [in] element 1 of row 2 of 3x4 matrix + ("vz_z", c_float), ## [in] element 2 of row 2 of 3x4 matrix + ("p_z", c_float) ## [in] element 3 of row 2 of 3x4 matrix + ] + +############################################################################### +## @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +## in each dimension +class ze_rtas_aabb_exp_t(Structure): + _fields_ = [ + ("lower", ze_rtas_c_float3_exp_t), ## [in] lower bounds of AABB + ("upper", ze_rtas_c_float3_exp_t) ## [in] upper bounds of AABB + ] + +############################################################################### +## @brief Triangle represented using 3 vertex indices +## +## @details +## - Represents a triangle using 3 vertex indices that index into a vertex +## array that needs to be provided together with the index array. +## - The linear barycentric u/v parametrization of the triangle is defined as: +## - (u=0, v=0) at v0, +## - (u=1, v=0) at v1, and +## - (u=0, v=1) at v2 +class ze_rtas_triangle_indices_uint32_exp_t(Structure): + _fields_ = [ + ("v0", c_ulong), ## [in] first index pointing to the first triangle vertex in vertex array + ("v1", c_ulong), ## [in] second index pointing to the second triangle vertex in vertex + ## array + ("v2", c_ulong) ## [in] third index pointing to the third triangle vertex in vertex array + ] + +############################################################################### +## @brief Quad represented using 4 vertex indices +## +## @details +## - Represents a quad composed of 4 indices that index into a vertex array +## that needs to be provided together with the index array. +## - A quad is a triangle pair represented using 4 vertex indices v0, v1, +## v2, v3. +## The first triangle is made out of indices v0, v1, v3 and the second triangle +## from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +## of the quad is defined as: +## - (u=0, v=0) at v0, +## - (u=1, v=0) at v1, +## - (u=0, v=1) at v3, and +## - (u=1, v=1) at v2 +## This is achieved by correcting the u'/v' coordinates of the second +## triangle by +## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +class ze_rtas_quad_indices_uint32_exp_t(Structure): + _fields_ = [ + ("v0", c_ulong), ## [in] first index pointing to the first quad vertex in vertex array + ("v1", c_ulong), ## [in] second index pointing to the second quad vertex in vertex array + ("v2", c_ulong), ## [in] third index pointing to the third quad vertex in vertex array + ("v3", c_ulong) ## [in] fourth index pointing to the fourth quad vertex in vertex array + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder geometry info +class ze_rtas_builder_geometry_info_exp_t(Structure): + _fields_ = [ + ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t) ## [in] geometry type + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder triangle mesh geometry info +## +## @details +## - The linear barycentric u/v parametrization of the triangle is defined as: +## - (u=0, v=0) at v0, +## - (u=1, v=0) at v1, and +## - (u=0, v=1) at v2 +class ze_rtas_builder_triangles_geometry_info_exp_t(Structure): + _fields_ = [ + ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES + ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ## bits representing the geometry flags for all primitives of this + ## geometry + ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking + ("triangleFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of triangle buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 + ("vertexFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of vertex buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + ("triangleCount", c_ulong), ## [in] number of triangles in triangle buffer + ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer + ("triangleStride", c_ulong), ## [in] stride (in bytes) of triangles in triangle buffer + ("vertexStride", c_ulong), ## [in] stride (in bytes) of vertices in vertex buffer + ("pTriangleBuffer", c_void_p), ## [in] pointer to array of triangle indices in specified format + ("pVertexBuffer", c_void_p) ## [in] pointer to array of triangle vertices in specified format + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder quad mesh geometry info +## +## @details +## - A quad is a triangle pair represented using 4 vertex indices v0, v1, +## v2, v3. +## The first triangle is made out of indices v0, v1, v3 and the second triangle +## from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +## of the quad is defined as: +## - (u=0, v=0) at v0, +## - (u=1, v=0) at v1, +## - (u=0, v=1) at v3, and +## - (u=1, v=1) at v2 +## This is achieved by correcting the u'/v' coordinates of the second +## triangle by +## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +class ze_rtas_builder_quads_geometry_info_exp_t(Structure): + _fields_ = [ + ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS + ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ## bits representing the geometry flags for all primitives of this + ## geometry + ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking + ("quadFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of quad buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 + ("vertexFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of vertex buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + ("quadCount", c_ulong), ## [in] number of quads in quad buffer + ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer + ("quadStride", c_ulong), ## [in] stride (in bytes) of quads in quad buffer + ("vertexStride", c_ulong), ## [in] stride (in bytes) of vertices in vertex buffer + ("pQuadBuffer", c_void_p), ## [in] pointer to array of quad indices in specified format + ("pVertexBuffer", c_void_p) ## [in] pointer to array of quad vertices in specified format ] ############################################################################### -## @brief Static PCI properties -class ze_pci_ext_properties_t(Structure): +## @brief AABB callback function parameters +class ze_rtas_geometry_aabbs_exp_cb_params_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). - ("address", ze_pci_address_ext_t), ## [out] The BDF address - ("maxSpeed", ze_pci_speed_ext_t) ## [out] Fastest port configuration supported by the device (sum of all - ## lanes) + ("primID", c_ulong), ## [in] first primitive to return bounds for + ("primIDCount", c_ulong), ## [in] number of primitives to return bounds for + ("pGeomUserPtr", c_void_p), ## [in] pointer provided through geometry descriptor + ("pBuildUserPtr", c_void_p), ## [in] pointer provided through ::zeRTASBuilderBuildExp function + ("pBoundsOut", POINTER(ze_rtas_aabb_exp_t)) ## [out] destination buffer to write AABB bounds to ] ############################################################################### -## @brief sRGB Extension Name -ZE_SRGB_EXT_NAME = "ZE_extension_srgb" - -############################################################################### -## @brief sRGB Extension Version(s) -class ze_srgb_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_srgb_ext_version_t(c_int): - def __str__(self): - return str(ze_srgb_ext_version_v(self.value)) - +## @brief Callback function pointer type to return AABBs for a range of +## procedural primitives ############################################################################### -## @brief sRGB image descriptor +## @brief Ray tracing acceleration structure builder procedural primitives +## geometry info ## ## @details -## - This structure may be passed to ::zeImageCreate via the `pNext` member -## of ::ze_image_desc_t -## - Used for specifying that the image is in sRGB format. -class ze_srgb_ext_desc_t(Structure): +## - A host-side bounds callback function is invoked by the acceleration +## structure builder to query the bounds of procedural primitives on +## demand. The callback is passed some `pGeomUserPtr` that can point to +## an application-side representation of the procedural primitives. +## Further, a second `pBuildUserPtr`, which is set by a parameter to +## ::zeRTASBuilderBuildExp, is passed to the callback. This allows the +## build to change the bounds of the procedural geometry, for example, to +## build a BVH only over a short time range to implement multi-segment +## motion blur. +class ze_rtas_builder_procedural_geometry_info_exp_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). - ("sRGB", ze_bool_t) ## [in] Is sRGB. + ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL + ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ## bits representing the geometry flags for all primitives of this + ## geometry + ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking + ("reserved", c_ubyte), ## [in] reserved for future use + ("primCount", c_ulong), ## [in] number of primitives in geometry + ("pfnGetBoundsCb", ze_rtas_geometry_aabbs_cb_exp_t), ## [in] pointer to callback function to get the axis-aligned bounding-box + ## for a range of primitives + ("pGeomUserPtr", c_void_p) ## [in] user data pointer passed to callback ] ############################################################################### -## @brief Image Copy Extension Name -ZE_IMAGE_COPY_EXT_NAME = "ZE_extension_image_copy" - -############################################################################### -## @brief Image Copy Extension Version(s) -class ze_image_copy_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_image_copy_ext_version_t(c_int): - def __str__(self): - return str(ze_image_copy_ext_version_v(self.value)) - - -############################################################################### -## @brief Image Query Allocation Properties Extension Name -ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME = "ZE_extension_image_query_alloc_properties" - -############################################################################### -## @brief Image Query Allocation Properties Extension Version(s) -class ze_image_query_alloc_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_image_query_alloc_properties_ext_version_t(c_int): - def __str__(self): - return str(ze_image_query_alloc_properties_ext_version_v(self.value)) - +## @brief Ray tracing acceleration structure builder instance geometry info +class ze_rtas_builder_instance_geometry_info_exp_t(Structure): + _fields_ = [ + ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE + ("instanceFlags", ze_rtas_builder_packed_instance_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ## bits representing the geometry flags for all primitives of this + ## geometry + ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking + ("transformFormat", ze_rtas_builder_packed_input_data_format_exp_t),## [in] format of the specified transformation + ("instanceUserID", c_ulong), ## [in] user-specified identifier for the instance + ("pTransform", c_void_p), ## [in] object-to-world instance transformation in specified format + ("pBounds", POINTER(ze_rtas_aabb_exp_t)), ## [in] object-space axis-aligned bounding-box of the instanced + ## acceleration structure + ("pAccelerationStructure", c_void_p) ## [in] pointer to acceleration structure to instantiate + ] ############################################################################### -## @brief Image allocation properties queried using -## ::zeImageGetAllocPropertiesExt -class ze_image_allocation_ext_properties_t(Structure): +## @brief +class ze_rtas_builder_build_op_exp_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("id", c_ulonglong) ## [out] identifier for this allocation + ("rtasFormat", ze_rtas_format_exp_t), ## [in] ray tracing acceleration structure format + ("buildQuality", ze_rtas_builder_build_quality_hint_exp_t), ## [in] acceleration structure build quality hint + ("buildFlags", ze_rtas_builder_build_op_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t + ## flags + ("ppGeometries", POINTER(ze_rtas_builder_geometry_info_exp_t*)),## [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ## pointers to geometry infos + ("numGeometries", c_ulong) ## [in] number of geometries in geometry infos array, can be zero when + ## `ppGeometries` is NULL ] ############################################################################### -## @brief Linkage Inspection Extension Name -ZE_LINKAGE_INSPECTION_EXT_NAME = "ZE_extension_linkage_inspection" +## @brief Counter-based Event Pools Extension Name +ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME = "ZE_experimental_event_pool_counter_based" ############################################################################### -## @brief Linkage Inspection Extension Version(s) -class ze_linkage_inspection_ext_version_v(IntEnum): +## @brief Counter-based Event Pools Extension Version(s) +class ze_event_pool_counter_based_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_linkage_inspection_ext_version_t(c_int): +class ze_event_pool_counter_based_exp_version_t(c_int): def __str__(self): - return str(ze_linkage_inspection_ext_version_v(self.value)) + return str(ze_event_pool_counter_based_exp_version_v(self.value)) ############################################################################### -## @brief Supported module linkage inspection flags -class ze_linkage_inspection_ext_flags_v(IntEnum): - IMPORTS = ZE_BIT(0) ## List all imports of modules - UNRESOLVABLE_IMPORTS = ZE_BIT(1) ## List all imports of modules that do not have a corresponding export - EXPORTS = ZE_BIT(2) ## List all exports of modules +## @brief Supported event flags for defining counter-based event pools. +class ze_event_pool_counter_based_exp_flags_v(IntEnum): + IMMEDIATE = ZE_BIT(0) ## Counter-based event pool is used for immediate command lists (default) + NON_IMMEDIATE = ZE_BIT(1) ## Counter-based event pool is for non-immediate command lists -class ze_linkage_inspection_ext_flags_t(c_int): +class ze_event_pool_counter_based_exp_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Module linkage inspection descriptor -## -## @details -## - This structure may be passed to ::zeModuleInspectLinkageExt. -class ze_linkage_inspection_ext_desc_t(Structure): +## @brief Event pool descriptor for counter-based events. This structure may be +## passed to ::zeEventPoolCreate as pNext member of +## ::ze_event_pool_desc_t. @deprecated since 1.15 +class ze_event_pool_counter_based_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). - ("flags", ze_linkage_inspection_ext_flags_t) ## [in] flags specifying module linkage inspection. - ## must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. + ("flags", ze_event_pool_counter_based_exp_flags_t) ## [in] mode flags. + ## must be 0 (default) or a valid value of ::ze_event_pool_counter_based_exp_flag_t + ## default behavior is counter-based event pool is only used for + ## immediate command lists. ] ############################################################################### -## @brief Memory Compression Hints Extension Name -ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME = "ZE_extension_memory_compression_hints" +## @brief Image Memory Properties Extension Name +ZE_BINDLESS_IMAGE_EXP_NAME = "ZE_experimental_bindless_image" ############################################################################### -## @brief Memory Compression Hints Extension Version(s) -class ze_memory_compression_hints_ext_version_v(IntEnum): +## @brief Bindless Image Extension Version(s) +class ze_bindless_image_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_memory_compression_hints_ext_version_t(c_int): +class ze_bindless_image_exp_version_t(c_int): def __str__(self): - return str(ze_memory_compression_hints_ext_version_v(self.value)) + return str(ze_bindless_image_exp_version_v(self.value)) ############################################################################### -## @brief Supported memory compression hints flags -class ze_memory_compression_hints_ext_flags_v(IntEnum): - COMPRESSED = ZE_BIT(0) ## Hint Driver implementation to make allocation compressible - UNCOMPRESSED = ZE_BIT(1) ## Hint Driver implementation to make allocation not compressible +## @brief Image flags for Bindless images +class ze_image_bindless_exp_flags_v(IntEnum): + BINDLESS = ZE_BIT(0) ## Bindless images are created with ::zeImageCreate. The image handle + ## created with this flag is valid on both host and device. + SAMPLED_IMAGE = ZE_BIT(1) ## Bindless sampled images are created with ::zeImageCreate by combining + ## BINDLESS and SAMPLED_IMAGE. + ## Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. -class ze_memory_compression_hints_ext_flags_t(c_int): +class ze_image_bindless_exp_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Compression hints memory allocation descriptor -## -## @details -## - This structure may be passed to ::zeMemAllocShared or -## ::zeMemAllocDevice, via the `pNext` member of -## ::ze_device_mem_alloc_desc_t. -## - This structure may be passed to ::zeMemAllocHost, via the `pNext` -## member of ::ze_host_mem_alloc_desc_t. -## - This structure may be passed to ::zeImageCreate, via the `pNext` -## member of ::ze_image_desc_t. -class ze_memory_compression_hints_ext_desc_t(Structure): +## @brief Image descriptor for bindless images. This structure may be passed to +## ::zeImageCreate via pNext member of ::ze_image_desc_t. +class ze_image_bindless_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). - ("flags", ze_memory_compression_hints_ext_flags_t) ## [in] flags specifying if allocation should be compressible or not. - ## Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; + ("flags", ze_image_bindless_exp_flags_t) ## [in] image flags. + ## must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t + ## default behavior is bindless images are not used when creating handles + ## via ::zeImageCreate. + ## When the flag is passed to ::zeImageCreate, then only the memory for + ## the image is allocated. + ## Additional image handles can be created with ::zeImageViewCreateExt. + ## When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, + ## ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t. ] ############################################################################### -## @brief Memory Free Policies Extension Name -ZE_MEMORY_FREE_POLICIES_EXT_NAME = "ZE_extension_memory_free_policies" - -############################################################################### -## @brief Memory Free Policies Extension Version(s) -class ze_memory_free_policies_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_memory_free_policies_ext_version_t(c_int): - def __str__(self): - return str(ze_memory_free_policies_ext_version_v(self.value)) - - -############################################################################### -## @brief Supported memory free policy capability flags -class ze_driver_memory_free_policy_ext_flags_v(IntEnum): - BLOCKING_FREE = ZE_BIT(0) ## Blocks until all commands using the memory are complete before - ## scheduling memory to be freed. Does not guarantee memory is freed upon - ## return, only that it is safe and is scheduled to be freed. Actual - ## freeing of memory is specific to user mode driver and kernel mode - ## driver implementation and may be done asynchronously. - DEFER_FREE = ZE_BIT(1) ## Immediately schedules the memory to be freed and returns without - ## blocking. Memory may be freed after all commands using the memory are - ## complete. Actual freeing of memory is specific to user mode driver and - ## kernel mode driver implementation and may be done asynchronously. - -class ze_driver_memory_free_policy_ext_flags_t(c_int): - def __str__(self): - return hex(self.value) +## @brief Image descriptor for bindless images created from pitched allocations. +## This structure may be passed to ::zeImageCreate via pNext member of +## ::ze_image_desc_t. +class ze_image_pitched_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). + ("ptr", c_void_p) ## [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice + ] +############################################################################### +## @brief Device specific properties for pitched allocations +## +## @details +## - This structure may be passed to ::zeDeviceGetImageProperties via the +## pNext member of ::ze_device_image_properties_t. +class ze_device_pitched_alloc_exp_properties_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). + ("maxImageLinearWidth", c_size_t), ## [out] Maximum image linear width. + ("maxImageLinearHeight", c_size_t) ## [out] Maximum image linear height. + ] ############################################################################### -## @brief Driver memory free properties queried using ::zeDriverGetProperties +## @brief Pitch information for 2-dimensional linear pitched allocations ## ## @details -## - All drivers must support an immediate free policy, which is the -## default free policy. -## - This structure may be returned from ::zeDriverGetProperties, via the -## `pNext` member of ::ze_driver_properties_t. -class ze_driver_memory_free_ext_properties_t(Structure): +## - This structure may be passed to ::zeDeviceGetImageProperties in +## conjunction with the ::ze_device_pitched_alloc_exp_properties_t via +## its pNext member +class ze_pitched_alloc_2dimage_linear_pitch_exp_info_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). - ("freePolicies", ze_driver_memory_free_policy_ext_flags_t) ## [out] Supported memory free policies. - ## must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. + ("pitchAlign", c_size_t), ## [out] Required pitch Aligment in Bytes. + ("maxSupportedPitch", c_size_t) ## [out] Maximum allowed pitch in Bytes. ] ############################################################################### -## @brief Memory free descriptor with free policy -class ze_memory_free_ext_desc_t(Structure): +## @brief Specify user defined pitch for pitched linear image allocations. This +## structure may be passed to ::zeImageCreate in conjunction with +## ::ze_image_pitched_exp_desc_t via its pNext member +class ze_custom_pitch_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). - ("freePolicy", ze_driver_memory_free_policy_ext_flags_t) ## [in] flags specifying the memory free policy. - ## must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; - ## default behavior is to free immediately. + ("rowPitch", c_size_t), ## [in] user programmed aligned pitch for pitched linear image + ## allocations. This pitch should satisfy the pitchAlign requirement in + ## ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t + ("slicePitch", c_size_t) ## [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. ] ############################################################################### -## @brief Bandwidth Extension Name -ZE_BANDWIDTH_PROPERTIES_EXP_NAME = "ZE_experimental_bandwidth_properties" +## @brief Command List Clone Extension Name +ZE_COMMAND_LIST_CLONE_EXP_NAME = "ZE_experimental_command_list_clone" ############################################################################### -## @brief Bandwidth Extension Version(s) -class ze_bandwidth_properties_exp_version_v(IntEnum): +## @brief Command List Clone Extension Version(s) +class ze_command_list_clone_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_bandwidth_properties_exp_version_t(c_int): +class ze_command_list_clone_exp_version_t(c_int): def __str__(self): - return str(ze_bandwidth_properties_exp_version_v(self.value)) + return str(ze_command_list_clone_exp_version_v(self.value)) ############################################################################### -## @brief P2P Bandwidth Properties -## -## @details -## - This structure may be passed to ::zeDeviceGetP2PProperties by having -## the pNext member of ::ze_device_p2p_properties_t point at this struct. -class ze_device_p2p_bandwidth_exp_properties_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). - ("logicalBandwidth", c_ulong), ## [out] total logical design bandwidth for all links connecting the two - ## devices - ("physicalBandwidth", c_ulong), ## [out] total physical design bandwidth for all links connecting the two - ## devices - ("bandwidthUnit", ze_bandwidth_unit_t), ## [out] bandwidth unit - ("logicalLatency", c_ulong), ## [out] average logical design latency for all links connecting the two - ## devices - ("physicalLatency", c_ulong), ## [out] average physical design latency for all links connecting the two - ## devices - ("latencyUnit", ze_latency_unit_t) ## [out] latency unit - ] +## @brief Immediate Command List Append Extension Name +ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME = "ZE_experimental_immediate_command_list_append" ############################################################################### -## @brief Copy Bandwidth Properties -## -## @details -## - This structure may be passed to -## ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of -## ::ze_command_queue_group_properties_t point at this struct. -## - [DEPRECATED] -class ze_copy_bandwidth_exp_properties_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). - ("copyBandwidth", c_ulong), ## [out] design bandwidth supported by this engine type for copy - ## operations - ("copyBandwidthUnit", ze_bandwidth_unit_t) ## [out] copy bandwidth unit - ] +## @brief Immediate Command List Append Extension Version(s) +class ze_immediate_command_list_append_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_immediate_command_list_append_exp_version_t(c_int): + def __str__(self): + return str(ze_immediate_command_list_append_exp_version_v(self.value)) + ############################################################################### -## @brief Device Local Identifier (LUID) Extension Name -ZE_DEVICE_LUID_EXT_NAME = "ZE_extension_device_luid" +## @brief Mutable Command List Extension Name +ZE_MUTABLE_COMMAND_LIST_EXP_NAME = "ZE_experimental_mutable_command_list" ############################################################################### -## @brief Device Local Identifier (LUID) Extension Version(s) -class ze_device_luid_ext_version_v(IntEnum): +## @brief Mutable Command List Extension Version(s) +class ze_mutable_command_list_exp_version_v(IntEnum): _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + _1_1 = ZE_MAKE_VERSION( 1, 1 ) ## version 1.1 + CURRENT = ZE_MAKE_VERSION( 1, 1 ) ## latest known version -class ze_device_luid_ext_version_t(c_int): +class ze_mutable_command_list_exp_version_t(c_int): def __str__(self): - return str(ze_device_luid_ext_version_v(self.value)) + return str(ze_mutable_command_list_exp_version_v(self.value)) ############################################################################### -## @brief Maximum device local identifier (LUID) size in bytes -ZE_MAX_DEVICE_LUID_SIZE_EXT = 8 +## @brief Mutable command flags +class ze_mutable_command_exp_flags_v(IntEnum): + KERNEL_ARGUMENTS = ZE_BIT(0) ## kernel arguments + GROUP_COUNT = ZE_BIT(1) ## kernel group count + GROUP_SIZE = ZE_BIT(2) ## kernel group size + GLOBAL_OFFSET = ZE_BIT(3) ## kernel global offset + SIGNAL_EVENT = ZE_BIT(4) ## command signal event + WAIT_EVENTS = ZE_BIT(5) ## command wait events + KERNEL_INSTRUCTION = ZE_BIT(6) ## command kernel + GRAPH_ARGUMENTS = ZE_BIT(7) ## graph arguments + +class ze_mutable_command_exp_flags_t(c_int): + def __str__(self): + return hex(self.value) -############################################################################### -## @brief Device local identifier (LUID) -class ze_device_luid_ext_t(Structure): - _fields_ = [ - ("id", c_ubyte * ZE_MAX_DEVICE_LUID_SIZE_EXT) ## [out] opaque data representing a device LUID - ] ############################################################################### -## @brief Device LUID properties queried using ::zeDeviceGetProperties -## -## @details -## - This structure may be returned from ::zeDeviceGetProperties, via the -## `pNext` member of ::ze_device_properties_t. -class ze_device_luid_ext_properties_t(Structure): +## @brief Mutable command identifier descriptor +class ze_mutable_command_id_exp_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("luid", ze_device_luid_ext_t), ## [out] locally unique identifier (LUID). - ## The returned LUID can be cast to a LUID object and must be equal to - ## the locally - ## unique identifier of an IDXGIAdapter1 object that corresponds to the device. - ("nodeMask", c_ulong) ## [out] node mask. - ## The returned node mask must contain exactly one bit. - ## If the device is running on an operating system that supports the - ## Direct3D 12 API - ## and the device corresponds to an individual device in a linked device - ## adapter, the - ## returned node mask identifies the Direct3D 12 node corresponding to - ## the device. - ## Otherwise, the returned node mask must be 1. + ("flags", ze_mutable_command_exp_flags_t) ## [in] mutable command flags. + ## - must be 0 (default, equivalent to setting all flags bar kernel + ## instruction), or a valid combination of ::ze_mutable_command_exp_flag_t + ## - in order to include kernel instruction mutation, + ## ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included ] ############################################################################### -## @brief Fabric Topology Discovery Extension Name -ZE_FABRIC_EXP_NAME = "ZE_experimental_fabric" - -############################################################################### -## @brief Fabric Topology Discovery Extension Version(s) -class ze_fabric_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief Mutable command list flags +class ze_mutable_command_list_exp_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## reserved -class ze_fabric_exp_version_t(c_int): +class ze_mutable_command_list_exp_flags_t(c_int): def __str__(self): - return str(ze_fabric_exp_version_v(self.value)) + return hex(self.value) ############################################################################### -## @brief Maximum fabric edge model string size -ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE = 256 +## @brief Mutable command list properties +class ze_mutable_command_list_exp_properties_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). + ("mutableCommandListFlags", ze_mutable_command_list_exp_flags_t), ## [out] mutable command list flags + ("mutableCommandFlags", ze_mutable_command_exp_flags_t) ## [out] mutable command flags + ] ############################################################################### -## @brief Fabric Vertex types -class ze_fabric_vertex_exp_type_v(IntEnum): - UNKNOWN = 0 ## Fabric vertex type is unknown - DEVICE = 1 ## Fabric vertex represents a device - SUBDEVICE = 2 ## Fabric vertex represents a subdevice - SWITCH = 3 ## Fabric vertex represents a switch - -class ze_fabric_vertex_exp_type_t(c_int): - def __str__(self): - return str(ze_fabric_vertex_exp_type_v(self.value)) - +## @brief Mutable command list descriptor +class ze_mutable_command_list_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). + ("flags", ze_mutable_command_list_exp_flags_t) ## [in] mutable command list flags. + ## - must be 0 (default) or a valid combination of ::ze_mutable_command_list_exp_flag_t + ] ############################################################################### -## @brief Fabric edge duplexity -class ze_fabric_edge_exp_duplexity_v(IntEnum): - UNKNOWN = 0 ## Fabric edge duplexity is unknown - HALF_DUPLEX = 1 ## Fabric edge is half duplex, i.e. stated bandwidth is obtained in only - ## one direction at time - FULL_DUPLEX = 2 ## Fabric edge is full duplex, i.e. stated bandwidth is supported in both - ## directions simultaneously +## @brief Mutable commands descriptor +class ze_mutable_commands_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). + ("flags", c_ulong) ## [in] must be 0, this field is reserved for future use + ] -class ze_fabric_edge_exp_duplexity_t(c_int): - def __str__(self): - return str(ze_fabric_edge_exp_duplexity_v(self.value)) +############################################################################### +## @brief Mutable kernel argument descriptor +class ze_mutable_kernel_argument_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). + ("commandId", c_ulonglong), ## [in] command identifier + ("argIndex", c_ulong), ## [in] kernel argument index + ("argSize", c_size_t), ## [in] kernel argument size + ("pArgValue", c_void_p) ## [in] pointer to kernel argument value + ] +############################################################################### +## @brief Mutable kernel group count descriptor +class ze_mutable_group_count_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). + ("commandId", c_ulonglong), ## [in] command identifier + ("pGroupCount", POINTER(ze_group_count_t)) ## [in] pointer to group count + ] ############################################################################### -## @brief PCI address -## -## @details -## - A PCI BDF address is the bus:device:function address of the device and -## is useful for locating the device in the PCI switch fabric. -class ze_fabric_vertex_pci_exp_address_t(Structure): +## @brief Mutable kernel group size descriptor +class ze_mutable_group_size_exp_desc_t(Structure): _fields_ = [ - ("domain", c_ulong), ## [out] PCI domain number - ("bus", c_ulong), ## [out] PCI BDF bus number - ("device", c_ulong), ## [out] PCI BDF device number - ("function", c_ulong) ## [out] PCI BDF function number + ("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). + ("commandId", c_ulonglong), ## [in] command identifier + ("groupSizeX", c_ulong), ## [in] group size for X dimension to use for the kernel + ("groupSizeY", c_ulong), ## [in] group size for Y dimension to use for the kernel + ("groupSizeZ", c_ulong) ## [in] group size for Z dimension to use for the kernel ] ############################################################################### -## @brief Fabric Vertex properties -class ze_fabric_vertex_exp_properties_t(Structure): +## @brief Mutable kernel global offset descriptor +class ze_mutable_global_offset_exp_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("uuid", ze_uuid_t), ## [out] universal unique identifier. If the vertex is co-located with a - ## device/subdevice, then this uuid will match that of the corresponding - ## device/subdevice - ("type", ze_fabric_vertex_exp_type_t), ## [out] does the fabric vertex represent a device, subdevice, or switch? - ("remote", ze_bool_t), ## [out] does the fabric vertex live on the local node or on a remote - ## node? - ("address", ze_fabric_vertex_pci_exp_address_t) ## [out] B/D/F address of fabric vertex & associated device/subdevice if - ## available + ("commandId", c_ulonglong), ## [in] command identifier + ("offsetX", c_ulong), ## [in] global offset for X dimension to use for this kernel + ("offsetY", c_ulong), ## [in] global offset for Y dimension to use for this kernel + ("offsetZ", c_ulong) ## [in] global offset for Z dimension to use for this kernel ] ############################################################################### -## @brief Fabric Edge properties -class ze_fabric_edge_exp_properties_t(Structure): +## @brief Mutable graph argument descriptor +class ze_mutable_graph_argument_exp_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("uuid", ze_uuid_t), ## [out] universal unique identifier. - ("model", c_char * ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE), ## [out] Description of fabric edge technology. Will be set to the string - ## "unkown" if this cannot be determined for this edge - ("bandwidth", c_ulong), ## [out] design bandwidth - ("bandwidthUnit", ze_bandwidth_unit_t), ## [out] bandwidth unit - ("latency", c_ulong), ## [out] design latency - ("latencyUnit", ze_latency_unit_t), ## [out] latency unit - ("duplexity", ze_fabric_edge_exp_duplexity_t) ## [out] Duplexity of the fabric edge + ("commandId", c_ulonglong), ## [in] command identifier + ("argIndex", c_ulong), ## [in] graph argument index + ("pArgValue", c_void_p) ## [in] pointer to graph argument value ] ############################################################################### -## @brief Device Memory Properties Extension Name -ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME = "ZE_extension_device_memory_properties" +## @brief Get Kernel Binary Extension Name +ZE_GET_KERNEL_BINARY_EXP_NAME = "ZE_extension_kernel_binary_exp" ############################################################################### -## @brief Device Memory Properties Extension Version(s) -class ze_device_memory_properties_ext_version_v(IntEnum): +## @brief Get Kernel Binary Extension Version(s) +class ze_kernel_get_binary_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_device_memory_properties_ext_version_t(c_int): +class ze_kernel_get_binary_exp_version_t(c_int): def __str__(self): - return str(ze_device_memory_properties_ext_version_v(self.value)) + return str(ze_kernel_get_binary_exp_version_v(self.value)) ############################################################################### -## @brief Memory module types -class ze_device_memory_ext_type_v(IntEnum): - HBM = 0 ## HBM memory - HBM2 = 1 ## HBM2 memory - DDR = 2 ## DDR memory - DDR2 = 3 ## DDR2 memory - DDR3 = 4 ## DDR3 memory - DDR4 = 5 ## DDR4 memory - DDR5 = 6 ## DDR5 memory - LPDDR = 7 ## LPDDR memory - LPDDR3 = 8 ## LPDDR3 memory - LPDDR4 = 9 ## LPDDR4 memory - LPDDR5 = 10 ## LPDDR5 memory - SRAM = 11 ## SRAM memory - L1 = 12 ## L1 cache - L3 = 13 ## L3 cache - GRF = 14 ## Execution unit register file - SLM = 15 ## Execution unit shared local memory - GDDR4 = 16 ## GDDR4 memory - GDDR5 = 17 ## GDDR5 memory - GDDR5X = 18 ## GDDR5X memory - GDDR6 = 19 ## GDDR6 memory - GDDR6X = 20 ## GDDR6X memory - GDDR7 = 21 ## GDDR7 memory - HBM2E = 22 ## HBM2E memory - HBM3 = 23 ## HBM3 memory - HBM3E = 24 ## HBM3E memory - HBM4 = 25 ## HBM4 memory - LPDDR5X = 26 ## LPDDR5X memory - LPDDR6 = 27 ## LPDDR6 memory +## @brief Driver Direct Device Interface (DDI) Handles Extension Name +ZE_DRIVER_DDI_HANDLES_EXT_NAME = "ZE_extension_driver_ddi_handles" -class ze_device_memory_ext_type_t(c_int): +############################################################################### +## @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) +class ze_driver_ddi_handles_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + _1_1 = ZE_MAKE_VERSION( 1, 1 ) ## version 1.1 + CURRENT = ZE_MAKE_VERSION( 1, 1 ) ## latest known version + +class ze_driver_ddi_handles_ext_version_t(c_int): def __str__(self): - return str(ze_device_memory_ext_type_v(self.value)) + return str(ze_driver_ddi_handles_ext_version_v(self.value)) ############################################################################### -## @brief Memory properties +## @brief Driver Direct Device Interface (DDI) Handle Extension Flags +class ze_driver_ddi_handle_ext_flags_v(IntEnum): + DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0) ## Driver Supports DDI Handles Extension + +class ze_driver_ddi_handle_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Driver DDI Handles properties queried using ::zeDriverGetProperties ## ## @details -## - This structure may be returned from ::zeDeviceGetMemoryProperties via -## the `pNext` member of ::ze_device_memory_properties_t -class ze_device_memory_ext_properties_t(Structure): +## - This structure may be returned from ::zeDriverGetProperties, via the +## `pNext` member of ::ze_driver_properties_t. +## - Starting from spec version 1.17, support for this extension is assumed +## for any driver reporting API version 1.17 or later via +## ::zeDriverGetApiVersion; the loader does NOT need to query the +## extension property for such drivers. +## - For drivers reporting API version 1.16 or earlier, the loader must +## check for this extension before using DDI handles. +## - This guarantee enables Level Zero extensions introduced in spec v1.17 +## or later to embed handles directly inside Level Zero structures (e.g., +## via pNext chains) without requiring the loader to translate or unwrap +## handles. +## - Additionally, drivers may assume the loader will dispatch calls +## exclusively via the DDI tables embedded in their handles; the only +## exception is the global DDI table used during driver initialization +## and to read the reported API version. +class ze_driver_ddi_handles_ext_properties_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). - ("type", ze_device_memory_ext_type_t), ## [out] The memory type - ("physicalSize", c_ulonglong), ## [out] Physical memory size in bytes. A value of 0 indicates that this - ## property is not known. However, a call to ::zesMemoryGetState() will - ## correctly return the total size of usable memory. - ("readBandwidth", c_ulong), ## [out] Design bandwidth for reads - ("writeBandwidth", c_ulong), ## [out] Design bandwidth for writes - ("bandwidthUnit", ze_bandwidth_unit_t) ## [out] bandwidth unit + ("flags", ze_driver_ddi_handle_ext_flags_t) ## [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t ] ############################################################################### -## @brief Bfloat16 Conversions Extension Name -ZE_BFLOAT16_CONVERSIONS_EXT_NAME = "ZE_extension_bfloat16_conversions" +## @brief External Semaphores Extension Name +ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME = "ZE_extension_external_semaphores" ############################################################################### -## @brief Bfloat16 Conversions Extension Version(s) -class ze_bfloat16_conversions_ext_version_v(IntEnum): +## @brief External Semaphores Extension Version +class ze_external_semaphore_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_bfloat16_conversions_ext_version_t(c_int): +class ze_external_semaphore_ext_version_t(c_int): def __str__(self): - return str(ze_bfloat16_conversions_ext_version_v(self.value)) + return str(ze_external_semaphore_ext_version_v(self.value)) ############################################################################### -## @brief Device IP Version Extension Name -ZE_DEVICE_IP_VERSION_EXT_NAME = "ZE_extension_device_ip_version" +## @brief Handle of external semaphore object +class ze_external_semaphore_ext_handle_t(c_void_p): + pass ############################################################################### -## @brief Device IP Version Extension Version(s) -class ze_device_ip_version_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version +## @brief External Semaphores Type Flags +class ze_external_semaphore_ext_flags_v(IntEnum): + OPAQUE_FD = ZE_BIT(0) ## Semaphore is an Linux opaque file descriptor + OPAQUE_WIN32 = ZE_BIT(1) ## Semaphore is an opaque Win32 handle for monitored fence + OPAQUE_WIN32_KMT = ZE_BIT(2) ## Semaphore is an opaque Win32 KMT handle for monitored fence + D3D12_FENCE = ZE_BIT(3) ## Semaphore is a D3D12 fence + D3D11_FENCE = ZE_BIT(4) ## Semaphore is a D3D11 fence + KEYED_MUTEX = ZE_BIT(5) ## Semaphore is a keyed mutex for Win32 + KEYED_MUTEX_KMT = ZE_BIT(6) ## Semaphore is a keyed mutex for Win32 KMT + VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7) ## Semaphore is a Vulkan Timeline semaphore for Linux + VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8) ## Semaphore is a Vulkan Timeline semaphore for Win32 -class ze_device_ip_version_version_t(c_int): +class ze_external_semaphore_ext_flags_t(c_int): def __str__(self): - return str(ze_device_ip_version_version_v(self.value)) + return hex(self.value) ############################################################################### -## @brief Device IP version queried using ::zeDeviceGetProperties -## -## @details -## - This structure may be returned from ::zeDeviceGetProperties via the -## `pNext` member of ::ze_device_properties_t -class ze_device_ip_version_ext_t(Structure): +## @brief External Semaphore Descriptor +class ze_external_semaphore_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). - ("ipVersion", c_ulong) ## [out] Device IP version. The meaning of the device IP version is - ## implementation-defined, but newer devices should have a higher - ## version than older devices. + ("flags", ze_external_semaphore_ext_flags_t) ## [in] The flags describing the type of the semaphore. + ## must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. + ## When importing a semaphore, pNext should be pointing to one of the + ## following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. ] ############################################################################### -## @brief Kernel Max Group Size Properties Extension Name -ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_kernel_max_group_size_properties" - -############################################################################### -## @brief Kernel Max Group Size Properties Extension Version(s) -class ze_kernel_max_group_size_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_kernel_max_group_size_properties_ext_version_t(c_int): - def __str__(self): - return str(ze_kernel_max_group_size_properties_ext_version_v(self.value)) - - -############################################################################### -## @brief Additional kernel max group size properties -## -## @details -## - This structure may be passed to ::zeKernelGetProperties, via the -## `pNext` member of ::ze_kernel_properties_t, to query additional kernel -## max group size properties. -class ze_kernel_max_group_size_properties_ext_t(Structure): +## @brief External Semaphore Win32 Descriptor +class ze_external_semaphore_win32_ext_desc_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("maxGroupSize", c_ulong) ## [out] maximum group size that can be used to execute the kernel. This - ## value may be less than or equal to the `maxTotalGroupSize` member of - ## ::ze_device_compute_properties_t. - ] - -############################################################################### -## @brief compiler-independent type -class ze_kernel_max_group_size_ext_properties_t(ze_kernel_max_group_size_properties_ext_t): - pass - -############################################################################### -## @brief Sub-Allocations Properties Extension Name -ZE_SUB_ALLOCATIONS_EXP_NAME = "ZE_experimental_sub_allocations" - -############################################################################### -## @brief Sub-Allocations Properties Extension Version(s) -class ze_sub_allocations_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_sub_allocations_exp_version_t(c_int): - def __str__(self): - return str(ze_sub_allocations_exp_version_v(self.value)) + ("handle", c_void_p), ## [in] Win32 handle of the semaphore. + ## Must be a valid Win32 handle. + ("name", c_char_p) ## [in] Name of the semaphore. + ## Must be a valid null-terminated string. + ] +############################################################################### +## @brief External Semaphore FD Descriptor +class ze_external_semaphore_fd_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). + ("fd", c_int) ## [in] File descriptor of the semaphore. + ## Must be a valid file descriptor. + ] ############################################################################### -## @brief Properties returned for a sub-allocation -class ze_sub_allocation_t(Structure): +## @brief External Semaphore Signal parameters +class ze_external_semaphore_signal_params_ext_t(Structure): _fields_ = [ - ("base", c_void_p), ## [in,out][optional] base address of the sub-allocation - ("size", c_size_t) ## [in,out][optional] size of the allocation + ("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). + ("value", c_ulonglong) ## [in] [optional] Value to signal. + ## Specified by user as an expected value with some of semaphore types, + ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. ] ############################################################################### -## @brief Sub-Allocations Properties -## -## @details -## - This structure may be passed to ::zeMemGetAllocProperties, via the -## `pNext` member of ::ze_memory_allocation_properties_t. -class ze_memory_sub_allocations_exp_properties_t(Structure): +## @brief External Semaphore Wait parameters +class ze_external_semaphore_wait_params_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("pCount", POINTER(c_ulong)), ## [in,out] pointer to the number of sub-allocations. - ## if count is zero, then the driver shall update the value with the - ## total number of sub-allocations on which the allocation has been divided. - ## if count is greater than the number of sub-allocations, then the - ## driver shall update the value with the correct number of sub-allocations. - ("pSubAllocations", POINTER(ze_sub_allocation_t)) ## [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. - ## if count is less than the number of sub-allocations available, then - ## driver shall only retrieve properties for that number of sub-allocations. + ("value", c_ulonglong) ## [in] [optional] Value to wait for. + ## Specified by user as an expected value with some of semaphore types, + ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. ] ############################################################################### -## @brief Event Query Kernel Timestamps Extension Name -ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME = "ZE_extension_event_query_kernel_timestamps" +## @brief CacheLine Size Extension Name +ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" ############################################################################### -## @brief Event Query Kernel Timestamps Extension Version(s) -class ze_event_query_kernel_timestamps_ext_version_v(IntEnum): +## @brief CacheLine Size Extension Version(s) +class ze_device_cache_line_size_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_event_query_kernel_timestamps_ext_version_t(c_int): - def __str__(self): - return str(ze_event_query_kernel_timestamps_ext_version_v(self.value)) - - -############################################################################### -## @brief Event query kernel timestamps flags -class ze_event_query_kernel_timestamps_ext_flags_v(IntEnum): - KERNEL = ZE_BIT(0) ## Kernel timestamp results - SYNCHRONIZED = ZE_BIT(1) ## Device event timestamps synchronized to the host time domain - -class ze_event_query_kernel_timestamps_ext_flags_t(c_int): +class ze_device_cache_line_size_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_device_cache_line_size_ext_version_v(self.value)) ############################################################################### -## @brief Event query kernel timestamps properties +## @brief CacheLine Size queried using ::zeDeviceGetCacheProperties ## ## @details -## - This structure may be returned from ::zeDeviceGetProperties, via the -## `pNext` member of ::ze_device_properties_t. -class ze_event_query_kernel_timestamps_ext_properties_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). - ("flags", ze_event_query_kernel_timestamps_ext_flags_t) ## [out] 0 or some combination of - ## ::ze_event_query_kernel_timestamps_ext_flag_t flags - ] - -############################################################################### -## @brief Kernel timestamp clock data synchronized to the host time domain -class ze_synchronized_timestamp_data_ext_t(Structure): - _fields_ = [ - ("kernelStart", c_ulonglong), ## [out] start of kernel execution in nanoseconds, on the host time - ## domain. - ("kernelEnd", c_ulonglong) ## [out] end of kernel execution in nanoseconds, on the host time domain. - ] - -############################################################################### -## @brief Synchronized kernel timestamp result -class ze_synchronized_timestamp_result_ext_t(Structure): - _fields_ = [ - ("global", ze_synchronized_timestamp_data_ext_t), ## [out] wall-clock data; free running device clock when device was - ## active,on the host time domain - ("context", ze_synchronized_timestamp_data_ext_t) ## [out] context specific active data; only includes clocks while context - ## was actively executing on the device, on the host time domain - ] - -############################################################################### -## @brief Event query kernel timestamps results properties -class ze_event_query_kernel_timestamps_results_ext_properties_t(Structure): +## - This structure may be returned from ::zeDeviceGetCacheProperties via +## the `pNext` member of ::ze_device_cache_properties_t. +## - Used for determining the cache line size supported on a device. +class ze_device_cache_line_size_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 + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("pKernelTimestampsBuffer", POINTER(ze_kernel_timestamp_result_t)), ## [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ## kernel timestamp results - ("pSynchronizedTimestampsBuffer", POINTER(ze_synchronized_timestamp_result_ext_t)) ## [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ## synchronized timestamp results + ("cacheLineSize", c_size_t) ## [out] The cache line size in bytes. ] ############################################################################### -## @brief Ray Tracing Acceleration Structure Builder Extension Name -ZE_RTAS_BUILDER_EXP_NAME = "ZE_experimental_rtas_builder" +## @brief Ray Tracing Acceleration Structure Extension Name +ZE_RTAS_EXT_NAME = "ZE_extension_rtas" ############################################################################### ## @brief Ray Tracing Acceleration Structure Builder Extension Version(s) -class ze_rtas_builder_exp_version_v(IntEnum): +class ze_rtas_builder_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_rtas_builder_exp_version_t(c_int): +class ze_rtas_builder_ext_version_t(c_int): def __str__(self): - return str(ze_rtas_builder_exp_version_v(self.value)) + return str(ze_rtas_builder_ext_version_v(self.value)) ############################################################################### ## @brief Ray tracing acceleration structure device flags -class ze_rtas_device_exp_flags_v(IntEnum): +class ze_rtas_device_ext_flags_v(IntEnum): RESERVED = ZE_BIT(0) ## reserved for future use -class ze_rtas_device_exp_flags_t(c_int): +class ze_rtas_device_ext_flags_t(c_int): def __str__(self): return hex(self.value) @@ -4833,54 +4791,54 @@ def __str__(self): ## @details ## - This is an opaque ray tracing acceleration structure format ## identifier. -class ze_rtas_format_exp_v(IntEnum): - INVALID = 0 ## Invalid acceleration structure format +class ze_rtas_format_ext_v(IntEnum): + INVALID = 0x0 ## Invalid acceleration structure format code MAX = 0x7ffffffe ## Maximum acceleration structure format code -class ze_rtas_format_exp_t(c_int): +class ze_rtas_format_ext_t(c_int): def __str__(self): - return str(ze_rtas_format_exp_v(self.value)) + return str(ze_rtas_format_ext_v(self.value)) ############################################################################### ## @brief Ray tracing acceleration structure builder flags -class ze_rtas_builder_exp_flags_v(IntEnum): +class ze_rtas_builder_ext_flags_v(IntEnum): RESERVED = ZE_BIT(0) ## Reserved for future use -class ze_rtas_builder_exp_flags_t(c_int): +class ze_rtas_builder_ext_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### ## @brief Ray tracing acceleration structure builder parallel operation flags -class ze_rtas_parallel_operation_exp_flags_v(IntEnum): +class ze_rtas_parallel_operation_ext_flags_v(IntEnum): RESERVED = ZE_BIT(0) ## Reserved for future use -class ze_rtas_parallel_operation_exp_flags_t(c_int): +class ze_rtas_parallel_operation_ext_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### ## @brief Ray tracing acceleration structure builder geometry flags -class ze_rtas_builder_geometry_exp_flags_v(IntEnum): +class ze_rtas_builder_geometry_ext_flags_v(IntEnum): NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader -class ze_rtas_builder_geometry_exp_flags_t(c_int): +class ze_rtas_builder_geometry_ext_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### ## @brief Packed ray tracing acceleration structure builder geometry flags (see -## ::ze_rtas_builder_geometry_exp_flags_t) -class ze_rtas_builder_packed_geometry_exp_flags_t(c_ubyte): +## ::ze_rtas_builder_geometry_ext_flags_t) +class ze_rtas_builder_packed_geometry_ext_flags_t(c_ubyte): pass ############################################################################### ## @brief Ray tracing acceleration structure builder instance flags -class ze_rtas_builder_instance_exp_flags_v(IntEnum): +class ze_rtas_builder_instance_ext_flags_v(IntEnum): TRIANGLE_CULL_DISABLE = ZE_BIT(0) ## disables culling of front-facing and back-facing triangles TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1) ## reverses front and back face of triangles TRIANGLE_FORCE_OPAQUE = ZE_BIT(2) ## forces instanced geometry to be opaque, unless ray flag forces it to @@ -4888,15 +4846,15 @@ class ze_rtas_builder_instance_exp_flags_v(IntEnum): TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3) ## forces instanced geometry to be non-opaque, unless ray flag forces it ## to be opaque -class ze_rtas_builder_instance_exp_flags_t(c_int): +class ze_rtas_builder_instance_ext_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### ## @brief Packed ray tracing acceleration structure builder instance flags (see -## ::ze_rtas_builder_instance_exp_flags_t) -class ze_rtas_builder_packed_instance_exp_flags_t(c_ubyte): +## ::ze_rtas_builder_instance_ext_flags_t) +class ze_rtas_builder_packed_instance_ext_flags_t(c_ubyte): pass ############################################################################### @@ -4909,13 +4867,13 @@ class ze_rtas_builder_packed_instance_exp_flags_t(c_ubyte): ## spatial splitting to split large or long primitives into smaller ## pieces. This may result in any-hit shaders being invoked multiple ## times for non-opaque primitives, unless -## ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +## ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. ## - Usage of any of these flags may reduce ray tracing performance. -class ze_rtas_builder_build_op_exp_flags_v(IntEnum): +class ze_rtas_builder_build_op_ext_flags_v(IntEnum): COMPACT = ZE_BIT(0) ## build more compact acceleration structure NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1) ## guarantees single any-hit shader invocation per primitive -class ze_rtas_builder_build_op_exp_flags_t(c_int): +class ze_rtas_builder_build_op_ext_flags_t(c_int): def __str__(self): return hex(self.value) @@ -4934,33 +4892,33 @@ def __str__(self): ## - Higher ray tracing performance can be achieved by using a high-quality ## build, but acceleration structure build performance might be ## significantly reduced. -class ze_rtas_builder_build_quality_hint_exp_v(IntEnum): +class ze_rtas_builder_build_quality_hint_ext_v(IntEnum): LOW = 0 ## build low-quality acceleration structure (fast) MEDIUM = 1 ## build medium-quality acceleration structure (slower) HIGH = 2 ## build high-quality acceleration structure (slow) -class ze_rtas_builder_build_quality_hint_exp_t(c_int): +class ze_rtas_builder_build_quality_hint_ext_t(c_int): def __str__(self): - return str(ze_rtas_builder_build_quality_hint_exp_v(self.value)) + return str(ze_rtas_builder_build_quality_hint_ext_v(self.value)) ############################################################################### ## @brief Ray tracing acceleration structure builder geometry type -class ze_rtas_builder_geometry_type_exp_v(IntEnum): +class ze_rtas_builder_geometry_type_ext_v(IntEnum): TRIANGLES = 0 ## triangle mesh geometry type QUADS = 1 ## quad mesh geometry type PROCEDURAL = 2 ## procedural geometry type INSTANCE = 3 ## instance geometry type -class ze_rtas_builder_geometry_type_exp_t(c_int): +class ze_rtas_builder_geometry_type_ext_t(c_int): def __str__(self): - return str(ze_rtas_builder_geometry_type_exp_v(self.value)) + return str(ze_rtas_builder_geometry_type_ext_v(self.value)) ############################################################################### ## @brief Packed ray tracing acceleration structure builder geometry type (see -## ::ze_rtas_builder_geometry_type_exp_t) -class ze_rtas_builder_packed_geometry_type_exp_t(c_ubyte): +## ::ze_rtas_builder_geometry_type_ext_t) +class ze_rtas_builder_packed_geometry_type_ext_t(c_ubyte): pass ############################################################################### @@ -4970,63 +4928,63 @@ class ze_rtas_builder_packed_geometry_type_exp_t(c_ubyte): ## - Specifies the format of data buffer elements. ## - Data buffers may contain instancing transform matrices, triangle/quad ## vertex indices, etc... -class ze_rtas_builder_input_data_format_exp_v(IntEnum): - FLOAT3 = 0 ## 3-component float vector (see ::ze_rtas_float3_exp_t) +class ze_rtas_builder_input_data_format_ext_v(IntEnum): + FLOAT3 = 0 ## 3-component float vector (see ::ze_rtas_float3_ext_t) FLOAT3X4_COLUMN_MAJOR = 1 ## 3x4 affine transformation in column-major format (see - ## ::ze_rtas_transform_float3x4_column_major_exp_t) + ## ::ze_rtas_transform_float3x4_column_major_ext_t) FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2 ## 3x4 affine transformation in column-major format (see - ## ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) + ## ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) FLOAT3X4_ROW_MAJOR = 3 ## 3x4 affine transformation in row-major format (see - ## ::ze_rtas_transform_float3x4_row_major_exp_t) - AABB = 4 ## 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) + ## ::ze_rtas_transform_float3x4_row_major_ext_t) + AABB = 4 ## 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) TRIANGLE_INDICES_UINT32 = 5 ## Unsigned 32-bit triangle indices (see - ## ::ze_rtas_triangle_indices_uint32_exp_t) - QUAD_INDICES_UINT32 = 6 ## Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) + ## ::ze_rtas_triangle_indices_uint32_ext_t) + QUAD_INDICES_UINT32 = 6 ## Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) -class ze_rtas_builder_input_data_format_exp_t(c_int): +class ze_rtas_builder_input_data_format_ext_t(c_int): def __str__(self): - return str(ze_rtas_builder_input_data_format_exp_v(self.value)) + return str(ze_rtas_builder_input_data_format_ext_v(self.value)) ############################################################################### ## @brief Packed ray tracing acceleration structure data buffer element format -## (see ::ze_rtas_builder_input_data_format_exp_t) -class ze_rtas_builder_packed_input_data_format_exp_t(c_ubyte): +## (see ::ze_rtas_builder_input_data_format_ext_t) +class ze_rtas_builder_packed_input_data_format_ext_t(c_ubyte): pass ############################################################################### ## @brief Handle of ray tracing acceleration structure builder object -class ze_rtas_builder_exp_handle_t(c_void_p): +class ze_rtas_builder_ext_handle_t(c_void_p): pass ############################################################################### ## @brief Handle of ray tracing acceleration structure builder parallel ## operation object -class ze_rtas_parallel_operation_exp_handle_t(c_void_p): +class ze_rtas_parallel_operation_ext_handle_t(c_void_p): pass ############################################################################### ## @brief Ray tracing acceleration structure builder descriptor -class ze_rtas_builder_exp_desc_t(Structure): +class ze_rtas_builder_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). - ("builderVersion", ze_rtas_builder_exp_version_t) ## [in] ray tracing acceleration structure builder version + ("builderVersion", ze_rtas_builder_ext_version_t) ## [in] ray tracing acceleration structure builder version ] ############################################################################### ## @brief Ray tracing acceleration structure builder properties -class ze_rtas_builder_exp_properties_t(Structure): +class ze_rtas_builder_ext_properties_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). - ("flags", ze_rtas_builder_exp_flags_t), ## [out] ray tracing acceleration structure builder flags + ("flags", ze_rtas_builder_ext_flags_t), ## [out] ray tracing acceleration structure builder flags ("rtasBufferSizeBytesExpected", c_size_t), ## [out] expected size (in bytes) required for acceleration structure buffer ## - When using an acceleration structure buffer of this size, the ## build is expected to succeed; however, it is possible that the build - ## may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY + ## may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY ("rtasBufferSizeBytesMaxRequired", c_size_t), ## [out] worst-case size (in bytes) required for acceleration structure buffer ## - When using an acceleration structure buffer of this size, the ## build is guaranteed to not run out of memory. @@ -5037,12 +4995,12 @@ class ze_rtas_builder_exp_properties_t(Structure): ############################################################################### ## @brief Ray tracing acceleration structure builder parallel operation ## properties -class ze_rtas_parallel_operation_exp_properties_t(Structure): +class ze_rtas_parallel_operation_ext_properties_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). - ("flags", ze_rtas_parallel_operation_exp_flags_t), ## [out] ray tracing acceleration structure builder parallel operation + ("flags", ze_rtas_parallel_operation_ext_flags_t), ## [out] ray tracing acceleration structure builder parallel operation ## flags ("maxConcurrency", c_ulong) ## [out] maximum number of threads that may join the parallel operation ] @@ -5054,20 +5012,20 @@ class ze_rtas_parallel_operation_exp_properties_t(Structure): ## - This structure may be passed to ::zeDeviceGetProperties, via `pNext` ## member of ::ze_device_properties_t. ## - The implementation shall populate `format` with a value other than -## ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. -class ze_rtas_device_exp_properties_t(Structure): +## ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. +class ze_rtas_device_ext_properties_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). - ("flags", ze_rtas_device_exp_flags_t), ## [out] ray tracing acceleration structure device flags - ("rtasFormat", ze_rtas_format_exp_t), ## [out] ray tracing acceleration structure format + ("flags", ze_rtas_device_ext_flags_t), ## [out] ray tracing acceleration structure device flags + ("rtasFormat", ze_rtas_format_ext_t), ## [out] ray tracing acceleration structure format ("rtasBufferAlignment", c_ulong) ## [out] required alignment of acceleration structure buffer ] ############################################################################### ## @brief A 3-component vector type -class ze_rtas_float3_exp_t(Structure): +class ze_rtas_float3_ext_t(Structure): _fields_ = [ ("x", c_float), ## [in] x-coordinate of float3 vector ("y", c_float), ## [in] y-coordinate of float3 vector @@ -5085,7 +5043,7 @@ class ze_rtas_float3_exp_t(Structure): ## - p=(p_x, p_y, p_z) ## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + ## z*vz + p`. -class ze_rtas_transform_float3x4_column_major_exp_t(Structure): +class ze_rtas_transform_float3x4_column_major_ext_t(Structure): _fields_ = [ ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix @@ -5115,7 +5073,7 @@ class ze_rtas_transform_float3x4_column_major_exp_t(Structure): ## z*vz + p`. ## - The column vectors are aligned to 16-bytes and pad members are ## ignored. -class ze_rtas_transform_float3x4_aligned_column_major_exp_t(Structure): +class ze_rtas_transform_float3x4_aligned_column_major_ext_t(Structure): _fields_ = [ ("vx_x", c_float), ## [in] element 0 of column 0 of 3x4 matrix ("vx_y", c_float), ## [in] element 1 of column 0 of 3x4 matrix @@ -5146,7 +5104,7 @@ class ze_rtas_transform_float3x4_aligned_column_major_exp_t(Structure): ## - p=(p_x, p_y, p_z) ## - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + ## z*vz + p`. -class ze_rtas_transform_float3x4_row_major_exp_t(Structure): +class ze_rtas_transform_float3x4_row_major_ext_t(Structure): _fields_ = [ ("vx_x", c_float), ## [in] element 0 of row 0 of 3x4 matrix ("vy_x", c_float), ## [in] element 1 of row 0 of 3x4 matrix @@ -5165,10 +5123,10 @@ class ze_rtas_transform_float3x4_row_major_exp_t(Structure): ############################################################################### ## @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds ## in each dimension -class ze_rtas_aabb_exp_t(Structure): +class ze_rtas_aabb_ext_t(Structure): _fields_ = [ - ("lower", ze_rtas_c_float3_exp_t), ## [in] lower bounds of AABB - ("upper", ze_rtas_c_float3_exp_t) ## [in] upper bounds of AABB + ("lower", ze_rtas_c_float3_ext_t), ## [in] lower bounds of AABB + ("upper", ze_rtas_c_float3_ext_t) ## [in] upper bounds of AABB ] ############################################################################### @@ -5181,7 +5139,7 @@ class ze_rtas_aabb_exp_t(Structure): ## - (u=0, v=0) at v0, ## - (u=1, v=0) at v1, and ## - (u=0, v=1) at v2 -class ze_rtas_triangle_indices_uint32_exp_t(Structure): +class ze_rtas_triangle_indices_uint32_ext_t(Structure): _fields_ = [ ("v0", c_ulong), ## [in] first index pointing to the first triangle vertex in vertex array ("v1", c_ulong), ## [in] second index pointing to the second triangle vertex in vertex @@ -5207,7 +5165,7 @@ class ze_rtas_triangle_indices_uint32_exp_t(Structure): ## This is achieved by correcting the u'/v' coordinates of the second ## triangle by ## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -class ze_rtas_quad_indices_uint32_exp_t(Structure): +class ze_rtas_quad_indices_uint32_ext_t(Structure): _fields_ = [ ("v0", c_ulong), ## [in] first index pointing to the first quad vertex in vertex array ("v1", c_ulong), ## [in] second index pointing to the second quad vertex in vertex array @@ -5217,9 +5175,9 @@ class ze_rtas_quad_indices_uint32_exp_t(Structure): ############################################################################### ## @brief Ray tracing acceleration structure builder geometry info -class ze_rtas_builder_geometry_info_exp_t(Structure): +class ze_rtas_builder_geometry_info_ext_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t) ## [in] geometry type + ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t) ## [in] geometry type ] ############################################################################### @@ -5230,18 +5188,18 @@ class ze_rtas_builder_geometry_info_exp_t(Structure): ## - (u=0, v=0) at v0, ## - (u=1, v=0) at v1, and ## - (u=0, v=1) at v2 -class ze_rtas_builder_triangles_geometry_info_exp_t(Structure): +class ze_rtas_builder_triangles_geometry_info_ext_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES - ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES + ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("triangleFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of triangle buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 - ("vertexFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of vertex buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + ("triangleFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of triangle buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 + ("vertexFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of vertex buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 ("triangleCount", c_ulong), ## [in] number of triangles in triangle buffer ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer ("triangleStride", c_ulong), ## [in] stride (in bytes) of triangles in triangle buffer @@ -5266,17 +5224,17 @@ class ze_rtas_builder_triangles_geometry_info_exp_t(Structure): ## This is achieved by correcting the u'/v' coordinates of the second ## triangle by ## *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -class ze_rtas_builder_quads_geometry_info_exp_t(Structure): +class ze_rtas_builder_quads_geometry_info_ext_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS - ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS + ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("quadFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of quad buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 - ("vertexFormat", ze_rtas_builder_packed_input_data_format_exp_t), ## [in] format of vertex buffer data, must be - ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + ("quadFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of quad buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 + ("vertexFormat", ze_rtas_builder_packed_input_data_format_ext_t), ## [in] format of vertex buffer data, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 ("quadCount", c_ulong), ## [in] number of quads in quad buffer ("vertexCount", c_ulong), ## [in] number of vertices in vertex buffer ("quadStride", c_ulong), ## [in] stride (in bytes) of quads in quad buffer @@ -5287,7 +5245,7 @@ class ze_rtas_builder_quads_geometry_info_exp_t(Structure): ############################################################################### ## @brief AABB callback function parameters -class ze_rtas_geometry_aabbs_exp_cb_params_t(Structure): +class ze_rtas_geometry_aabbs_ext_cb_params_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 @@ -5295,8 +5253,8 @@ class ze_rtas_geometry_aabbs_exp_cb_params_t(Structure): ("primID", c_ulong), ## [in] first primitive to return bounds for ("primIDCount", c_ulong), ## [in] number of primitives to return bounds for ("pGeomUserPtr", c_void_p), ## [in] pointer provided through geometry descriptor - ("pBuildUserPtr", c_void_p), ## [in] pointer provided through ::zeRTASBuilderBuildExp function - ("pBoundsOut", POINTER(ze_rtas_aabb_exp_t)) ## [out] destination buffer to write AABB bounds to + ("pBuildUserPtr", c_void_p), ## [in] pointer provided through ::zeRTASBuilderBuildExt function + ("pBoundsOut", POINTER(ze_rtas_aabb_ext_t)) ## [out] destination buffer to write AABB bounds to ] ############################################################################### @@ -5313,388 +5271,430 @@ class ze_rtas_geometry_aabbs_exp_cb_params_t(Structure): ## demand. The callback is passed some `pGeomUserPtr` that can point to ## an application-side representation of the procedural primitives. ## Further, a second `pBuildUserPtr`, which is set by a parameter to -## ::zeRTASBuilderBuildExp, is passed to the callback. This allows the +## ::zeRTASBuilderBuildExt, is passed to the callback. This allows the ## build to change the bounds of the procedural geometry, for example, to ## build a BVH only over a short time range to implement multi-segment ## motion blur. -class ze_rtas_builder_procedural_geometry_info_exp_t(Structure): +class ze_rtas_builder_procedural_geometry_info_ext_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL - ("geometryFlags", ze_rtas_builder_packed_geometry_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL + ("geometryFlags", ze_rtas_builder_packed_geometry_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking ("reserved", c_ubyte), ## [in] reserved for future use ("primCount", c_ulong), ## [in] number of primitives in geometry - ("pfnGetBoundsCb", ze_rtas_geometry_aabbs_cb_exp_t), ## [in] pointer to callback function to get the axis-aligned bounding-box + ("pfnGetBoundsCb", ze_rtas_geometry_aabbs_cb_ext_t), ## [in] pointer to callback function to get the axis-aligned bounding-box ## for a range of primitives ("pGeomUserPtr", c_void_p) ## [in] user data pointer passed to callback ] ############################################################################### ## @brief Ray tracing acceleration structure builder instance geometry info -class ze_rtas_builder_instance_geometry_info_exp_t(Structure): +class ze_rtas_builder_instance_geometry_info_ext_t(Structure): _fields_ = [ - ("geometryType", ze_rtas_builder_packed_geometry_type_exp_t), ## [in] geometry type, must be - ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE - ("instanceFlags", ze_rtas_builder_packed_instance_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ("geometryType", ze_rtas_builder_packed_geometry_type_ext_t), ## [in] geometry type, must be + ## ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE + ("instanceFlags", ze_rtas_builder_packed_instance_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_ubyte), ## [in] 8-bit geometry mask for ray masking - ("transformFormat", ze_rtas_builder_packed_input_data_format_exp_t),## [in] format of the specified transformation + ("transformFormat", ze_rtas_builder_packed_input_data_format_ext_t),## [in] format of the specified transformation ("instanceUserID", c_ulong), ## [in] user-specified identifier for the instance ("pTransform", c_void_p), ## [in] object-to-world instance transformation in specified format - ("pBounds", POINTER(ze_rtas_aabb_exp_t)), ## [in] object-space axis-aligned bounding-box of the instanced + ("pBounds", POINTER(ze_rtas_aabb_ext_t)), ## [in] object-space axis-aligned bounding-box of the instanced ## acceleration structure - ("pAccelerationStructure", c_void_p) ## [in] pointer to acceleration structure to instantiate + ("pAccelerationStructure", c_void_p) ## [in] device pointer to acceleration structure to instantiate ] ############################################################################### ## @brief -class ze_rtas_builder_build_op_exp_desc_t(Structure): +class ze_rtas_builder_build_op_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). - ("rtasFormat", ze_rtas_format_exp_t), ## [in] ray tracing acceleration structure format - ("buildQuality", ze_rtas_builder_build_quality_hint_exp_t), ## [in] acceleration structure build quality hint - ("buildFlags", ze_rtas_builder_build_op_exp_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t + ("rtasFormat", ze_rtas_format_ext_t), ## [in] ray tracing acceleration structure format + ("buildQuality", ze_rtas_builder_build_quality_hint_ext_t), ## [in] acceleration structure build quality hint + ("buildFlags", ze_rtas_builder_build_op_ext_flags_t), ## [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t ## flags - ("ppGeometries", POINTER(ze_rtas_builder_geometry_info_exp_t*)),## [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ("ppGeometries", POINTER(ze_rtas_builder_geometry_info_ext_t*)),## [in][optional][range(0, `numGeometries`)] NULL or a valid array of ## pointers to geometry infos ("numGeometries", c_ulong) ## [in] number of geometries in geometry infos array, can be zero when ## `ppGeometries` is NULL ] ############################################################################### -## @brief Counter-based Event Pools Extension Name -ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME = "ZE_experimental_event_pool_counter_based" +## @brief Device Vector Sizes Query Extension Name +ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" ############################################################################### -## @brief Counter-based Event Pools Extension Version(s) -class ze_event_pool_counter_based_exp_version_v(IntEnum): +## @brief Device Vector Sizes Query Extension Version(s) +class ze_device_vector_sizes_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_event_pool_counter_based_exp_version_t(c_int): - def __str__(self): - return str(ze_event_pool_counter_based_exp_version_v(self.value)) - - -############################################################################### -## @brief Supported event flags for defining counter-based event pools. -class ze_event_pool_counter_based_exp_flags_v(IntEnum): - IMMEDIATE = ZE_BIT(0) ## Counter-based event pool is used for immediate command lists (default) - NON_IMMEDIATE = ZE_BIT(1) ## Counter-based event pool is for non-immediate command lists - -class ze_event_pool_counter_based_exp_flags_t(c_int): +class ze_device_vector_sizes_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_device_vector_sizes_ext_version_v(self.value)) ############################################################################### -## @brief Event pool descriptor for counter-based events. This structure may be -## passed to ::zeEventPoolCreate as pNext member of -## ::ze_event_pool_desc_t. @deprecated since 1.15 -class ze_event_pool_counter_based_exp_desc_t(Structure): +## @brief Device Vector Width Properties queried using +## $DeviceGetVectorWidthPropertiesExt +class ze_device_vector_width_properties_ext_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("flags", ze_event_pool_counter_based_exp_flags_t) ## [in] mode flags. - ## must be 0 (default) or a valid value of ::ze_event_pool_counter_based_exp_flag_t - ## default behavior is counter-based event pool is only used for - ## immediate command lists. + ("vector_width_size", c_ulong), ## [out] The associated vector width size supported by the device. + ("preferred_vector_width_char", c_ulong), ## [out] The preferred vector width size for char type supported by the device. + ("preferred_vector_width_short", c_ulong), ## [out] The preferred vector width size for short type supported by the device. + ("preferred_vector_width_int", c_ulong), ## [out] The preferred vector width size for int type supported by the device. + ("preferred_vector_width_long", c_ulong), ## [out] The preferred vector width size for long type supported by the device. + ("preferred_vector_width_float", c_ulong), ## [out] The preferred vector width size for float type supported by the device. + ("preferred_vector_width_double", c_ulong), ## [out] The preferred vector width size for double type supported by the device. + ("preferred_vector_width_half", c_ulong), ## [out] The preferred vector width size for half type supported by the device. + ("native_vector_width_char", c_ulong), ## [out] The native vector width size for char type supported by the device. + ("native_vector_width_short", c_ulong), ## [out] The native vector width size for short type supported by the device. + ("native_vector_width_int", c_ulong), ## [out] The native vector width size for int type supported by the device. + ("native_vector_width_long", c_ulong), ## [out] The native vector width size for long type supported by the device. + ("native_vector_width_float", c_ulong), ## [out] The native vector width size for float type supported by the device. + ("native_vector_width_double", c_ulong), ## [out] The native vector width size for double type supported by the device. + ("native_vector_width_half", c_ulong) ## [out] The native vector width size for half type supported by the device. ] ############################################################################### -## @brief Image Memory Properties Extension Name -ZE_BINDLESS_IMAGE_EXP_NAME = "ZE_experimental_bindless_image" +## @brief External Memory Mapping Extension Name +ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME = "ZE_extension_external_memmap_sysmem" ############################################################################### -## @brief Bindless Image Extension Version(s) -class ze_bindless_image_exp_version_v(IntEnum): +## @brief External Memory Mapping Extension Version(s) +class ze_external_memmap_sysmem_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_bindless_image_exp_version_t(c_int): - def __str__(self): - return str(ze_bindless_image_exp_version_v(self.value)) - - -############################################################################### -## @brief Image flags for Bindless images -class ze_image_bindless_exp_flags_v(IntEnum): - BINDLESS = ZE_BIT(0) ## Bindless images are created with ::zeImageCreate. The image handle - ## created with this flag is valid on both host and device. - SAMPLED_IMAGE = ZE_BIT(1) ## Bindless sampled images are created with ::zeImageCreate by combining - ## BINDLESS and SAMPLED_IMAGE. - ## Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. - -class ze_image_bindless_exp_flags_t(c_int): +class ze_external_memmap_sysmem_ext_version_t(c_int): def __str__(self): - return hex(self.value) + return str(ze_external_memmap_sysmem_ext_version_v(self.value)) ############################################################################### -## @brief Image descriptor for bindless images. This structure may be passed to -## ::zeImageCreate via pNext member of ::ze_image_desc_t. -class ze_image_bindless_exp_desc_t(Structure): +## @brief Maps external system memory for an allocation +## +## @details +## - This structure may be passed to ::zeMemAllocHost, via the `pNext` +## member of ::ze_host_mem_alloc_desc_t to map system memory for a host +## allocation. +## - The `pSystemMemory` pointer and `size` being mapped must be aligned to +## the host page size. The host page size must be queried using +## operating-system-specific calls, as the mapped memory originates from +## the system allocator rather than from Level-Zero; there is no +## Level-Zero query for this value. +## - On success, the pointer returned from ::zeMemAllocHost is identical to +## `pSystemMemory`; the mapping preserves the virtual address, so the +## same address is valid on both the host and the device. +## - Memory from the application's heap, stack, or statically-allocated +## (global) storage is supported. Support for memory obtained by other +## means is platform- and driver-dependent and is not guaranteed. If +## `pSystemMemory` points to a memory type that cannot be mapped, +## ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +## - Host memory that is read-only can only be mapped successfully when the +## ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in +## ::ze_host_mem_alloc_desc_t; in that case device access to the mapped +## memory is read-only. +## - The system memory referenced by `pSystemMemory` must remain valid for +## the entire lifetime of the resulting allocation. Freeing or unmapping +## the underlying system memory before the allocation is released results +## in undefined behavior. +## - Mapped memory ranges must not overlap. Releasing a mapping with +## ::zeMemFree tears down the device page-table entries for its virtual +## address range. Because these page tables are shared across imports, +## releasing a mapping that overlaps another import also tears down the +## overlapping device page-table entries, leaving the other allocation +## invalid for device access. The host system memory itself is +## unaffected. +## - After mapping, ::zeMemGetAllocProperties reports the allocation type +## as ::ZE_MEMORY_TYPE_HOST_IMPORTED. +## - The mapping is released by passing the pointer to ::zeMemFree, like +## any other host allocation. +class ze_external_memmap_sysmem_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). - ("flags", ze_image_bindless_exp_flags_t) ## [in] image flags. - ## must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t - ## default behavior is bindless images are not used when creating handles - ## via ::zeImageCreate. - ## When the flag is passed to ::zeImageCreate, then only the memory for - ## the image is allocated. - ## Additional image handles can be created with ::zeImageViewCreateExt. - ## When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, - ## ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t. + ("pSystemMemory", c_void_p), ## [in] system memory pointer to map; must be page-aligned. + ("size", c_ulonglong) ## [in] size of the system memory to map; must be a multiple of the page + ## size. ] ############################################################################### -## @brief Image descriptor for bindless images created from pitched allocations. -## This structure may be passed to ::zeImageCreate via pNext member of -## ::ze_image_desc_t. -class ze_image_pitched_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). - ("ptr", c_void_p) ## [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice - ] +## @brief Get Kernel Allocation Properties Extension Name +ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME = "ZE_experimental_kernel_allocation_properties" ############################################################################### -## @brief Device specific properties for pitched allocations -## -## @details -## - This structure may be passed to ::zeDeviceGetImageProperties via the -## pNext member of ::ze_device_image_properties_t. -class ze_device_pitched_alloc_exp_properties_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). - ("maxImageLinearWidth", c_size_t), ## [out] Maximum image linear width. - ("maxImageLinearHeight", c_size_t) ## [out] Maximum image linear height. - ] +## @brief Get Kernel Allocation Properties Extension Version(s) +class ze_kernel_get_allocation_properties_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_kernel_get_allocation_properties_exp_version_t(c_int): + def __str__(self): + return str(ze_kernel_get_allocation_properties_exp_version_v(self.value)) -############################################################################### -## @brief Pitch information for 2-dimensional linear pitched allocations -## -## @details -## - This structure may be passed to ::zeDeviceGetImageProperties in -## conjunction with the ::ze_device_pitched_alloc_exp_properties_t via -## its pNext member -class ze_pitched_alloc_2dimage_linear_pitch_exp_info_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). - ("pitchAlign", c_size_t), ## [out] Required pitch Aligment in Bytes. - ("maxSupportedPitch", c_size_t) ## [out] Maximum allowed pitch in Bytes. - ] ############################################################################### -## @brief Specify user defined pitch for pitched linear image allocations. This -## structure may be passed to ::zeImageCreate in conjunction with -## ::ze_image_pitched_exp_desc_t via its pNext member -class ze_custom_pitch_exp_desc_t(Structure): +## @brief Kernel allocation properties +class ze_kernel_allocation_exp_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("rowPitch", c_size_t), ## [in] user programmed aligned pitch for pitched linear image - ## allocations. This pitch should satisfy the pitchAlign requirement in - ## ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t - ("slicePitch", c_size_t) ## [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. + ("base", c_ulonglong), ## [out] base address of the allocation + ("size", c_size_t), ## [out] size of allocation + ("type", ze_memory_type_t), ## [out] type of allocation + ("argIndex", c_ulong) ## [out] kernel argument index for current allocation, -1 for driver + ## internal (not kernel argument) allocations ] ############################################################################### -## @brief Command List Clone Extension Name -ZE_COMMAND_LIST_CLONE_EXP_NAME = "ZE_experimental_command_list_clone" +## @brief Device Usable Memory Size Properties Extension Name +ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_device_usablemem_size_properties" ############################################################################### -## @brief Command List Clone Extension Version(s) -class ze_command_list_clone_exp_version_v(IntEnum): +## @brief Device Usable Mem Size Extension Version(s) +class ze_device_usablemem_size_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_command_list_clone_exp_version_t(c_int): +class ze_device_usablemem_size_properties_ext_version_t(c_int): def __str__(self): - return str(ze_command_list_clone_exp_version_v(self.value)) + return str(ze_device_usablemem_size_properties_ext_version_v(self.value)) ############################################################################### -## @brief Immediate Command List Append Extension Name -ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME = "ZE_experimental_immediate_command_list_append" +## @brief Memory access property to discover current status of usable memory +## +## @details +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t +class ze_device_usablemem_size_ext_properties_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). + ("currUsableMemSize", c_ulonglong) ## [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. + ] ############################################################################### -## @brief Immediate Command List Append Extension Version(s) -class ze_immediate_command_list_append_exp_version_v(IntEnum): +## @brief Image Format Support Extension Name +ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME = "ZE_extension_image_format_support" + +############################################################################### +## @brief Image Format Support Extension Version(s) +class ze_image_format_support_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_immediate_command_list_append_exp_version_t(c_int): +class ze_image_format_support_ext_version_t(c_int): def __str__(self): - return str(ze_immediate_command_list_append_exp_version_v(self.value)) + return str(ze_image_format_support_ext_version_v(self.value)) ############################################################################### -## @brief Mutable Command List Extension Name -ZE_MUTABLE_COMMAND_LIST_EXP_NAME = "ZE_experimental_mutable_command_list" +## @brief Image format support query properties +## +## @details +## - This structure may be passed to ::zeImageGetProperties via the pNext +## member of ::ze_image_properties_t. +## - The implementation shall populate the supported field based on the +## ::ze_image_desc_t and ::ze_device_handle_t passed to +## ::zeImageGetProperties. +## - This provides a mechanism to query format support without requiring +## image creation. +class ze_image_format_support_ext_properties_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). + ("supported", ze_bool_t) ## [out] boolean flag indicating whether the image format is supported on + ## the queried device + ] ############################################################################### -## @brief Mutable Command List Extension Version(s) -class ze_mutable_command_list_exp_version_v(IntEnum): +## @brief IPC Memory Handle Type Extension Name +ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME = "ZE_extension_ipc_mem_handle_type" + +############################################################################### +## @brief IPC Memory Handle Type Extension Version(s) +class ze_ipc_mem_handle_type_ext_version_v(IntEnum): _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - _1_1 = ZE_MAKE_VERSION( 1, 1 ) ## version 1.1 - CURRENT = ZE_MAKE_VERSION( 1, 1 ) ## latest known version + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version -class ze_mutable_command_list_exp_version_t(c_int): +class ze_ipc_mem_handle_type_ext_version_t(c_int): def __str__(self): - return str(ze_mutable_command_list_exp_version_v(self.value)) + return str(ze_ipc_mem_handle_type_ext_version_v(self.value)) ############################################################################### -## @brief Mutable command flags -class ze_mutable_command_exp_flags_v(IntEnum): - KERNEL_ARGUMENTS = ZE_BIT(0) ## kernel arguments - GROUP_COUNT = ZE_BIT(1) ## kernel group count - GROUP_SIZE = ZE_BIT(2) ## kernel group size - GLOBAL_OFFSET = ZE_BIT(3) ## kernel global offset - SIGNAL_EVENT = ZE_BIT(4) ## command signal event - WAIT_EVENTS = ZE_BIT(5) ## command wait events - KERNEL_INSTRUCTION = ZE_BIT(6) ## command kernel - GRAPH_ARGUMENTS = ZE_BIT(7) ## graph arguments +## @brief Supported IPC memory handle type flags +class ze_ipc_mem_handle_type_flags_v(IntEnum): + DEFAULT = ZE_BIT(0) ## Local IPC memory handle type for use within the same device. This is + ## the default if no flags are specified and does not indicate if the + ## handle is shareable across devices or machines. + FABRIC_ACCESSIBLE = ZE_BIT(1) ## Fabric accessible IPC memory handle type for use across devices or + ## machines via a supported fabric. -class ze_mutable_command_exp_flags_t(c_int): +class ze_ipc_mem_handle_type_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Mutable command identifier descriptor -class ze_mutable_command_id_exp_desc_t(Structure): +## @brief ['IPC Memory Handle Type Extension Descriptor', 'Used in +## ::zeMemGetIpcHandleWithProperties, ::zeMemAllocDevice, and +## ::zeMemAllocHost, ::zePhysicalMemCreate to specify the IPC memory +## handle type to create for this allocation.'] +class ze_ipc_mem_handle_type_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). - ("flags", ze_mutable_command_exp_flags_t) ## [in] mutable command flags. - ## - must be 0 (default, equivalent to setting all flags bar kernel - ## instruction), or a valid combination of ::ze_mutable_command_exp_flag_t - ## - in order to include kernel instruction mutation, - ## ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included + ("typeFlags", ze_ipc_mem_handle_type_flags_t) ## [in] valid combination of ::ze_ipc_mem_handle_type_flag_t ] ############################################################################### -## @brief Mutable command list flags -class ze_mutable_command_list_exp_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## reserved +## @brief Record and Replay Graph Extension Name +ZE_RECORD_REPLAY_GRAPH_EXT_NAME = "ZE_extension_record_replay_graph" -class ze_mutable_command_list_exp_flags_t(c_int): +############################################################################### +## @brief Record and Replay Graph Extension Version(s) +class ze_record_replay_graph_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_record_replay_graph_ext_version_t(c_int): + def __str__(self): + return str(ze_record_replay_graph_ext_version_v(self.value)) + + +############################################################################### +## @brief Record and Replay Graph capability flags +class ze_record_replay_graph_ext_flags_v(IntEnum): + IMMUTABLE_GRAPH = ZE_BIT(0) ## Supports graphs that can't mutate + MUTABLE_GRAPH = ZE_BIT(1) ## Supports graphs that can mutate + SUBGRAPHS = ZE_BIT(2) ## Supports appending a subgraph into a graph + APPEND_COMMANDLIST = ZE_BIT(3) ## Supports appending a command list into a graph + CB_EXTERNAL_IPC = ZE_BIT(4) ## Supports waiting/signaling events that were created with both + ## ZEX_COUNTER_BASED_EVENT_FLAG_IPC and + ## ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL + +class ze_record_replay_graph_ext_flags_t(c_int): def __str__(self): return hex(self.value) ############################################################################### -## @brief Mutable command list properties -class ze_mutable_command_list_exp_properties_t(Structure): +## @brief Supported Record and Replay Graph properties. This structure is +## accepted as pNext to ::ze_device_properties_t +class ze_record_replay_graph_ext_properties_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). - ("mutableCommandListFlags", ze_mutable_command_list_exp_flags_t), ## [out] mutable command list flags - ("mutableCommandFlags", ze_mutable_command_exp_flags_t) ## [out] mutable command flags + ("graphFlags", ze_record_replay_graph_ext_flags_t) ## [out] record and replay flags ] ############################################################################### -## @brief Mutable command list descriptor -class ze_mutable_command_list_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). - ("flags", ze_mutable_command_list_exp_flags_t) ## [in] mutable command list flags. - ## - must be 0 (default) or a valid combination of ::ze_mutable_command_list_exp_flag_t - ] +## @brief Handle of an executable graph object +class ze_executable_graph_handle_t(c_void_p): + pass ############################################################################### -## @brief Mutable commands descriptor -class ze_mutable_commands_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). - ("flags", c_ulong) ## [in] must be 0, this field is reserved for future use - ] +## @brief Record and Replay Graph dump mode +class ze_record_replay_graph_ext_dump_mode_v(IntEnum): + DETAILED = 0x0 ## detailed mode (default) + SIMPLE = 0x1 ## simple mode + +class ze_record_replay_graph_ext_dump_mode_t(c_int): + def __str__(self): + return str(ze_record_replay_graph_ext_dump_mode_v(self.value)) + ############################################################################### -## @brief Mutable kernel argument descriptor -class ze_mutable_kernel_argument_exp_desc_t(Structure): +## @brief Record and Replay Graph dump descriptor +## +## @details +## - Accepted as pNext in ::zeGraphDumpContentsExt. +class ze_record_replay_graph_ext_dump_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). - ("commandId", c_ulonglong), ## [in] command identifier - ("argIndex", c_ulong), ## [in] kernel argument index - ("argSize", c_size_t), ## [in] kernel argument size - ("pArgValue", c_void_p) ## [in] pointer to kernel argument value + ("mode", ze_record_replay_graph_ext_dump_mode_t) ## [in] graph dump mode ] ############################################################################### -## @brief Mutable kernel group count descriptor -class ze_mutable_group_count_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). - ("commandId", c_ulonglong), ## [in] command identifier - ("pGroupCount", POINTER(ze_group_count_t)) ## [in] pointer to group count - ] +## @brief Callback function pointer type invoked when a graph is destroyed ############################################################################### -## @brief Mutable kernel group size descriptor -class ze_mutable_group_size_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). - ("commandId", c_ulonglong), ## [in] command identifier - ("groupSizeX", c_ulong), ## [in] group size for X dimension to use for the kernel - ("groupSizeY", c_ulong), ## [in] group size for Y dimension to use for the kernel - ("groupSizeZ", c_ulong) ## [in] group size for Z dimension to use for the kernel - ] +## @brief Host Function callback type ############################################################################### -## @brief Mutable kernel global offset descriptor -class ze_mutable_global_offset_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). - ("commandId", c_ulonglong), ## [in] command identifier - ("offsetX", c_ulong), ## [in] global offset for X dimension to use for this kernel - ("offsetY", c_ulong), ## [in] global offset for Y dimension to use for this kernel - ("offsetZ", c_ulong) ## [in] global offset for Z dimension to use for this kernel - ] +## @brief Virtual Memory Read-Only Properties Extension Name +ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME = "ZE_extension_virtual_mem_readonly_properties" + +############################################################################### +## @brief Virtual Memory Read-Only Properties Extension Version(s) +class ze_virtual_mem_readonly_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_virtual_mem_readonly_properties_ext_version_t(c_int): + def __str__(self): + return str(ze_virtual_mem_readonly_properties_ext_version_v(self.value)) + + +############################################################################### +## @brief Read-only memory page capability values +class ze_device_readonly_memory_capability_v(IntEnum): + NONE = 0 ## Read-only attribute has no effect; the driver does not act on it. + HINT = 1 ## Read-only attribute is a performance hint to the OS; writes may still + ## succeed without fault. + ENFORCED = 2 ## Read-only attribute is hardware-enforced; writes to read-only pages + ## will cause a device fault. + +class ze_device_readonly_memory_capability_t(c_int): + def __str__(self): + return str(ze_device_readonly_memory_capability_v(self.value)) + ############################################################################### -## @brief Mutable graph argument descriptor -class ze_mutable_graph_argument_exp_desc_t(Structure): +## @brief Device read-only memory capability properties +## +## @details +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t +class ze_device_readonly_memory_ext_properties_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 + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("commandId", c_ulonglong), ## [in] command identifier - ("argIndex", c_ulong), ## [in] graph argument index - ("pArgValue", c_void_p) ## [in] pointer to graph argument value + ("readonlyCapability", ze_device_readonly_memory_capability_t) ## [out] Indicates device behavior when + ## ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no + ## effect; writes succeed normally. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a + ## performance hint; writes may still succeed. + ## ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is + ## hardware-enforced; writes cause a device fault. ] ############################################################################### @@ -5864,69 +5864,6 @@ class _ze_rtas_parallel_operation_exp_dditable_t(Structure): ("pfnDestroyExp", c_void_p) ## _zeRTASParallelOperationDestroyExp_t ] -############################################################################### -## @brief Function-pointer for zeGraphCreateExt -if __use_win_types: - _zeGraphCreateExt_t = WINFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) -else: - _zeGraphCreateExt_t = CFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeGraphGetPrimaryCommandListExt -if __use_win_types: - _zeGraphGetPrimaryCommandListExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) -else: - _zeGraphGetPrimaryCommandListExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeGraphSetDestructionCallbackExt -if __use_win_types: - _zeGraphSetDestructionCallbackExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) -else: - _zeGraphSetDestructionCallbackExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) - -############################################################################### -## @brief Function-pointer for zeGraphInstantiateExt -if __use_win_types: - _zeGraphInstantiateExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) -else: - _zeGraphInstantiateExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeGraphIsEmptyExt -if __use_win_types: - _zeGraphIsEmptyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) -else: - _zeGraphIsEmptyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) - -############################################################################### -## @brief Function-pointer for zeGraphDumpContentsExt -if __use_win_types: - _zeGraphDumpContentsExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) -else: - _zeGraphDumpContentsExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) - -############################################################################### -## @brief Function-pointer for zeGraphDestroyExt -if __use_win_types: - _zeGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) -else: - _zeGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) - - -############################################################################### -## @brief Table of Graph functions pointers -class _ze_graph_dditable_t(Structure): - _fields_ = [ - ("pfnCreateExt", c_void_p), ## _zeGraphCreateExt_t - ("pfnGetPrimaryCommandListExt", c_void_p), ## _zeGraphGetPrimaryCommandListExt_t - ("pfnSetDestructionCallbackExt", c_void_p), ## _zeGraphSetDestructionCallbackExt_t - ("pfnInstantiateExt", c_void_p), ## _zeGraphInstantiateExt_t - ("pfnIsEmptyExt", c_void_p), ## _zeGraphIsEmptyExt_t - ("pfnDumpContentsExt", c_void_p), ## _zeGraphDumpContentsExt_t - ("pfnDestroyExt", c_void_p) ## _zeGraphDestroyExt_t - ] - ############################################################################### ## @brief Function-pointer for zeInit if __use_win_types: @@ -5950,29 +5887,6 @@ class _ze_global_dditable_t(Structure): ("pfnInitDrivers", c_void_p) ## _zeInitDrivers_t ] -############################################################################### -## @brief Function-pointer for zeExecutableGraphGetSourceGraphExt -if __use_win_types: - _zeExecutableGraphGetSourceGraphExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) -else: - _zeExecutableGraphGetSourceGraphExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeExecutableGraphDestroyExt -if __use_win_types: - _zeExecutableGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) -else: - _zeExecutableGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) - - -############################################################################### -## @brief Table of ExecutableGraph functions pointers -class _ze_executable_graph_dditable_t(Structure): - _fields_ = [ - ("pfnGetSourceGraphExt", c_void_p), ## _zeExecutableGraphGetSourceGraphExt_t - ("pfnDestroyExt", c_void_p) ## _zeExecutableGraphDestroyExt_t - ] - ############################################################################### ## @brief Function-pointer for zeDriverGet if __use_win_types: @@ -7908,6 +7822,92 @@ class _ze_fabric_edge_exp_dditable_t(Structure): ("pfnGetPropertiesExp", c_void_p) ## _zeFabricEdgeGetPropertiesExp_t ] +############################################################################### +## @brief Function-pointer for zeGraphCreateExt +if __use_win_types: + _zeGraphCreateExt_t = WINFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) +else: + _zeGraphCreateExt_t = CFUNCTYPE( ze_result_t, ze_context_handle_t, c_void_p, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphGetPrimaryCommandListExt +if __use_win_types: + _zeGraphGetPrimaryCommandListExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) +else: + _zeGraphGetPrimaryCommandListExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(ze_command_list_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphSetDestructionCallbackExt +if __use_win_types: + _zeGraphSetDestructionCallbackExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) +else: + _zeGraphSetDestructionCallbackExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, zex_mem_graph_free_callback_fn_t, c_void_p, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeGraphInstantiateExt +if __use_win_types: + _zeGraphInstantiateExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) +else: + _zeGraphInstantiateExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_void_p, POINTER(ze_executable_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeGraphIsEmptyExt +if __use_win_types: + _zeGraphIsEmptyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphIsEmptyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + +############################################################################### +## @brief Function-pointer for zeGraphDumpContentsExt +if __use_win_types: + _zeGraphDumpContentsExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) +else: + _zeGraphDumpContentsExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, c_char_p, c_void_p ) + +############################################################################### +## @brief Function-pointer for zeGraphDestroyExt +if __use_win_types: + _zeGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + + +############################################################################### +## @brief Table of Graph functions pointers +class _ze_graph_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeGraphCreateExt_t + ("pfnGetPrimaryCommandListExt", c_void_p), ## _zeGraphGetPrimaryCommandListExt_t + ("pfnSetDestructionCallbackExt", c_void_p), ## _zeGraphSetDestructionCallbackExt_t + ("pfnInstantiateExt", c_void_p), ## _zeGraphInstantiateExt_t + ("pfnIsEmptyExt", c_void_p), ## _zeGraphIsEmptyExt_t + ("pfnDumpContentsExt", c_void_p), ## _zeGraphDumpContentsExt_t + ("pfnDestroyExt", c_void_p) ## _zeGraphDestroyExt_t + ] + +############################################################################### +## @brief Function-pointer for zeExecutableGraphGetSourceGraphExt +if __use_win_types: + _zeExecutableGraphGetSourceGraphExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) +else: + _zeExecutableGraphGetSourceGraphExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t, POINTER(ze_graph_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeExecutableGraphDestroyExt +if __use_win_types: + _zeExecutableGraphDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) +else: + _zeExecutableGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_executable_graph_handle_t ) + + +############################################################################### +## @brief Table of ExecutableGraph functions pointers +class _ze_executable_graph_dditable_t(Structure): + _fields_ = [ + ("pfnGetSourceGraphExt", c_void_p), ## _zeExecutableGraphGetSourceGraphExt_t + ("pfnDestroyExt", c_void_p) ## _zeExecutableGraphDestroyExt_t + ] + ############################################################################### class _ze_dditable_t(Structure): _fields_ = [ @@ -7915,9 +7915,7 @@ class _ze_dditable_t(Structure): ("RTASBuilderExp", _ze_rtas_builder_exp_dditable_t), ("RTASParallelOperation", _ze_rtas_parallel_operation_dditable_t), ("RTASParallelOperationExp", _ze_rtas_parallel_operation_exp_dditable_t), - ("Graph", _ze_graph_dditable_t), ("Global", _ze_global_dditable_t), - ("ExecutableGraph", _ze_executable_graph_dditable_t), ("Driver", _ze_driver_dditable_t), ("DriverExp", _ze_driver_exp_dditable_t), ("Device", _ze_device_dditable_t), @@ -7942,7 +7940,9 @@ class _ze_dditable_t(Structure): ("PhysicalMem", _ze_physical_mem_dditable_t), ("VirtualMem", _ze_virtual_mem_dditable_t), ("FabricVertexExp", _ze_fabric_vertex_exp_dditable_t), - ("FabricEdgeExp", _ze_fabric_edge_exp_dditable_t) + ("FabricEdgeExp", _ze_fabric_edge_exp_dditable_t), + ("Graph", _ze_graph_dditable_t), + ("ExecutableGraph", _ze_executable_graph_dditable_t) ] ############################################################################### @@ -8011,22 +8011,6 @@ def __init__(self, version : ze_api_version_t): self.zeRTASParallelOperationJoinExp = _zeRTASParallelOperationJoinExp_t(self.__dditable.RTASParallelOperationExp.pfnJoinExp) self.zeRTASParallelOperationDestroyExp = _zeRTASParallelOperationDestroyExp_t(self.__dditable.RTASParallelOperationExp.pfnDestroyExp) - # call driver to get function pointers - _Graph = _ze_graph_dditable_t() - r = ze_result_v(self.__dll.zeGetGraphProcAddrTable(version, byref(_Graph))) - if r != ze_result_v.SUCCESS: - raise Exception(r) - self.__dditable.Graph = _Graph - - # attach function interface to function address - self.zeGraphCreateExt = _zeGraphCreateExt_t(self.__dditable.Graph.pfnCreateExt) - self.zeGraphGetPrimaryCommandListExt = _zeGraphGetPrimaryCommandListExt_t(self.__dditable.Graph.pfnGetPrimaryCommandListExt) - self.zeGraphSetDestructionCallbackExt = _zeGraphSetDestructionCallbackExt_t(self.__dditable.Graph.pfnSetDestructionCallbackExt) - self.zeGraphInstantiateExt = _zeGraphInstantiateExt_t(self.__dditable.Graph.pfnInstantiateExt) - self.zeGraphIsEmptyExt = _zeGraphIsEmptyExt_t(self.__dditable.Graph.pfnIsEmptyExt) - self.zeGraphDumpContentsExt = _zeGraphDumpContentsExt_t(self.__dditable.Graph.pfnDumpContentsExt) - self.zeGraphDestroyExt = _zeGraphDestroyExt_t(self.__dditable.Graph.pfnDestroyExt) - # call driver to get function pointers _Global = _ze_global_dditable_t() r = ze_result_v(self.__dll.zeGetGlobalProcAddrTable(version, byref(_Global))) @@ -8038,17 +8022,6 @@ def __init__(self, version : ze_api_version_t): self.zeInit = _zeInit_t(self.__dditable.Global.pfnInit) self.zeInitDrivers = _zeInitDrivers_t(self.__dditable.Global.pfnInitDrivers) - # call driver to get function pointers - _ExecutableGraph = _ze_executable_graph_dditable_t() - r = ze_result_v(self.__dll.zeGetExecutableGraphProcAddrTable(version, byref(_ExecutableGraph))) - if r != ze_result_v.SUCCESS: - raise Exception(r) - self.__dditable.ExecutableGraph = _ExecutableGraph - - # attach function interface to function address - self.zeExecutableGraphGetSourceGraphExt = _zeExecutableGraphGetSourceGraphExt_t(self.__dditable.ExecutableGraph.pfnGetSourceGraphExt) - self.zeExecutableGraphDestroyExt = _zeExecutableGraphDestroyExt_t(self.__dditable.ExecutableGraph.pfnDestroyExt) - # call driver to get function pointers _Driver = _ze_driver_dditable_t() r = ze_result_v(self.__dll.zeGetDriverProcAddrTable(version, byref(_Driver))) @@ -8494,4 +8467,31 @@ def __init__(self, version : ze_api_version_t): self.zeFabricEdgeGetVerticesExp = _zeFabricEdgeGetVerticesExp_t(self.__dditable.FabricEdgeExp.pfnGetVerticesExp) self.zeFabricEdgeGetPropertiesExp = _zeFabricEdgeGetPropertiesExp_t(self.__dditable.FabricEdgeExp.pfnGetPropertiesExp) + # call driver to get function pointers + _Graph = _ze_graph_dditable_t() + r = ze_result_v(self.__dll.zeGetGraphProcAddrTable(version, byref(_Graph))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.Graph = _Graph + + # attach function interface to function address + self.zeGraphCreateExt = _zeGraphCreateExt_t(self.__dditable.Graph.pfnCreateExt) + self.zeGraphGetPrimaryCommandListExt = _zeGraphGetPrimaryCommandListExt_t(self.__dditable.Graph.pfnGetPrimaryCommandListExt) + self.zeGraphSetDestructionCallbackExt = _zeGraphSetDestructionCallbackExt_t(self.__dditable.Graph.pfnSetDestructionCallbackExt) + self.zeGraphInstantiateExt = _zeGraphInstantiateExt_t(self.__dditable.Graph.pfnInstantiateExt) + self.zeGraphIsEmptyExt = _zeGraphIsEmptyExt_t(self.__dditable.Graph.pfnIsEmptyExt) + self.zeGraphDumpContentsExt = _zeGraphDumpContentsExt_t(self.__dditable.Graph.pfnDumpContentsExt) + self.zeGraphDestroyExt = _zeGraphDestroyExt_t(self.__dditable.Graph.pfnDestroyExt) + + # call driver to get function pointers + _ExecutableGraph = _ze_executable_graph_dditable_t() + r = ze_result_v(self.__dll.zeGetExecutableGraphProcAddrTable(version, byref(_ExecutableGraph))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.ExecutableGraph = _ExecutableGraph + + # attach function interface to function address + self.zeExecutableGraphGetSourceGraphExt = _zeExecutableGraphGetSourceGraphExt_t(self.__dditable.ExecutableGraph.pfnGetSourceGraphExt) + self.zeExecutableGraphDestroyExt = _zeExecutableGraphDestroyExt_t(self.__dditable.ExecutableGraph.pfnDestroyExt) + # success! diff --git a/include/ze_api.h b/include/ze_api.h index bd57d336..680a0b93 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZE_API_H @@ -827,142 +827,6 @@ typedef struct _ze_relaxed_allocation_limits_ext_desc_t ze_relaxed_allocation_li /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_driver_ddi_handles_ext_properties_t -typedef struct _ze_driver_ddi_handles_ext_properties_t ze_driver_ddi_handles_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_semaphore_ext_desc_t -typedef struct _ze_external_semaphore_ext_desc_t ze_external_semaphore_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_semaphore_win32_ext_desc_t -typedef struct _ze_external_semaphore_win32_ext_desc_t ze_external_semaphore_win32_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_semaphore_fd_ext_desc_t -typedef struct _ze_external_semaphore_fd_ext_desc_t ze_external_semaphore_fd_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_semaphore_signal_params_ext_t -typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_signal_params_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_semaphore_wait_params_ext_t -typedef struct _ze_external_semaphore_wait_params_ext_t ze_external_semaphore_wait_params_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_device_cache_line_size_ext_t -typedef struct _ze_device_cache_line_size_ext_t ze_device_cache_line_size_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_ext_desc_t -typedef struct _ze_rtas_builder_ext_desc_t ze_rtas_builder_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_ext_properties_t -typedef struct _ze_rtas_builder_ext_properties_t ze_rtas_builder_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_parallel_operation_ext_properties_t -typedef struct _ze_rtas_parallel_operation_ext_properties_t ze_rtas_parallel_operation_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_device_ext_properties_t -typedef struct _ze_rtas_device_ext_properties_t ze_rtas_device_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_float3_ext_t -typedef struct _ze_rtas_float3_ext_t ze_rtas_float3_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_transform_float3x4_column_major_ext_t -typedef struct _ze_rtas_transform_float3x4_column_major_ext_t ze_rtas_transform_float3x4_column_major_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_transform_float3x4_aligned_column_major_ext_t -typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t ze_rtas_transform_float3x4_aligned_column_major_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_transform_float3x4_row_major_ext_t -typedef struct _ze_rtas_transform_float3x4_row_major_ext_t ze_rtas_transform_float3x4_row_major_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_aabb_ext_t -typedef struct _ze_rtas_aabb_ext_t ze_rtas_aabb_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_triangle_indices_uint32_ext_t -typedef struct _ze_rtas_triangle_indices_uint32_ext_t ze_rtas_triangle_indices_uint32_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_quad_indices_uint32_ext_t -typedef struct _ze_rtas_quad_indices_uint32_ext_t ze_rtas_quad_indices_uint32_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_geometry_info_ext_t -typedef struct _ze_rtas_builder_geometry_info_ext_t ze_rtas_builder_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_triangles_geometry_info_ext_t -typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t ze_rtas_builder_triangles_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_quads_geometry_info_ext_t -typedef struct _ze_rtas_builder_quads_geometry_info_ext_t ze_rtas_builder_quads_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_geometry_aabbs_ext_cb_params_t -typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t ze_rtas_geometry_aabbs_ext_cb_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_procedural_geometry_info_ext_t -typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t ze_rtas_builder_procedural_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_instance_geometry_info_ext_t -typedef struct _ze_rtas_builder_instance_geometry_info_ext_t ze_rtas_builder_instance_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_rtas_builder_build_op_ext_desc_t -typedef struct _ze_rtas_builder_build_op_ext_desc_t ze_rtas_builder_build_op_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_device_vector_width_properties_ext_t -typedef struct _ze_device_vector_width_properties_ext_t ze_device_vector_width_properties_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_external_memmap_sysmem_ext_desc_t -typedef struct _ze_external_memmap_sysmem_ext_desc_t ze_external_memmap_sysmem_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_kernel_allocation_exp_properties_t -typedef struct _ze_kernel_allocation_exp_properties_t ze_kernel_allocation_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_device_usablemem_size_ext_properties_t -typedef struct _ze_device_usablemem_size_ext_properties_t ze_device_usablemem_size_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_image_format_support_ext_properties_t -typedef struct _ze_image_format_support_ext_properties_t ze_image_format_support_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_ipc_mem_handle_type_ext_desc_t -typedef struct _ze_ipc_mem_handle_type_ext_desc_t ze_ipc_mem_handle_type_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_record_replay_graph_ext_properties_t -typedef struct _ze_record_replay_graph_ext_properties_t ze_record_replay_graph_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_record_replay_graph_ext_dump_desc_t -typedef struct _ze_record_replay_graph_ext_dump_desc_t ze_record_replay_graph_ext_dump_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @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_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -1227,123 +1091,259 @@ typedef struct _ze_mutable_global_offset_exp_desc_t ze_mutable_global_offset_exp /// @brief Forward-declare ze_mutable_graph_argument_exp_desc_t typedef struct _ze_mutable_graph_argument_exp_desc_t ze_mutable_graph_argument_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_driver_ddi_handles_ext_properties_t +typedef struct _ze_driver_ddi_handles_ext_properties_t ze_driver_ddi_handles_ext_properties_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs -#if !defined(__GNUC__) -#pragma region driver -#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported initialization flags -typedef uint32_t ze_init_flags_t; -typedef enum _ze_init_flag_t -{ - ZE_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< only initialize GPU drivers - ZE_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< only initialize VPU drivers - ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_INIT_FLAG_* ENUMs +/// @brief Forward-declare ze_external_semaphore_ext_desc_t +typedef struct _ze_external_semaphore_ext_desc_t ze_external_semaphore_ext_desc_t; -} ze_init_flag_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_win32_ext_desc_t +typedef struct _ze_external_semaphore_win32_ext_desc_t ze_external_semaphore_win32_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Initialize the 'oneAPI' driver(s) -/// -/// @details -/// - @deprecated since 1.10. Please use zeInitDrivers() -/// - The application must call this function or zeInitDrivers before -/// calling any other function. -/// - If this function is not called then all other functions will return -/// ::ZE_RESULT_ERROR_UNINITIALIZED. -/// - Only one instance of each driver will be initialized per process. -/// - The application may call this function multiple times with different -/// flags or environment variables enabled. -/// - The application must call this function after forking new processes. -/// Each forked process must call this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe for scenarios -/// where multiple libraries may initialize the driver(s) simultaneously. -/// -/// @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_ENUMERATION -/// + `0x3 < flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -ZE_APIEXPORT ze_result_t ZE_APICALL -zeInit( - ze_init_flags_t flags ///< [in] initialization flags. - ///< must be 0 (default) or a combination of ::ze_init_flag_t. - ); +/// @brief Forward-declare ze_external_semaphore_fd_ext_desc_t +typedef struct _ze_external_semaphore_fd_ext_desc_t ze_external_semaphore_fd_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves driver instances -/// -/// @details -/// - @deprecated since 1.10. Please use zeInitDrivers() -/// - Usage of zeInitDrivers and zeDriverGet is mutually exclusive and -/// should not be used together. Usage of them together will result in -/// undefined behavior. -/// - A driver represents a collection of physical devices. -/// - Multiple calls to this function will return identical driver handles, -/// in the same order. -/// - The application may pass nullptr for pDrivers when only querying the -/// number of drivers. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - clGetPlatformIDs -/// -/// @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_POINTER -/// + `nullptr == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDriverGet( - uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. - ///< if count is zero, then the loader shall update the value with the - ///< total number of drivers available. - ///< if count is greater than the number of drivers available, then the - ///< loader shall update the value with the correct number of drivers available. - ze_driver_handle_t* phDrivers ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. - ///< if count is less than the number of drivers available, then the loader - ///< shall only retrieve that number of drivers. - ); +/// @brief Forward-declare ze_external_semaphore_signal_params_ext_t +typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_signal_params_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported driver initialization type flags -/// -/// @details -/// - Bit Field which details the driver types to be initialized and -/// returned to the user. -/// - Value Definition: -/// - 0, do not init or retrieve any drivers. -/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU, GPU Drivers are Init and driver handles +/// @brief Forward-declare ze_external_semaphore_wait_params_ext_t +typedef struct _ze_external_semaphore_wait_params_ext_t ze_external_semaphore_wait_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_cache_line_size_ext_t +typedef struct _ze_device_cache_line_size_ext_t ze_device_cache_line_size_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_desc_t +typedef struct _ze_rtas_builder_ext_desc_t ze_rtas_builder_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_properties_t +typedef struct _ze_rtas_builder_ext_properties_t ze_rtas_builder_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_parallel_operation_ext_properties_t +typedef struct _ze_rtas_parallel_operation_ext_properties_t ze_rtas_parallel_operation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_device_ext_properties_t +typedef struct _ze_rtas_device_ext_properties_t ze_rtas_device_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_float3_ext_t +typedef struct _ze_rtas_float3_ext_t ze_rtas_float3_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t ze_rtas_transform_float3x4_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_aligned_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t ze_rtas_transform_float3x4_aligned_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_row_major_ext_t +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t ze_rtas_transform_float3x4_row_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_aabb_ext_t +typedef struct _ze_rtas_aabb_ext_t ze_rtas_aabb_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_triangle_indices_uint32_ext_t +typedef struct _ze_rtas_triangle_indices_uint32_ext_t ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_quad_indices_uint32_ext_t +typedef struct _ze_rtas_quad_indices_uint32_ext_t ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_geometry_info_ext_t +typedef struct _ze_rtas_builder_geometry_info_ext_t ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_triangles_geometry_info_ext_t +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_quads_geometry_info_ext_t +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_geometry_aabbs_ext_cb_params_t +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_procedural_geometry_info_ext_t +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_instance_geometry_info_ext_t +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_build_op_ext_desc_t +typedef struct _ze_rtas_builder_build_op_ext_desc_t ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_vector_width_properties_ext_t +typedef struct _ze_device_vector_width_properties_ext_t ze_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_memmap_sysmem_ext_desc_t +typedef struct _ze_external_memmap_sysmem_ext_desc_t ze_external_memmap_sysmem_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_kernel_allocation_exp_properties_t +typedef struct _ze_kernel_allocation_exp_properties_t ze_kernel_allocation_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_usablemem_size_ext_properties_t +typedef struct _ze_device_usablemem_size_ext_properties_t ze_device_usablemem_size_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_image_format_support_ext_properties_t +typedef struct _ze_image_format_support_ext_properties_t ze_image_format_support_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_ipc_mem_handle_type_ext_desc_t +typedef struct _ze_ipc_mem_handle_type_ext_desc_t ze_ipc_mem_handle_type_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_record_replay_graph_ext_properties_t +typedef struct _ze_record_replay_graph_ext_properties_t ze_record_replay_graph_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_record_replay_graph_ext_dump_desc_t +typedef struct _ze_record_replay_graph_ext_dump_desc_t ze_record_replay_graph_ext_dump_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @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; + + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs +#if !defined(__GNUC__) +#pragma region driver +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported initialization flags +typedef uint32_t ze_init_flags_t; +typedef enum _ze_init_flag_t +{ + ZE_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< only initialize GPU drivers + ZE_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< only initialize VPU drivers + ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_INIT_FLAG_* ENUMs + +} ze_init_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Initialize the 'oneAPI' driver(s) +/// +/// @details +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - The application must call this function or zeInitDrivers before +/// calling any other function. +/// - If this function is not called then all other functions will return +/// ::ZE_RESULT_ERROR_UNINITIALIZED. +/// - Only one instance of each driver will be initialized per process. +/// - The application may call this function multiple times with different +/// flags or environment variables enabled. +/// - The application must call this function after forking new processes. +/// Each forked process must call this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe for scenarios +/// where multiple libraries may initialize the driver(s) simultaneously. +/// +/// @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_ENUMERATION +/// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeInit( + ze_init_flags_t flags ///< [in] initialization flags. + ///< must be 0 (default) or a combination of ::ze_init_flag_t. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves driver instances +/// +/// @details +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - Usage of zeInitDrivers and zeDriverGet is mutually exclusive and +/// should not be used together. Usage of them together will result in +/// undefined behavior. +/// - A driver represents a collection of physical devices. +/// - Multiple calls to this function will return identical driver handles, +/// in the same order. +/// - The application may pass nullptr for pDrivers when only querying the +/// number of drivers. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - clGetPlatformIDs +/// +/// @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_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDriverGet( + uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. + ///< if count is zero, then the loader shall update the value with the + ///< total number of drivers available. + ///< if count is greater than the number of drivers available, then the + ///< loader shall update the value with the correct number of drivers available. + ze_driver_handle_t* phDrivers ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. + ///< if count is less than the number of drivers available, then the loader + ///< shall only retrieve that number of drivers. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported driver initialization type flags +/// +/// @details +/// - Bit Field which details the driver types to be initialized and +/// returned to the user. +/// - Value Definition: +/// - 0, do not init or retrieve any drivers. +/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU, GPU Drivers are Init and driver handles /// retrieved. /// - ZE_INIT_DRIVER_TYPE_FLAG_NPU, NPU Drivers are Init and driver handles /// retrieved. @@ -10584,244 +10584,70 @@ typedef struct _ze_relaxed_allocation_limits_exp_desc_t #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for retrieving kernel binary program data. +// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation #if !defined(__GNUC__) -#pragma region kernelBinary +#pragma region cacheReservation #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_GET_KERNEL_BINARY_EXP_NAME -/// @brief Get Kernel Binary Extension Name -#define ZE_GET_KERNEL_BINARY_EXP_NAME "ZE_extension_kernel_binary_exp" -#endif // ZE_GET_KERNEL_BINARY_EXP_NAME +#ifndef ZE_CACHE_RESERVATION_EXT_NAME +/// @brief Cache_Reservation Extension Name +#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" +#endif // ZE_CACHE_RESERVATION_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Get Kernel Binary Extension Version(s) -typedef enum _ze_kernel_get_binary_exp_version_t +/// @brief Cache_Reservation Extension Version(s) +typedef enum _ze_cache_reservation_ext_version_t { - ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_KERNEL_GET_BINARY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs + ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs -} ze_kernel_get_binary_exp_version_t; +} ze_cache_reservation_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel binary program data (ISA GEN format). -/// -/// @details -/// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data -/// for kernel handle. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == pSize` -/// + `nullptr == pKernelBinary` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. - ); - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for Driver Direct Device Interface (DDI) Handles -#if !defined(__GNUC__) -#pragma region driverDDIHandles -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DRIVER_DDI_HANDLES_EXT_NAME -/// @brief Driver Direct Device Interface (DDI) Handles Extension Name -#define ZE_DRIVER_DDI_HANDLES_EXT_NAME "ZE_extension_driver_ddi_handles" -#endif // ZE_DRIVER_DDI_HANDLES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) -typedef enum _ze_driver_ddi_handles_ext_version_t -{ - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLES_EXT_VERSION_* ENUMs - -} ze_driver_ddi_handles_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Driver Direct Device Interface (DDI) Handle Extension Flags -typedef uint32_t ze_driver_ddi_handle_ext_flags_t; -typedef enum _ze_driver_ddi_handle_ext_flag_t +/// @brief Cache Reservation Region +typedef enum _ze_cache_ext_region_t { - ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0), ///< Driver Supports DDI Handles Extension - ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs + ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use + ///< ::ZE_CACHE_EXT_REGION_DEFAULT. + ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use + ///< ::ZE_CACHE_EXT_REGION_RESERVED. + ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use + ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. + ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme + ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region + ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region + ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs -} ze_driver_ddi_handle_ext_flag_t; +} ze_cache_ext_region_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Driver DDI Handles properties queried using ::zeDriverGetProperties +/// @brief CacheReservation structure /// /// @details -/// - This structure may be returned from ::zeDriverGetProperties, via the -/// `pNext` member of ::ze_driver_properties_t. -/// - Starting from spec version 1.17, support for this extension is assumed -/// for any driver reporting API version 1.17 or later via -/// ::zeDriverGetApiVersion; the loader does NOT need to query the -/// extension property for such drivers. -/// - For drivers reporting API version 1.16 or earlier, the loader must -/// check for this extension before using DDI handles. -/// - This guarantee enables Level Zero extensions introduced in spec v1.17 -/// or later to embed handles directly inside Level Zero structures (e.g., -/// via pNext chains) without requiring the loader to translate or unwrap -/// handles. -/// - Additionally, drivers may assume the loader will dispatch calls -/// exclusively via the DDI tables embedded in their handles; the only -/// exception is the global DDI table used during driver initialization -/// and to read the reported API version. -typedef struct _ze_driver_ddi_handles_ext_properties_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). - ze_driver_ddi_handle_ext_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t - -} ze_driver_ddi_handles_ext_properties_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for external semaphores -#if !defined(__GNUC__) -#pragma region externalSemaphores -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME -/// @brief External Semaphores Extension Name -#define ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME "ZE_extension_external_semaphores" -#endif // ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphores Extension Version -typedef enum _ze_external_semaphore_ext_version_t -{ - ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs - -} ze_external_semaphore_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of external semaphore object -typedef struct _ze_external_semaphore_ext_handle_t *ze_external_semaphore_ext_handle_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphores Type Flags -typedef uint32_t ze_external_semaphore_ext_flags_t; -typedef enum _ze_external_semaphore_ext_flag_t -{ - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_FD = ZE_BIT(0), ///< Semaphore is an Linux opaque file descriptor - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32 = ZE_BIT(1), ///< Semaphore is an opaque Win32 handle for monitored fence - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32_KMT = ZE_BIT(2), ///< Semaphore is an opaque Win32 KMT handle for monitored fence - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE = ZE_BIT(3), ///< Semaphore is a D3D12 fence - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D11_FENCE = ZE_BIT(4), ///< Semaphore is a D3D11 fence - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX = ZE_BIT(5), ///< Semaphore is a keyed mutex for Win32 - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX_KMT = ZE_BIT(6), ///< Semaphore is a keyed mutex for Win32 KMT - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7), ///< Semaphore is a Vulkan Timeline semaphore for Linux - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8), ///< Semaphore is a Vulkan Timeline semaphore for Win32 - ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs - -} ze_external_semaphore_ext_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphore Descriptor -typedef struct _ze_external_semaphore_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_external_semaphore_ext_flags_t flags; ///< [in] The flags describing the type of the semaphore. - ///< must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. - ///< When importing a semaphore, pNext should be pointing to one of the - ///< following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. - -} ze_external_semaphore_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphore Win32 Descriptor -typedef struct _ze_external_semaphore_win32_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). - void* handle; ///< [in] Win32 handle of the semaphore. - ///< Must be a valid Win32 handle. - const char* name; ///< [in] Name of the semaphore. - ///< Must be a valid null-terminated string. - -} ze_external_semaphore_win32_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphore FD Descriptor -typedef struct _ze_external_semaphore_fd_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). - int fd; ///< [in] File descriptor of the semaphore. - ///< Must be a valid file descriptor. - -} ze_external_semaphore_fd_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphore Signal parameters -typedef struct _ze_external_semaphore_signal_params_ext_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). - uint64_t value; ///< [in] [optional] Value to signal. - ///< Specified by user as an expected value with some of semaphore types, - ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. - -} ze_external_semaphore_signal_params_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief External Semaphore Wait parameters -typedef struct _ze_external_semaphore_wait_params_ext_t +/// - This structure must be passed to ::zeDeviceGetCacheProperties via the +/// `pNext` member of ::ze_device_cache_properties_t +/// - Used for determining the max cache reservation allowed on device. Size +/// of zero means no reservation available. +typedef struct _ze_cache_reservation_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). - uint64_t value; ///< [in] [optional] Value to wait for. - ///< Specified by user as an expected value with some of semaphore types, - ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + size_t maxCacheReservationSize; ///< [out] max cache reservation size -} ze_external_semaphore_wait_params_ext_t; +} ze_cache_reservation_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Import an external semaphore +/// @brief Reserve Cache on Device /// /// @details -/// - Imports an external semaphore. -/// - This function may be called from simultaneous threads with the same -/// device handle. -/// - The implementation of this function should be lock-free. +/// - The application may call this function but may not be successful as +/// some other application may have reserve prior +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10839,28 +10665,22 @@ typedef struct _ze_external_semaphore_wait_params_ext_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phSemaphore` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1ff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. +zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Release an external semaphore +/// @brief Assign VA section to use reserved section /// /// @details -/// - The application must ensure the device is not currently referencing -/// the semaphore before it is released. -/// - The application must **not** call this function from simultaneous -/// threads with the same semaphore handle. -/// - The implementation of this function must be thread-safe. +/// - The application may call this function to assign VA to particular +/// reservartion region /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10877,22 +10697,61 @@ zeDeviceImportExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hSemaphore` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. +zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. +#if !defined(__GNUC__) +#pragma region eventquerytimestamps +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// @brief Event Query Timestamps Extension Name +#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" +#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Signal an external semaphore +/// @brief Event Query Timestamps Extension Version(s) +typedef enum _ze_event_query_timestamps_exp_version_t +{ + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs + +} ze_event_query_timestamps_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query event timestamps for a device or sub-device. /// /// @details -/// - Signals an external semaphore. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10900,6 +10759,7 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::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 @@ -10908,41 +10768,72 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == signalParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == signalParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. +#if !defined(__GNUC__) +#pragma region imagememoryproperties +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Wait on external semaphores +#ifndef ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME +/// @brief Image Memory Properties Extension Name +#define ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME "ZE_experimental_image_memory_properties" +#endif // ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image Memory Properties Extension Version(s) +typedef enum _ze_image_memory_properties_exp_version_t +{ + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_* ENUMs + +} ze_image_memory_properties_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image memory properties +typedef struct _ze_image_memory_properties_exp_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). + uint64_t size; ///< [out] size of image allocation in bytes. + uint64_t rowPitch; ///< [out] size of image row in bytes. + uint64_t slicePitch; ///< [out] size of image slice in bytes. + +} ze_image_memory_properties_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query image memory properties. /// /// @details -/// - Waits on external semaphores. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - 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. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10950,6 +10841,7 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::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 @@ -10958,662 +10850,544 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == waitParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == waitParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list +/// + `nullptr == pMemoryProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size -#if !defined(__GNUC__) -#pragma region CacheLineSize -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CACHELINE_SIZE_EXT_NAME -/// @brief CacheLine Size Extension Name -#define ZE_CACHELINE_SIZE_EXT_NAME "ZE_extension_device_cache_line_size" -#endif // ZE_CACHELINE_SIZE_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief CacheLine Size Extension Version(s) -typedef enum _ze_device_cache_line_size_ext_version_t -{ - ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_* ENUMs - -} ze_device_cache_line_size_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetCacheProperties via -/// the `pNext` member of ::ze_device_cache_properties_t. -/// - Used for determining the cache line size supported on a device. -typedef struct _ze_device_cache_line_size_ext_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 cacheLineSize; ///< [out] The cache line size in bytes. - -} ze_device_cache_line_size_ext_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure. +// Intel 'oneAPI' Level-Zero Extension for supporting image views. #if !defined(__GNUC__) -#pragma region RTAS +#pragma region imageview #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_RTAS_EXT_NAME -/// @brief Ray Tracing Acceleration Structure Extension Name -#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" -#endif // ZE_RTAS_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) -typedef enum _ze_rtas_builder_ext_version_t -{ - ZE_RTAS_BUILDER_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_RTAS_BUILDER_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_VERSION_* ENUMs - -} ze_rtas_builder_ext_version_t; +#ifndef ZE_IMAGE_VIEW_EXT_NAME +/// @brief Image View Extension Name +#define ZE_IMAGE_VIEW_EXT_NAME "ZE_extension_image_view" +#endif // ZE_IMAGE_VIEW_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device flags -typedef uint32_t ze_rtas_device_ext_flags_t; -typedef enum _ze_rtas_device_ext_flag_t +/// @brief Image View Extension Version(s) +typedef enum _ze_image_view_ext_version_t { - ZE_RTAS_DEVICE_EXT_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use - ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXT_FLAG_* ENUMs + ZE_IMAGE_VIEW_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs -} ze_rtas_device_ext_flag_t; +} ze_image_view_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure format +/// @brief Create image view on the context. /// /// @details -/// - This is an opaque ray tracing acceleration structure format -/// identifier. -typedef enum _ze_rtas_format_ext_t -{ - ZE_RTAS_FORMAT_EXT_INVALID = 0x0, ///< Invalid acceleration structure format code - ZE_RTAS_FORMAT_EXT_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code - ZE_RTAS_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXT_* ENUMs +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXT_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @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 == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ); -} ze_rtas_format_ext_t; +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_VIEW_EXP_NAME +/// @brief Image View Extension Name +#define ZE_IMAGE_VIEW_EXP_NAME "ZE_experimental_image_view" +#endif // ZE_IMAGE_VIEW_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder flags -typedef uint32_t ze_rtas_builder_ext_flags_t; -typedef enum _ze_rtas_builder_ext_flag_t +/// @brief Image View Extension Version(s) +typedef enum _ze_image_view_exp_version_t { - ZE_RTAS_BUILDER_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_FLAG_* ENUMs + ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs -} ze_rtas_builder_ext_flag_t; +} ze_image_view_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation flags -typedef uint32_t ze_rtas_parallel_operation_ext_flags_t; -typedef enum _ze_rtas_parallel_operation_ext_flag_t -{ - ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_* ENUMs +/// @brief Create image view on the context. +/// +/// @details +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXP_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// - Note: This function is deprecated and replaced by +/// ::zeImageViewCreateExt. +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @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 == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ); -} ze_rtas_parallel_operation_ext_flag_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image views for planar images. +#if !defined(__GNUC__) +#pragma region imageviewplanar +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_VIEW_PLANAR_EXT_NAME +/// @brief Image View Planar Extension Name +#define ZE_IMAGE_VIEW_PLANAR_EXT_NAME "ZE_extension_image_view_planar" +#endif // ZE_IMAGE_VIEW_PLANAR_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry flags -typedef uint32_t ze_rtas_builder_geometry_ext_flags_t; -typedef enum _ze_rtas_builder_geometry_ext_flag_t +/// @brief Image View Planar Extension Version(s) +typedef enum _ze_image_view_planar_ext_version_t { - ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader - ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_* ENUMs - -} ze_rtas_builder_geometry_ext_flag_t; + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry flags (see -/// ::ze_rtas_builder_geometry_ext_flags_t) -typedef uint8_t ze_rtas_builder_packed_geometry_ext_flags_t; +} ze_image_view_planar_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance flags -typedef uint32_t ze_rtas_builder_instance_ext_flags_t; -typedef enum _ze_rtas_builder_instance_ext_flag_t +/// @brief Image view planar descriptor +typedef struct _ze_image_view_planar_ext_desc_t { - ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles - ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles - ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to - ///< be non-opaque - ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it - ///< to be opaque - ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_* ENUMs + 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 planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) -} ze_rtas_builder_instance_ext_flag_t; +} ze_image_view_planar_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder instance flags (see -/// ::ze_rtas_builder_instance_ext_flags_t) -typedef uint8_t ze_rtas_builder_packed_instance_ext_flags_t; +#ifndef ZE_IMAGE_VIEW_PLANAR_EXP_NAME +/// @brief Image View Planar Extension Name +#define ZE_IMAGE_VIEW_PLANAR_EXP_NAME "ZE_experimental_image_view_planar" +#endif // ZE_IMAGE_VIEW_PLANAR_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build operation flags -/// -/// @details -/// - These flags allow the application to tune the acceleration structure -/// build operation. -/// - The acceleration structure builder implementation might choose to use -/// spatial splitting to split large or long primitives into smaller -/// pieces. This may result in any-hit shaders being invoked multiple -/// times for non-opaque primitives, unless -/// ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. -/// - Usage of any of these flags may reduce ray tracing performance. -typedef uint32_t ze_rtas_builder_build_op_ext_flags_t; -typedef enum _ze_rtas_builder_build_op_ext_flag_t +/// @brief Image View Planar Extension Version(s) +typedef enum _ze_image_view_planar_exp_version_t { - ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure - ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive - ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_* ENUMs + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs -} ze_rtas_builder_build_op_ext_flag_t; +} ze_image_view_planar_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build quality hint -/// -/// @details -/// - Depending on use case different quality modes for acceleration -/// structure build are supported. -/// - A low-quality build builds an acceleration structure fast, but at the -/// cost of some reduction in ray tracing performance. This mode is -/// recommended for dynamic content, such as animated characters. -/// - A medium-quality build uses a compromise between build quality and ray -/// tracing performance. This mode should be used by default. -/// - Higher ray tracing performance can be achieved by using a high-quality -/// build, but acceleration structure build performance might be -/// significantly reduced. -typedef enum _ze_rtas_builder_build_quality_hint_ext_t +/// @brief Image view planar descriptor +typedef struct _ze_image_view_planar_exp_desc_t { - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW = 0, ///< build low-quality acceleration structure (fast) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH = 2, ///< build high-quality acceleration structure (slow) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_* ENUMs + 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 planeIndex; ///< [DEPRECATED] no longer supported, use + ///< ::ze_image_view_planar_ext_desc_t instead -} ze_rtas_builder_build_quality_hint_ext_t; +} ze_image_view_planar_exp_desc_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for specifying kernel scheduling hints. +#if !defined(__GNUC__) +#pragma region kernelSchedulingHints +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry type -typedef enum _ze_rtas_builder_geometry_type_ext_t -{ - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES = 0, ///< triangle mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS = 1, ///< quad mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL = 2, ///< procedural geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE = 3, ///< instance geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_* ENUMs - -} ze_rtas_builder_geometry_type_ext_t; +#ifndef ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME +/// @brief Kernel Scheduling Hints Extension Name +#define ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME "ZE_experimental_scheduling_hints" +#endif // ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry type (see -/// ::ze_rtas_builder_geometry_type_ext_t) -typedef uint8_t ze_rtas_builder_packed_geometry_type_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure data buffer element format -/// -/// @details -/// - Specifies the format of data buffer elements. -/// - Data buffers may contain instancing transform matrices, triangle/quad -/// vertex indices, etc... -typedef enum _ze_rtas_builder_input_data_format_ext_t +/// @brief Kernel Scheduling Hints Extension Version(s) +typedef enum _ze_scheduling_hints_exp_version_t { - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_column_major_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see - ///< ::ze_rtas_transform_float3x4_row_major_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see - ///< ::ze_rtas_triangle_indices_uint32_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_* ENUMs - -} ze_rtas_builder_input_data_format_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure data buffer element format -/// (see ::ze_rtas_builder_input_data_format_ext_t) -typedef uint8_t ze_rtas_builder_packed_input_data_format_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder object -typedef struct _ze_rtas_builder_ext_handle_t *ze_rtas_builder_ext_handle_t; + ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder parallel -/// operation object -typedef struct _ze_rtas_parallel_operation_ext_handle_t *ze_rtas_parallel_operation_ext_handle_t; +} ze_scheduling_hints_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder descriptor -typedef struct _ze_rtas_builder_ext_desc_t +/// @brief Supported kernel scheduling hint flags +typedef uint32_t ze_scheduling_hint_exp_flags_t; +typedef enum _ze_scheduling_hint_exp_flag_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_rtas_builder_ext_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1), ///< Hint that the kernel prefers round-robin scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2), ///< Hint that the kernel prefers stall-based round-robin scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs -} ze_rtas_builder_ext_desc_t; +} ze_scheduling_hint_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder properties -typedef struct _ze_rtas_builder_ext_properties_t +/// @brief Device kernel scheduling hint properties queried using +/// ::zeDeviceGetModuleProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetModuleProperties, via +/// the `pNext` member of ::ze_device_module_properties_t. +typedef struct _ze_scheduling_hint_exp_properties_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). - ze_rtas_builder_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder flags - size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is expected to succeed; however, it is possible that the build - ///< may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY - size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is guaranteed to not run out of memory. - size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration - ///< structure build. + ze_scheduling_hint_exp_flags_t schedulingHintFlags; ///< [out] Supported kernel scheduling hints. + ///< May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. -} ze_rtas_builder_ext_properties_t; +} ze_scheduling_hint_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation -/// properties -typedef struct _ze_rtas_parallel_operation_ext_properties_t +/// @brief Kernel scheduling hint descriptor +/// +/// @details +/// - This structure may be passed to ::zeKernelSchedulingHintExp. +typedef struct _ze_scheduling_hint_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_parallel_operation_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation - ///< flags - uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + ze_scheduling_hint_exp_flags_t flags; ///< [in] flags specifying kernel scheduling hints. + ///< must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. -} ze_rtas_parallel_operation_ext_properties_t; +} ze_scheduling_hint_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device properties +/// @brief Provide kernel scheduling hints that may improve performance /// /// @details -/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` -/// member of ::ze_device_properties_t. -/// - The implementation shall populate `format` with a value other than -/// ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. -typedef struct _ze_rtas_device_ext_properties_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). - ze_rtas_device_ext_flags_t flags; ///< [out] ray tracing acceleration structure device flags - ze_rtas_format_ext_t rtasFormat; ///< [out] ray tracing acceleration structure format - uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer +/// - The scheduling hints may improve performance only and are not required +/// for correctness. +/// - If a specified scheduling hint is unsupported it will be silently +/// ignored. +/// - If two conflicting scheduling hints are specified there is no defined behavior; +/// the hints may be ignored or one hint may be chosen arbitrarily. +/// - The application must not call this function from simultaneous threads +/// with the same kernel handle. +/// - 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 == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pHint` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < pHint->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ); -} ze_rtas_device_ext_properties_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for One-Definition-Rule Linkage Types +#if !defined(__GNUC__) +#pragma region linkonceodr +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_LINKONCE_ODR_EXT_NAME +/// @brief Linkonce ODR Extension Name +#define ZE_LINKONCE_ODR_EXT_NAME "ZE_extension_linkonce_odr" +#endif // ZE_LINKONCE_ODR_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-component vector type -typedef struct _ze_rtas_float3_ext_t +/// @brief Linkonce ODR Extension Version(s) +typedef enum _ze_linkonce_odr_ext_version_t { - float x; ///< [in] x-coordinate of float3 vector - float y; ///< [in] y-coordinate of float3 vector - float z; ///< [in] z-coordinate of float3 vector + ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs -} ze_rtas_float3_ext_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 /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in column-major layout -/// -/// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_column_major_ext_t -{ - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix - -} ze_rtas_transform_float3x4_column_major_ext_t; +#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 3x4 affine transformation in column-major layout with aligned column -/// vectors -/// -/// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -/// - The column vectors are aligned to 16-bytes and pad members are -/// ignored. -typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t +/// @brief Power Saving Hint Extension Version(s) +typedef enum _ze_power_saving_hint_exp_version_t { - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float pad0; ///< [in] ignored padding - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float pad1; ///< [in] ignored padding - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float pad2; ///< [in] ignored padding - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix - float pad3; ///< [in] ignored padding + 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_rtas_transform_float3x4_aligned_column_major_ext_t; +} ze_power_saving_hint_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in row-major layout -/// -/// @details -/// - A 3x4 affine transformation in row-major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_row_major_ext_t +/// @brief Supported device types +typedef enum _ze_power_saving_hint_type_t { - float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix - float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix - float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix - float p_x; ///< [in] element 3 of row 0 of 3x4 matrix - float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix - float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix - float p_y; ///< [in] element 3 of row 1 of 3x4 matrix - float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix - float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix - float p_z; ///< [in] element 3 of row 2 of 3x4 matrix + ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minumum 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_rtas_transform_float3x4_row_major_ext_t; +} ze_power_saving_hint_type_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds -/// in each dimension -typedef struct _ze_rtas_aabb_ext_t +/// @brief Extended context descriptor containing power saving hint. +typedef struct _ze_context_power_saving_hint_exp_desc_t { - ze_rtas_float3_ext_t lower; ///< [in] lower bounds of AABB - ze_rtas_float3_ext_t upper; ///< [in] upper bounds of AABB + 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_rtas_aabb_ext_t; +} ze_context_power_saving_hint_exp_desc_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Subgroups +#if !defined(__GNUC__) +#pragma region subgroups +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Triangle represented using 3 vertex indices -/// -/// @details -/// - Represents a triangle using 3 vertex indices that index into a vertex -/// array that needs to be provided together with the index array. -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_triangle_indices_uint32_ext_t +#ifndef ZE_SUBGROUPS_EXT_NAME +/// @brief Subgroups Extension Name +#define ZE_SUBGROUPS_EXT_NAME "ZE_extension_subgroups" +#endif // ZE_SUBGROUPS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Subgroups Extension Version(s) +typedef enum _ze_subgroup_ext_version_t { - uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex - ///< array - uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs -} ze_rtas_triangle_indices_uint32_ext_t; +} ze_subgroup_ext_version_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for EU Count +#if !defined(__GNUC__) +#pragma region EUCount +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EU_COUNT_EXT_NAME +/// @brief EU Count Extension Name +#define ZE_EU_COUNT_EXT_NAME "ZE_extension_eu_count" +#endif // ZE_EU_COUNT_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Quad represented using 4 vertex indices +/// @brief EU Count Extension Version(s) +typedef enum _ze_eu_count_ext_version_t +{ + ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs + +} ze_eu_count_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief EU count queried using ::zeDeviceGetProperties /// /// @details -/// - Represents a quad composed of 4 indices that index into a vertex array -/// that needs to be provided together with the index array. -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_quad_indices_uint32_ext_t +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t. +/// - Used for determining the total number of EUs available on device. +typedef struct _ze_eu_count_ext_t { - uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array - uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array - uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + 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 numTotalEUs; ///< [out] Total number of EUs available -} ze_rtas_quad_indices_uint32_ext_t; +} ze_eu_count_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for PCI Properties +#if !defined(__GNUC__) +#pragma region PCIProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_PCI_PROPERTIES_EXT_NAME +/// @brief PCI Properties Extension Name +#define ZE_PCI_PROPERTIES_EXT_NAME "ZE_extension_pci_properties" +#endif // ZE_PCI_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry info -typedef struct _ze_rtas_builder_geometry_info_ext_t +/// @brief PCI Properties Extension Version(s) +typedef enum _ze_pci_properties_ext_version_t { - ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type + ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs -} ze_rtas_builder_geometry_info_ext_t; +} ze_pci_properties_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// @brief Device PCI address /// /// @details -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t +/// - This structure may be passed to ::zeDevicePciGetPropertiesExt as an +/// attribute of ::ze_pci_ext_properties_t. +/// - A PCI BDF address is the bus:device:function address of the device and +/// is useful for locating the device in the PCI switch fabric. +typedef struct _ze_pci_address_ext_t { - ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES - ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_ext_t triangleFormat; ///< [in] format of triangle buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 - uint32_t triangleCount; ///< [in] number of triangles in triangle buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + uint32_t domain; ///< [out] PCI domain number + uint32_t bus; ///< [out] PCI BDF bus number + uint32_t device; ///< [out] PCI BDF device number + uint32_t function; ///< [out] PCI BDF function number -} ze_rtas_builder_triangles_geometry_info_ext_t; +} ze_pci_address_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder quad mesh geometry info -/// -/// @details -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_builder_quads_geometry_info_ext_t +/// @brief Device PCI speed +typedef struct _ze_pci_speed_ext_t { - ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS - ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_ext_t quadFormat; ///< [in] format of quad buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 - uint32_t quadCount; ///< [in] number of quads in quad buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + int32_t genVersion; ///< [out] The link generation. A value of -1 means that this property is + ///< unknown. + int32_t width; ///< [out] The number of lanes. A value of -1 means that this property is + ///< unknown. + int64_t maxBandwidth; ///< [out] The theoretical maximum bandwidth in bytes/sec (sum of all + ///< lanes). A value of -1 means that this property is unknown. -} ze_rtas_builder_quads_geometry_info_ext_t; +} ze_pci_speed_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief AABB callback function parameters -typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t +/// @brief Static PCI properties +typedef struct _ze_pci_ext_properties_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 primID; ///< [in] first primitive to return bounds for - uint32_t primIDCount; ///< [in] number of primitives to return bounds for - void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor - void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExt function - ze_rtas_aabb_ext_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to - -} ze_rtas_geometry_aabbs_ext_cb_params_t; + ze_pci_address_ext_t address; ///< [out] The BDF address + ze_pci_speed_ext_t maxSpeed; ///< [out] Fastest port configuration supported by the device (sum of all + ///< lanes) -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function pointer type to return AABBs for a range of -/// procedural primitives -typedef void (*ze_rtas_geometry_aabbs_cb_ext_t)( - ze_rtas_geometry_aabbs_ext_cb_params_t* params ///< [in] callback function parameters structure - ); +} ze_pci_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder procedural primitives -/// geometry info -/// -/// @details -/// - A host-side bounds callback function is invoked by the acceleration -/// structure builder to query the bounds of procedural primitives on -/// demand. The callback is passed some `pGeomUserPtr` that can point to -/// an application-side representation of the procedural primitives. -/// Further, a second `pBuildUserPtr`, which is set by a parameter to -/// ::zeRTASBuilderBuildExt, is passed to the callback. This allows the -/// build to change the bounds of the procedural geometry, for example, to -/// build a BVH only over a short time range to implement multi-segment -/// motion blur. -typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t -{ - ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL - ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - uint8_t reserved; ///< [in] reserved for future use - uint32_t primCount; ///< [in] number of primitives in geometry - ze_rtas_geometry_aabbs_cb_ext_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box - ///< for a range of primitives - void* pGeomUserPtr; ///< [in] user data pointer passed to callback - -} ze_rtas_builder_procedural_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance geometry info -typedef struct _ze_rtas_builder_instance_geometry_info_ext_t -{ - ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE - ze_rtas_builder_packed_instance_ext_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_ext_t transformFormat; ///< [in] format of the specified transformation - uint32_t instanceUserID; ///< [in] user-specified identifier for the instance - void* pTransform; ///< [in] object-to-world instance transformation in specified format - ze_rtas_aabb_ext_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced - ///< acceleration structure - void* pAccelerationStructure; ///< [in] device pointer to acceleration structure to instantiate - -} ze_rtas_builder_instance_geometry_info_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief -typedef struct _ze_rtas_builder_build_op_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_rtas_format_ext_t rtasFormat; ///< [in] ray tracing acceleration structure format - ze_rtas_builder_build_quality_hint_ext_t buildQuality; ///< [in] acceleration structure build quality hint - ze_rtas_builder_build_op_ext_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t - ///< flags - const ze_rtas_builder_geometry_info_ext_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of - ///< pointers to geometry infos - uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when - ///< `ppGeometries` is NULL - -} ze_rtas_builder_build_op_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Get PCI properties - address, max speed /// /// @details /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11630,26 +11404,109 @@ typedef struct _ze_rtas_builder_build_op_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == pPciProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object +zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for sRGB +#if !defined(__GNUC__) +#pragma region SRGB +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_SRGB_EXT_NAME +/// @brief sRGB Extension Name +#define ZE_SRGB_EXT_NAME "ZE_extension_srgb" +#endif // ZE_SRGB_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief sRGB Extension Version(s) +typedef enum _ze_srgb_ext_version_t +{ + ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs + +} ze_srgb_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief sRGB image descriptor /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - This structure may be passed to ::zeImageCreate via the `pNext` member +/// of ::ze_image_desc_t +/// - Used for specifying that the image is in sRGB format. +typedef struct _ze_srgb_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_bool_t sRGB; ///< [in] Is sRGB. + +} ze_srgb_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Image Copy To/From Memory +#if !defined(__GNUC__) +#pragma region imageCopy +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_COPY_EXT_NAME +/// @brief Image Copy Extension Name +#define ZE_IMAGE_COPY_EXT_NAME "ZE_extension_image_copy" +#endif // ZE_IMAGE_COPY_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image Copy Extension Version(s) +typedef enum _ze_image_copy_ext_version_t +{ + ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs + +} ze_image_copy_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Copies from an image to device or shared memory. +/// +/// @details +/// - The application must ensure the memory pointed to by dstptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the source +/// image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, 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. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueReadImage /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11666,30 +11523,65 @@ zeRTASBuilderCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hCommandList` +/// + `nullptr == hSrcImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties +zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @brief Copies to an image from device or shared memory. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The application must ensure the memory pointed to by srcptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by srcptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the +/// destination image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, 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. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueWriteImage /// /// @returns +/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -11703,71 +11595,70 @@ zeRTASBuilderGetBuildPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +/// + `nullptr == hCommandList` +/// + `nullptr == hDstImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B +zeCommandListAppendImageCopyFromMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Querying Image Allocation Properties. +#if !defined(__GNUC__) +#pragma region imageQueryAllocProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME +/// @brief Image Query Allocation Properties Extension Name +#define ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME "ZE_extension_image_query_alloc_properties" +#endif // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Image Query Allocation Properties Extension Version(s) +typedef enum _ze_image_query_alloc_properties_ext_version_t +{ + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_image_query_alloc_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image allocation properties queried using +/// ::zeImageGetAllocPropertiesExt +typedef struct _ze_image_allocation_ext_properties_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). + uint64_t id; ///< [out] identifier for this allocation + +} ze_image_allocation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves attributes of an image allocation /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. -/// - 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. -/// - 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. -/// - 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. -/// - 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. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - 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. -/// - A successfully constructed acceleration structure is generally -/// non-copyable. It can only get copied from host to device using the -/// special ::zeRTASBuilderCommandListAppendCopyExt function. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11784,60 +11675,77 @@ zeDriverRTASFormatCompatibilityCheckExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hContext` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +/// + `nullptr == pImageAllocProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes +zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Linkage Inspection +#if !defined(__GNUC__) +#pragma region linkageInspection +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_LINKAGE_INSPECTION_EXT_NAME +/// @brief Linkage Inspection Extension Name +#define ZE_LINKAGE_INSPECTION_EXT_NAME "ZE_extension_linkage_inspection" +#endif // ZE_LINKAGE_INSPECTION_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device -/// memory. +/// @brief Linkage Inspection Extension Version(s) +typedef enum _ze_linkage_inspection_ext_version_t +{ + ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs + +} ze_linkage_inspection_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported module linkage inspection flags +typedef uint32_t ze_linkage_inspection_ext_flags_t; +typedef enum _ze_linkage_inspection_ext_flag_t +{ + ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules + ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1), ///< List all imports of modules that do not have a corresponding export + ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules + ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs + +} ze_linkage_inspection_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Module linkage inspection descriptor /// /// @details -/// - The memory pointed to by srcptr must be host memory containing a valid -/// ray tracing acceleration structure. -/// - The number of bytes to copy must be larger or equal to the size of the -/// ray tracing acceleration structure. -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. -/// - 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, -/// and the memory was allocated, 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 structure may be passed to ::zeModuleInspectLinkageExt. +typedef struct _ze_linkage_inspection_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_linkage_inspection_ext_flags_t flags; ///< [in] flags specifying module linkage inspection. + ///< must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. + +} ze_linkage_inspection_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief List Imports & Exports +/// +/// @details +/// - List all the import & unresolveable import dependencies & exports of a +/// set of modules +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11853,169 +11761,160 @@ zeRTASBuilderBuildExt( /// - ::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 == dstptr` -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pInspectDesc` +/// + `nullptr == phModules` +/// + `nullptr == phLog` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < pInspectDesc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderCommandListAppendCopyExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting memory compression hints. +#if !defined(__GNUC__) +#pragma region memoryCompressionHints +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object -/// -/// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ); +#ifndef ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME +/// @brief Memory Compression Hints Extension Name +#define ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME "ZE_extension_memory_compression_hints" +#endif // ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object -/// -/// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. -/// -/// @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 == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ///< [out] handle of parallel operation object - ); +/// @brief Memory Compression Hints Extension Version(s) +typedef enum _ze_memory_compression_hints_ext_version_t +{ + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_* ENUMs + +} ze_memory_compression_hints_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties +/// @brief Supported memory compression hints flags +typedef uint32_t ze_memory_compression_hints_ext_flags_t; +typedef enum _ze_memory_compression_hints_ext_flag_t +{ + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0), ///< Hint Driver implementation to make allocation compressible + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_* ENUMs + +} ze_memory_compression_hints_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Compression hints memory allocation descriptor /// /// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == hParallelOperation` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties ///< [in,out] query result for parallel operation properties - ); +/// - This structure may be passed to ::zeMemAllocShared or +/// ::zeMemAllocDevice, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t. +/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` +/// member of ::ze_host_mem_alloc_desc_t. +/// - This structure may be passed to ::zeImageCreate, via the `pNext` +/// member of ::ze_image_desc_t. +typedef struct _ze_memory_compression_hints_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_memory_compression_hints_ext_flags_t flags; ///< [in] flags specifying if allocation should be compressible or not. + ///< Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; + +} ze_memory_compression_hints_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Memory Free Policies +#if !defined(__GNUC__) +#pragma region memoryFreePolicies +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MEMORY_FREE_POLICIES_EXT_NAME +/// @brief Memory Free Policies Extension Name +#define ZE_MEMORY_FREE_POLICIES_EXT_NAME "ZE_extension_memory_free_policies" +#endif // ZE_MEMORY_FREE_POLICIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Memory Free Policies Extension Version(s) +typedef enum _ze_memory_free_policies_ext_version_t +{ + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_FREE_POLICIES_EXT_VERSION_* ENUMs + +} ze_memory_free_policies_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported memory free policy capability flags +typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; +typedef enum _ze_driver_memory_free_policy_ext_flag_t +{ + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< Blocks until all commands using the memory are complete before + ///< scheduling memory to be freed. Does not guarantee memory is freed upon + ///< return, only that it is safe and is scheduled to be freed. Actual + ///< freeing of memory is specific to user mode driver and kernel mode + ///< driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< Immediately schedules the memory to be freed and returns without + ///< blocking. Memory may be freed after all commands using the memory are + ///< complete. Actual freeing of memory is specific to user mode driver and + ///< kernel mode driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_* ENUMs + +} ze_driver_memory_free_policy_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Driver memory free properties queried using ::zeDriverGetProperties /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion -/// -/// @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 == hParallelOperation` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object - ); +/// - All drivers must support an immediate free policy, which is the +/// default free policy. +/// - This structure may be returned from ::zeDriverGetProperties, via the +/// `pNext` member of ::ze_driver_properties_t. +typedef struct _ze_driver_memory_free_ext_properties_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). + ze_driver_memory_free_policy_ext_flags_t freePolicies; ///< [out] Supported memory free policies. + ///< must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. + +} ze_driver_memory_free_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Memory free descriptor with free policy +typedef struct _ze_memory_free_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_driver_memory_free_policy_ext_flags_t freePolicy; ///< [in] flags specifying the memory free policy. + ///< must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; + ///< default behavior is to free immediately. + +} ze_memory_free_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. +/// - 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. /// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. +/// threads with the same pointer. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -12033,417 +11932,261 @@ zeRTASParallelOperationJoinExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemFreeDesc` +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < pMemFreeDesc->freePolicy` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for Device Vector Sizes Query +// Intel 'oneAPI' Level-Zero Extension APIs for Bandwidth #if !defined(__GNUC__) -#pragma region deviceVectorSizes +#pragma region bandwidth #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_VECTOR_SIZES_EXT_NAME -/// @brief Device Vector Sizes Query Extension Name -#define ZE_DEVICE_VECTOR_SIZES_EXT_NAME "ZE_extension_device_vector_sizes" -#endif // ZE_DEVICE_VECTOR_SIZES_EXT_NAME - +#ifndef ZE_BANDWIDTH_PROPERTIES_EXP_NAME +/// @brief Bandwidth Extension Name +#define ZE_BANDWIDTH_PROPERTIES_EXP_NAME "ZE_experimental_bandwidth_properties" +#endif // ZE_BANDWIDTH_PROPERTIES_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Vector Sizes Query Extension Version(s) -typedef enum _ze_device_vector_sizes_ext_version_t +/// @brief Bandwidth Extension Version(s) +typedef enum _ze_bandwidth_properties_exp_version_t { - ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_* ENUMs + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_* ENUMs -} ze_device_vector_sizes_ext_version_t; +} ze_bandwidth_properties_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Vector Width Properties queried using -/// $DeviceGetVectorWidthPropertiesExt -typedef struct _ze_device_vector_width_properties_ext_t +/// @brief P2P Bandwidth Properties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetP2PProperties by having +/// the pNext member of ::ze_device_p2p_properties_t point at this struct. +typedef struct _ze_device_p2p_bandwidth_exp_properties_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 vector_width_size; ///< [out] The associated vector width size supported by the device. - uint32_t preferred_vector_width_char; ///< [out] The preferred vector width size for char type supported by the device. - uint32_t preferred_vector_width_short; ///< [out] The preferred vector width size for short type supported by the device. - uint32_t preferred_vector_width_int; ///< [out] The preferred vector width size for int type supported by the device. - uint32_t preferred_vector_width_long; ///< [out] The preferred vector width size for long type supported by the device. - uint32_t preferred_vector_width_float; ///< [out] The preferred vector width size for float type supported by the device. - uint32_t preferred_vector_width_double; ///< [out] The preferred vector width size for double type supported by the device. - uint32_t preferred_vector_width_half; ///< [out] The preferred vector width size for half type supported by the device. - uint32_t native_vector_width_char; ///< [out] The native vector width size for char type supported by the device. - uint32_t native_vector_width_short; ///< [out] The native vector width size for short type supported by the device. - uint32_t native_vector_width_int; ///< [out] The native vector width size for int type supported by the device. - uint32_t native_vector_width_long; ///< [out] The native vector width size for long type supported by the device. - uint32_t native_vector_width_float; ///< [out] The native vector width size for float type supported by the device. - uint32_t native_vector_width_double; ///< [out] The native vector width size for double type supported by the device. - uint32_t native_vector_width_half; ///< [out] The native vector width size for half type supported by the device. + uint32_t logicalBandwidth; ///< [out] total logical design bandwidth for all links connecting the two + ///< devices + uint32_t physicalBandwidth; ///< [out] total physical design bandwidth for all links connecting the two + ///< devices + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + uint32_t logicalLatency; ///< [out] average logical design latency for all links connecting the two + ///< devices + uint32_t physicalLatency; ///< [out] average physical design latency for all links connecting the two + ///< devices + ze_latency_unit_t latencyUnit; ///< [out] latency unit -} ze_device_vector_width_properties_ext_t; +} ze_device_p2p_bandwidth_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves the vector width properties of the device. +/// @brief Copy Bandwidth Properties /// /// @details -/// - Properties are reported for each vector width supported by the device. -/// - Multiple calls to this function will return properties in the same -/// order. -/// - The number of vector width properties is reported thru the pCount -/// parameter which is updated by the driver given pCount == 0. -/// - The application may provide a buffer that is larger than the number of -/// properties, but the application must set pCount to the number of -/// properties to retrieve. -/// - 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 == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. - ); +/// - This structure may be passed to +/// ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of +/// ::ze_command_queue_group_properties_t point at this struct. +/// - [DEPRECATED] +typedef struct _ze_copy_bandwidth_exp_properties_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 copyBandwidth; ///< [out] design bandwidth supported by this engine type for copy + ///< operations + ze_bandwidth_unit_t copyBandwidthUnit; ///< [out] copy bandwidth unit + +} ze_copy_bandwidth_exp_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Mapping External Memory as part of host allocation +// Intel 'oneAPI' Level-Zero Extension APIs for Device Local Identifier (LUID) #if !defined(__GNUC__) -#pragma region externalMemMap +#pragma region deviceLUID #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME -/// @brief External Memory Mapping Extension Name -#define ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME "ZE_extension_external_memmap_sysmem" -#endif // ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME +#ifndef ZE_DEVICE_LUID_EXT_NAME +/// @brief Device Local Identifier (LUID) Extension Name +#define ZE_DEVICE_LUID_EXT_NAME "ZE_extension_device_luid" +#endif // ZE_DEVICE_LUID_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief External Memory Mapping Extension Version(s) -typedef enum _ze_external_memmap_sysmem_ext_version_t +/// @brief Device Local Identifier (LUID) Extension Version(s) +typedef enum _ze_device_luid_ext_version_t { - ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_* ENUMs + ZE_DEVICE_LUID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_LUID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs -} ze_external_memmap_sysmem_ext_version_t; +} ze_device_luid_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Maps external system memory for an allocation +#ifndef ZE_MAX_DEVICE_LUID_SIZE_EXT +/// @brief Maximum device local identifier (LUID) size in bytes +#define ZE_MAX_DEVICE_LUID_SIZE_EXT 8 +#endif // ZE_MAX_DEVICE_LUID_SIZE_EXT + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device local identifier (LUID) +typedef struct _ze_device_luid_ext_t +{ + uint8_t id[ZE_MAX_DEVICE_LUID_SIZE_EXT]; ///< [out] opaque data representing a device LUID + +} ze_device_luid_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device LUID properties queried using ::zeDeviceGetProperties /// /// @details -/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` -/// member of ::ze_host_mem_alloc_desc_t to map system memory for a host -/// allocation. -/// - The `pSystemMemory` pointer and `size` being mapped must be aligned to -/// the host page size. The host page size must be queried using -/// operating-system-specific calls, as the mapped memory originates from -/// the system allocator rather than from Level-Zero; there is no -/// Level-Zero query for this value. -/// - On success, the pointer returned from ::zeMemAllocHost is identical to -/// `pSystemMemory`; the mapping preserves the virtual address, so the -/// same address is valid on both the host and the device. -/// - Memory from the application's heap, stack, or statically-allocated -/// (global) storage is supported. Support for memory obtained by other -/// means is platform- and driver-dependent and is not guaranteed. If -/// `pSystemMemory` points to a memory type that cannot be mapped, -/// ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. -/// - Host memory that is read-only can only be mapped successfully when the -/// ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in -/// ::ze_host_mem_alloc_desc_t; in that case device access to the mapped -/// memory is read-only. -/// - The system memory referenced by `pSystemMemory` must remain valid for -/// the entire lifetime of the resulting allocation. Freeing or unmapping -/// the underlying system memory before the allocation is released results -/// in undefined behavior. -/// - Mapped memory ranges must not overlap. Releasing a mapping with -/// ::zeMemFree tears down the device page-table entries for its virtual -/// address range. Because these page tables are shared across imports, -/// releasing a mapping that overlaps another import also tears down the -/// overlapping device page-table entries, leaving the other allocation -/// invalid for device access. The host system memory itself is -/// unaffected. -/// - After mapping, ::zeMemGetAllocProperties reports the allocation type -/// as ::ZE_MEMORY_TYPE_HOST_IMPORTED. -/// - The mapping is released by passing the pointer to ::zeMemFree, like -/// any other host allocation. -typedef struct _ze_external_memmap_sysmem_ext_desc_t +/// - This structure may be returned from ::zeDeviceGetProperties, via the +/// `pNext` member of ::ze_device_properties_t. +typedef struct _ze_device_luid_ext_properties_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 + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - void* pSystemMemory; ///< [in] system memory pointer to map; must be page-aligned. - uint64_t size; ///< [in] size of the system memory to map; must be a multiple of the page - ///< size. + ze_device_luid_ext_t luid; ///< [out] locally unique identifier (LUID). + ///< The returned LUID can be cast to a LUID object and must be equal to + ///< the locally + ///< unique identifier of an IDXGIAdapter1 object that corresponds to the device. + uint32_t nodeMask; ///< [out] node mask. + ///< The returned node mask must contain exactly one bit. + ///< If the device is running on an operating system that supports the + ///< Direct3D 12 API + ///< and the device corresponds to an individual device in a linked device + ///< adapter, the + ///< returned node mask identifies the Direct3D 12 node corresponding to + ///< the device. + ///< Otherwise, the returned node mask must be 1. -} ze_external_memmap_sysmem_ext_desc_t; +} ze_device_luid_ext_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for retrieving kernel memory allocation properties. +// Intel 'oneAPI' Level-Zero Extension APIs for Fabric Topology Discovery #if !defined(__GNUC__) -#pragma region kernelAllocationProperties +#pragma region fabric #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME -/// @brief Get Kernel Allocation Properties Extension Name -#define ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME "ZE_experimental_kernel_allocation_properties" -#endif // ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME +#ifndef ZE_FABRIC_EXP_NAME +/// @brief Fabric Topology Discovery Extension Name +#define ZE_FABRIC_EXP_NAME "ZE_experimental_fabric" +#endif // ZE_FABRIC_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Get Kernel Allocation Properties Extension Version(s) -typedef enum _ze_kernel_get_allocation_properties_exp_version_t +/// @brief Fabric Topology Discovery Extension Version(s) +typedef enum _ze_fabric_exp_version_t { - ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_* ENUMs + ZE_FABRIC_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_FABRIC_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_FABRIC_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EXP_VERSION_* ENUMs -} ze_kernel_get_allocation_properties_exp_version_t; +} ze_fabric_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel allocation properties -typedef struct _ze_kernel_allocation_exp_properties_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). - uint64_t base; ///< [out] base address of the allocation - size_t size; ///< [out] size of allocation - ze_memory_type_t type; ///< [out] type of allocation - uint32_t argIndex; ///< [out] kernel argument index for current allocation, -1 for driver - ///< internal (not kernel argument) allocations - -} ze_kernel_allocation_exp_properties_t; +#ifndef ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE +/// @brief Maximum fabric edge model string size +#define ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE 256 +#endif // ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel allocation properties. -/// -/// @details -/// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns array of kernel allocation properties for kernel handle. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties ///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. - ); +/// @brief Fabric Vertex types +typedef enum _ze_fabric_vertex_exp_type_t +{ + ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN = 0, ///< Fabric vertex type is unknown + ZE_FABRIC_VERTEX_EXP_TYPE_DEVICE = 1, ///< Fabric vertex represents a device + ZE_FABRIC_VERTEX_EXP_TYPE_SUBDEVICE = 2, ///< Fabric vertex represents a subdevice + ZE_FABRIC_VERTEX_EXP_TYPE_SWITCH = 3, ///< Fabric vertex represents a switch + ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device UsableMem Size Properties Extension -#if !defined(__GNUC__) -#pragma region deviceusablememproperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME -/// @brief Device Usable Memory Size Properties Extension Name -#define ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME "ZE_extension_device_usablemem_size_properties" -#endif // ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME +} ze_fabric_vertex_exp_type_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Usable Mem Size Extension Version(s) -typedef enum _ze_device_usablemem_size_properties_ext_version_t +/// @brief Fabric edge duplexity +typedef enum _ze_fabric_edge_exp_duplexity_t { - ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN = 0, ///< Fabric edge duplexity is unknown + ZE_FABRIC_EDGE_EXP_DUPLEXITY_HALF_DUPLEX = 1, ///< Fabric edge is half duplex, i.e. stated bandwidth is obtained in only + ///< one direction at time + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FULL_DUPLEX = 2, ///< Fabric edge is full duplex, i.e. stated bandwidth is supported in both + ///< directions simultaneously + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs -} ze_device_usablemem_size_properties_ext_version_t; +} ze_fabric_edge_exp_duplexity_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory access property to discover current status of usable memory +/// @brief PCI address /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t -typedef struct _ze_device_usablemem_size_ext_properties_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). - uint64_t currUsableMemSize; ///< [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. - -} ze_device_usablemem_size_ext_properties_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Image Format Support -#if !defined(__GNUC__) -#pragma region imageFormatSupport -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME -/// @brief Image Format Support Extension Name -#define ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME "ZE_extension_image_format_support" -#endif // ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image Format Support Extension Version(s) -typedef enum _ze_image_format_support_ext_version_t +/// - A PCI BDF address is the bus:device:function address of the device and +/// is useful for locating the device in the PCI switch fabric. +typedef struct _ze_fabric_vertex_pci_exp_address_t { - ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_* ENUMs + uint32_t domain; ///< [out] PCI domain number + uint32_t bus; ///< [out] PCI BDF bus number + uint32_t device; ///< [out] PCI BDF device number + uint32_t function; ///< [out] PCI BDF function number -} ze_image_format_support_ext_version_t; +} ze_fabric_vertex_pci_exp_address_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image format support query properties -/// -/// @details -/// - This structure may be passed to ::zeImageGetProperties via the pNext -/// member of ::ze_image_properties_t. -/// - The implementation shall populate the supported field based on the -/// ::ze_image_desc_t and ::ze_device_handle_t passed to -/// ::zeImageGetProperties. -/// - This provides a mechanism to query format support without requiring -/// image creation. -typedef struct _ze_image_format_support_ext_properties_t +/// @brief Fabric Vertex properties +typedef struct _ze_fabric_vertex_exp_properties_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). - ze_bool_t supported; ///< [out] boolean flag indicating whether the image format is supported on - ///< the queried device - -} ze_image_format_support_ext_properties_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for setting the IPC memory handle type requested at memory allocation time. -#if !defined(__GNUC__) -#pragma region ipcMemHandleType -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME -/// @brief IPC Memory Handle Type Extension Name -#define ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME "ZE_extension_ipc_mem_handle_type" -#endif // ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief IPC Memory Handle Type Extension Version(s) -typedef enum _ze_ipc_mem_handle_type_ext_version_t -{ - ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_* ENUMs - -} ze_ipc_mem_handle_type_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported IPC memory handle type flags -typedef uint32_t ze_ipc_mem_handle_type_flags_t; -typedef enum _ze_ipc_mem_handle_type_flag_t -{ - ZE_IPC_MEM_HANDLE_TYPE_FLAG_DEFAULT = ZE_BIT(0), ///< Local IPC memory handle type for use within the same device. This is - ///< the default if no flags are specified and does not indicate if the - ///< handle is shareable across devices or machines. - ZE_IPC_MEM_HANDLE_TYPE_FLAG_FABRIC_ACCESSIBLE = ZE_BIT(1), ///< Fabric accessible IPC memory handle type for use across devices or - ///< machines via a supported fabric. - ZE_IPC_MEM_HANDLE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_FLAG_* ENUMs + ze_uuid_t uuid; ///< [out] universal unique identifier. If the vertex is co-located with a + ///< device/subdevice, then this uuid will match that of the corresponding + ///< device/subdevice + ze_fabric_vertex_exp_type_t type; ///< [out] does the fabric vertex represent a device, subdevice, or switch? + ze_bool_t remote; ///< [out] does the fabric vertex live on the local node or on a remote + ///< node? + ze_fabric_vertex_pci_exp_address_t address; ///< [out] B/D/F address of fabric vertex & associated device/subdevice if + ///< available -} ze_ipc_mem_handle_type_flag_t; +} ze_fabric_vertex_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief ['IPC Memory Handle Type Extension Descriptor', 'Used in -/// ::zeMemGetIpcHandleWithProperties, ::zeMemAllocDevice, and -/// ::zeMemAllocHost, ::zePhysicalMemCreate to specify the IPC memory -/// handle type to create for this allocation.'] -typedef struct _ze_ipc_mem_handle_type_ext_desc_t +/// @brief Fabric Edge properties +typedef struct _ze_fabric_edge_exp_properties_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 + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_ipc_mem_handle_type_flags_t typeFlags; ///< [in] valid combination of ::ze_ipc_mem_handle_type_flag_t + ze_uuid_t uuid; ///< [out] universal unique identifier. + char model[ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]; ///< [out] Description of fabric edge technology. Will be set to the string + ///< "unkown" if this cannot be determined for this edge + uint32_t bandwidth; ///< [out] design bandwidth + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + uint32_t latency; ///< [out] design latency + ze_latency_unit_t latencyUnit; ///< [out] latency unit + ze_fabric_edge_exp_duplexity_t duplexity; ///< [out] Duplexity of the fabric edge -} ze_ipc_mem_handle_type_ext_desc_t; +} ze_fabric_edge_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an IPC memory handle for the specified allocation with -/// properties for the requested handle. +/// @brief Retrieves fabric vertices within a driver /// /// @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. +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -12462,113 +12205,33 @@ typedef struct _ze_ipc_mem_handle_type_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pIpcHandle` +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle +zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Level-Zero Extension for Record and Replay of Graphs. -#if !defined(__GNUC__) -#pragma region graph -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_RECORD_REPLAY_GRAPH_EXT_NAME -/// @brief Record and Replay Graph Extension Name -#define ZE_RECORD_REPLAY_GRAPH_EXT_NAME "ZE_extension_record_replay_graph" -#endif // ZE_RECORD_REPLAY_GRAPH_EXT_NAME - /////////////////////////////////////////////////////////////////////////////// -/// @brief Record and Replay Graph Extension Version(s) -typedef enum _ze_record_replay_graph_ext_version_t -{ - ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_* ENUMs - -} ze_record_replay_graph_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Record and Replay Graph capability flags -typedef uint32_t ze_record_replay_graph_ext_flags_t; -typedef enum _ze_record_replay_graph_ext_flag_t -{ - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_IMMUTABLE_GRAPH = ZE_BIT(0), ///< Supports graphs that can't mutate - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_MUTABLE_GRAPH = ZE_BIT(1), ///< Supports graphs that can mutate - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS = ZE_BIT(2), ///< Supports appending a subgraph into a graph - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST = ZE_BIT(3), ///< Supports appending a command list into a graph - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC = ZE_BIT(4), ///< Supports waiting/signaling events that were created with both - ///< ZEX_COUNTER_BASED_EVENT_FLAG_IPC and - ///< ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL - ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_* ENUMs - -} ze_record_replay_graph_ext_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported Record and Replay Graph properties. This structure is -/// accepted as pNext to ::ze_device_properties_t -typedef struct _ze_record_replay_graph_ext_properties_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). - ze_record_replay_graph_ext_flags_t graphFlags; ///< [out] record and replay flags - -} ze_record_replay_graph_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of an executable graph object -typedef struct _ze_executable_graph_handle_t *ze_executable_graph_handle_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Record and Replay Graph dump mode -typedef enum _ze_record_replay_graph_ext_dump_mode_t -{ - ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_DETAILED = 0x0, ///< detailed mode (default) - ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_SIMPLE = 0x1, ///< simple mode - ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_* ENUMs - -} ze_record_replay_graph_ext_dump_mode_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Record and Replay Graph dump descriptor -/// -/// @details -/// - Accepted as pNext in ::zeGraphDumpContentsExt. -typedef struct _ze_record_replay_graph_ext_dump_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_record_replay_graph_ext_dump_mode_t mode; ///< [in] graph dump mode - -} ze_record_replay_graph_ext_dump_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function pointer type invoked when a graph is destroyed -typedef void (ZE_CALLBACK_CONV *zex_mem_graph_free_callback_fn_t)( - void* pUserData ///< [in][optional] user data pointer provided at callback registration - ///< time - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a new graph object. +/// @brief Retrieves a fabric sub-vertex from a fabric vertex /// /// @details -/// - A newly created graph is an empty container for captured operations. -/// - The application may instantiate executable graph objects from a -/// recorded graph using ::zeGraphInstantiateExt. -/// - The application may begin capturing into an empty graph using -/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - Multiple calls to this function will return identical fabric vertex +/// handles, in the same order. +/// - The number of handles returned from this function is affected by the +/// `ZE_AFFINITY_MASK` environment variable. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12585,88 +12248,29 @@ typedef void (ZE_CALLBACK_CONV *zex_mem_graph_free_callback_fn_t)( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hVertex` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created +zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Begins recording asynchronous append operations into a new graph -/// associated with an immediate command list. +/// @brief Retrieves properties of the fabric vertex. /// /// @details -/// - Graph capture is intended for asynchronous append operations only; -/// synchronous operations are not supported while capture is active and -/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. -/// - The application must call this function only with an immediate command -/// list. -/// - The application must not call this function with a synchronous -/// immediate command list. -/// - After this call succeeds, append operations issued to the command list -/// are recorded into a graph and are not submitted to the device. Events -/// used by these operations are not signaled until capture ends and the -/// graph is instantiated and executed. -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while -/// capture is active, calling -/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command -/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is -/// active, calling ::zeCommandListAppendGraphExt on the capturing command -/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). -/// - While capture is active, host-side synchronization operations on -/// recorded work, such as ::zeCommandListHostSynchronize or -/// ::zeEventHostSynchronize, return -/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. -/// - While capture is active, internal counter-based events (i.e. without -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph -/// cannot be used outside the graph; such use returns an error -/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). -/// - The command list on which capture starts is called the primary command -/// list for a given capture session. -/// - If an event signaled by a captured command list is used in the wait -/// list of another immediate command list, that command list also enters -/// graph capture mode. This creates a fork. The command list from which -/// the fork originated is called the parent, and the forked command list -/// is called the child. A child command list may itself be used to create -/// additional forks, resulting in a tree of command lists participating -/// in the same graph capture. -/// - Subsequent signals from the parent command list to a child command -/// list are allowed and do not create additional forks or capture -/// sessions; the child command list remains in the same capture session -/// as the parent command list. -/// - Each fork must be joined by signaling on the child command list and by -/// waiting on the parent command list. -/// - A child command list may signal multiple times back to the parent -/// command list, but only the last signal on the child command list may -/// become part of the join operation. -/// - Child command lists continue recording as long as the primary command -/// list is in capture mode. -/// - Commands that append work (for example, compute kernels or data -/// transfers) to a recording child command list after the intended join -/// operation are treated as unjoined work, and the graph is considered -/// invalid. Commands that do not append work (for example, event signal -/// and wait operations) are allowed after the join operation and do not -/// invalidate the graph. -/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt -/// apply to recording child command lists as well. -/// - It is invalid to merge two separate graph capture sessions (i.e. with -/// different primary command lists) by waiting on an event associated -/// with a different graph (operation will return -/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event -/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error -/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append -/// operations. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12683,25 +12287,21 @@ zeGraphCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pVertexProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties ///< [in,out] query result for fabric vertex properties ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Begins recording asynchronous append operations into an existing -/// graph. +/// @brief Returns device handle from fabric vertex handle. /// /// @details -/// - The graph must be created with ::zeGraphCreateExt before calling this -/// function. -/// - The graph must be empty when capture begins. -/// - After this call succeeds, the command list enters graph capture mode -/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt -/// apply. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12718,24 +12318,25 @@ zeCommandListBeginGraphCaptureExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hGraph` +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDevice` +/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE +/// + Provided fabric vertex handle does not correspond to a device or subdevice. +/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE +/// + Provided fabric vertex handle corresponds to remote device or subdevice. ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries whether a command list is in graph capture mode. +/// @brief Returns fabric vertex handle from device handle. /// /// @details -/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is -/// in graph capture mode. -/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is -/// not in graph capture mode. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12752,35 +12353,25 @@ zeCommandListBeginCaptureIntoGraphExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phVertex` +/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX +/// + Provided device handle does not correspond to a fabric vertex. ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list +zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Ends graph capture on the primary command list and returns the -/// recorded graph. +/// @brief Retrieves all fabric edges between provided pair of fabric vertices /// /// @details -/// - This function may only be called on the primary command list used with -/// ::zeCommandListBeginGraphCaptureExt or -/// ::zeCommandListBeginCaptureIntoGraphExt. -/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, -/// the returned graph handle is the same graph handle that was provided -/// when capture began. -/// - The returned graph must be instantiated before execution. -/// - This call ends graph capture mode on all command lists participating -/// in the same graph capture (including forks). -/// - After this call succeeds, subsequent append operations submit work to -/// the device normally. -/// - If capture mode is not active on the command list, an error is -/// returned. -/// - After this call succeeds, events signaled by previously captured -/// commands do not create new forks. -/// - After this call succeeds, internal counter-based events (i.e. without -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the -/// application and don't interfere with recorded state. +/// - A fabric edge represents one or more physical links between two fabric +/// vertices. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12797,33 +12388,33 @@ zeCommandListIsGraphCaptureEnabledExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hVertexA` +/// + `nullptr == hVertexB` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS -/// + if graph contains unjoined forks -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING -/// + if command list is not in graph capture mode +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle +zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the graph associated with a command list that is in graph -/// capture mode. +/// @brief Retrieves fabric vertices connected by a fabric edge /// /// @details -/// - This function may only be called while the command list is in graph -/// capture mode. -/// - The returned graph handle cannot be instantiated until capture is -/// ended by ::zeCommandListEndGraphCaptureExt. -/// - This function does not transfer ownership of the graph handle. -/// - If the command list is not in graph capture mode, an error is returned -/// and `*phGraph` is set to null. +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices via a fabric edge. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12840,26 +12431,23 @@ zeCommandListEndGraphCaptureExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hEdge` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING -/// + if command list is not in graph capture mode +/// + `nullptr == phVertexA` +/// + `nullptr == phVertexB` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list +zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the primary command list associated with a graph capture -/// session. +/// @brief Retrieves properties of the fabric edge. /// /// @details -/// - The returned command list is the command list that initiated capture -/// for the graph during its recording stage. -/// - This function can be called while the graph is being recorded and -/// after capture has ended. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12876,501 +12464,366 @@ zeCommandListGetGraphExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hEdge` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phCommandList` +/// + `nullptr == pEdgeProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph +zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties ///< [in,out] query result for fabric edge properties ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device Memory Properties +#if !defined(__GNUC__) +#pragma region memoryProperties +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Registers a host callback that is invoked when a graph is destroyed. -/// -/// @details -/// - Callbacks may be registered while a graph is being recorded or after -/// executable graph instances have been created from it. -/// - Multiple callbacks may be registered for the same graph. -/// - All registered callbacks are invoked when the graph is destroyed. -/// - The callback must not call Level Zero APIs that use the graph being -/// destroyed. -/// -/// @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_APIEXPORT ze_result_t ZE_APICALL -zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ); +#ifndef ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME +/// @brief Device Memory Properties Extension Name +#define ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME "ZE_extension_device_memory_properties" +#endif // ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an executable graph object from a recorded graph. -/// -/// @details -/// - Multiple executable graph objects may be created from a single -/// recorded graph. -/// - 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. -/// -/// @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 == phExecutableGraph` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph - ); +/// @brief Device Memory Properties Extension Version(s) +typedef enum _ze_device_memory_properties_ext_version_t +{ + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_device_memory_properties_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends execution of an executable graph to a command list. +/// @brief Memory module types +typedef enum _ze_device_memory_ext_type_t +{ + ZE_DEVICE_MEMORY_EXT_TYPE_HBM = 0, ///< HBM memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM2 = 1, ///< HBM2 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR = 2, ///< DDR memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR2 = 3, ///< DDR2 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR3 = 4, ///< DDR3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR4 = 5, ///< DDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR5 = 6, ///< DDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR = 7, ///< LPDDR memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR3 = 8, ///< LPDDR3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR4 = 9, ///< LPDDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5 = 10, ///< LPDDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_SRAM = 11, ///< SRAM memory + ZE_DEVICE_MEMORY_EXT_TYPE_L1 = 12, ///< L1 cache + ZE_DEVICE_MEMORY_EXT_TYPE_L3 = 13, ///< L3 cache + ZE_DEVICE_MEMORY_EXT_TYPE_GRF = 14, ///< Execution unit register file + ZE_DEVICE_MEMORY_EXT_TYPE_SLM = 15, ///< Execution unit shared local memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR4 = 16, ///< GDDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5 = 17, ///< GDDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5X = 18, ///< GDDR5X memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6 = 19, ///< GDDR6 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6X = 20, ///< GDDR6X memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR7 = 21, ///< GDDR7 memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM2E = 22, ///< HBM2E memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM3 = 23, ///< HBM3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM3E = 24, ///< HBM3E memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM4 = 25, ///< HBM4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5X = 26, ///< LPDDR5X memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR6 = 27, ///< LPDDR6 memory + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs + +} ze_device_memory_ext_type_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory properties /// /// @details -/// - The destination command list must match the type and execution -/// characteristics of the command list used to initiate recording, -/// including the queue group ordinal and immediate mode configuration. -/// - Only one execution of the same executable graph object may run at a -/// time; concurrent graph execution requires multiple executable graph -/// instances. -/// - If this function is called while the executable graph is already -/// running, the new execution is scheduled after the current execution -/// completes. -/// - Graph execution obeys the implicit in-order dependency semantics of -/// the destination command list. -/// - If `hSignalEvent` is provided, it is signaled after all recorded -/// append operations on all recorded queues complete. -/// - If wait events are provided, graph execution does not begin until all -/// wait events are satisfied. -/// -/// @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 == hCommandList` -/// + `nullptr == hGraph` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ); +/// - This structure may be returned from ::zeDeviceGetMemoryProperties via +/// the `pNext` member of ::ze_device_memory_properties_t +typedef struct _ze_device_memory_ext_properties_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). + ze_device_memory_ext_type_t type; ///< [out] The memory type + uint64_t physicalSize; ///< [out] Physical memory size in bytes. A value of 0 indicates that this + ///< property is not known. However, a call to ::zesMemoryGetState() will + ///< correctly return the total size of usable memory. + uint32_t readBandwidth; ///< [out] Design bandwidth for reads + uint32_t writeBandwidth; ///< [out] Design bandwidth for writes + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit +} ze_device_memory_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Bfloat16 Conversions +#if !defined(__GNUC__) +#pragma region bfloat16conversions +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the recorded graph used to instantiate an executable 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 == phSourceGraph` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle - ); +#ifndef ZE_BFLOAT16_CONVERSIONS_EXT_NAME +/// @brief Bfloat16 Conversions Extension Name +#define ZE_BFLOAT16_CONVERSIONS_EXT_NAME "ZE_extension_bfloat16_conversions" +#endif // ZE_BFLOAT16_CONVERSIONS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries whether a graph is empty. -/// -/// @details -/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no -/// operations. -/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains -/// recorded operations. -/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded -/// graph is invalid. -/// -/// @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_APIEXPORT ze_result_t ZE_APICALL -zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph - ); +/// @brief Bfloat16 Conversions Extension Version(s) +typedef enum _ze_bfloat16_conversions_ext_version_t +{ + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs + +} ze_bfloat16_conversions_ext_version_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device IP Version +#if !defined(__GNUC__) +#pragma region deviceipversion +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Writes a DOT description of a recorded graph to disk. -/// -/// @details -/// - The generated DOT output captures the graph structure and recorded -/// append operations. -/// - Kernel node output includes kernel names, argument lists, and argument -/// types and values. -/// -/// @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 == filePath` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ); +#ifndef ZE_DEVICE_IP_VERSION_EXT_NAME +/// @brief Device IP Version Extension Name +#define ZE_DEVICE_IP_VERSION_EXT_NAME "ZE_extension_device_ip_version" +#endif // ZE_DEVICE_IP_VERSION_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys an executable graph object. -/// -/// @details -/// - The executable graph must not be in use or executing on any command -/// list when it is destroyed. -/// - After destruction, the handle becomes invalid and must not be used in -/// further API calls. -/// -/// @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_APIEXPORT ze_result_t ZE_APICALL -zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy - ); +/// @brief Device IP Version Extension Version(s) +typedef enum _ze_device_ip_version_version_t +{ + ZE_DEVICE_IP_VERSION_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_IP_VERSION_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs + +} ze_device_ip_version_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a recorded graph object. +/// @brief Device IP version queried using ::zeDeviceGetProperties /// /// @details -/// - All executable graph instances created from the recorded graph must be -/// destroyed before this function is called. -/// - After destruction, the handle becomes invalid and must not be used in -/// further API calls. -/// -/// @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_APIEXPORT ze_result_t ZE_APICALL -zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy - ); +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_ip_version_ext_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 ipVersion; ///< [out] Device IP version. The meaning of the device IP version is + ///< implementation-defined, but newer devices should have a higher + ///< version than older devices. + +} ze_device_ip_version_ext_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero APIs for Append Host Function +// Intel 'oneAPI' Level-Zero Extension for querying kernel max group size properties. #if !defined(__GNUC__) -#pragma region hostFunction +#pragma region kernelMaxGroupSizeProperties #endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Host Function callback type -typedef void (ZE_CALLBACK_CONV *ze_host_function_callback_t)( - void* pUserData ///< [in][optional] user data pointer - ); +#ifndef ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME +/// @brief Kernel Max Group Size Properties Extension Name +#define ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME "ZE_extension_kernel_max_group_size_properties" +#endif // ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a host function call into a command list. +/// @brief Kernel Max Group Size Properties Extension Version(s) +typedef enum _ze_kernel_max_group_size_properties_ext_version_t +{ + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_kernel_max_group_size_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Additional kernel max group size properties /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - The host function will be executed on the host when the command list -/// reaches this point during execution. -/// - The host function callback must be of type -/// ::ze_host_function_callback_t. -/// - The host function must **not** call any Level Zero API functions. -/// - The host function may access USM shared and USM host allocations. -/// - The runtime invokes the host function asynchronously to API calls. -/// - Device may wait for preceding commands to finish before invoking the -/// callback (i.e. callbacks may introduce implicit synchronization point -/// on the device). -/// - Device will wait for all phWaitEvents to be signaled before executing -/// the host function. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. -/// -/// @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_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported -ZE_APIEXPORT 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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ); +/// - This structure may be passed to ::zeKernelGetProperties, via the +/// `pNext` member of ::ze_kernel_properties_t, to query additional kernel +/// max group size properties. +typedef struct _ze_kernel_max_group_size_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 maxGroupSize; ///< [out] maximum group size that can be used to execute the kernel. This + ///< value may be less than or equal to the `maxTotalGroupSize` member of + ///< ::ze_device_compute_properties_t. + +} ze_kernel_max_group_size_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief compiler-independent type +typedef ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_ext_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Virtual Memory Read-Only Properties +// Intel 'oneAPI' Level-Zero Extension for querying sub-allocations properties. #if !defined(__GNUC__) -#pragma region virtualMemReadOnlyProperties +#pragma region subAllocationsProperties #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME -/// @brief Virtual Memory Read-Only Properties Extension Name -#define ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME "ZE_extension_virtual_mem_readonly_properties" -#endif // ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME +#ifndef ZE_SUB_ALLOCATIONS_EXP_NAME +/// @brief Sub-Allocations Properties Extension Name +#define ZE_SUB_ALLOCATIONS_EXP_NAME "ZE_experimental_sub_allocations" +#endif // ZE_SUB_ALLOCATIONS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Virtual Memory Read-Only Properties Extension Version(s) -typedef enum _ze_virtual_mem_readonly_properties_ext_version_t +/// @brief Sub-Allocations Properties Extension Version(s) +typedef enum _ze_sub_allocations_exp_version_t { - ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_* ENUMs + ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SUB_ALLOCATIONS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs -} ze_virtual_mem_readonly_properties_ext_version_t; +} ze_sub_allocations_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Read-only memory page capability values -typedef enum _ze_device_readonly_memory_capability_t +/// @brief Properties returned for a sub-allocation +typedef struct _ze_sub_allocation_t { - ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE = 0, ///< Read-only attribute has no effect; the driver does not act on it. - ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT = 1, ///< Read-only attribute is a performance hint to the OS; writes may still - ///< succeed without fault. - ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED = 2, ///< Read-only attribute is hardware-enforced; writes to read-only pages - ///< will cause a device fault. - ZE_DEVICE_READONLY_MEMORY_CAPABILITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_READONLY_MEMORY_CAPABILITY_* ENUMs + void* base; ///< [in,out][optional] base address of the sub-allocation + size_t size; ///< [in,out][optional] size of the allocation -} ze_device_readonly_memory_capability_t; +} ze_sub_allocation_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device read-only memory capability properties +/// @brief Sub-Allocations Properties /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t -typedef struct _ze_device_readonly_memory_ext_properties_t +/// - This structure may be passed to ::zeMemGetAllocProperties, via the +/// `pNext` member of ::ze_memory_allocation_properties_t. +typedef struct _ze_memory_sub_allocations_exp_properties_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). - ze_device_readonly_memory_capability_t readonlyCapability; ///< [out] Indicates device behavior when - ///< ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. - ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no - ///< effect; writes succeed normally. - ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a - ///< performance hint; writes may still succeed. - ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is - ///< hardware-enforced; writes cause a device fault. + uint32_t* pCount; ///< [in,out] pointer to the number of sub-allocations. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-allocations on which the allocation has been divided. + ///< if count is greater than the number of sub-allocations, then the + ///< driver shall update the value with the correct number of sub-allocations. + ze_sub_allocation_t* pSubAllocations; ///< [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. + ///< if count is less than the number of sub-allocations available, then + ///< driver shall only retrieve properties for that number of sub-allocations. -} ze_device_readonly_memory_ext_properties_t; +} ze_memory_sub_allocations_exp_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Intel 'oneAPI' Level-Zero Extension for supporting the querying of synchronized event timestamps. #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region eventQueryKernelTimestamps #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CACHE_RESERVATION_EXT_NAME -/// @brief Cache_Reservation Extension Name -#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" -#endif // ZE_CACHE_RESERVATION_EXT_NAME +#ifndef ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME +/// @brief Event Query Kernel Timestamps Extension Name +#define ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME "ZE_extension_event_query_kernel_timestamps" +#endif // ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache_Reservation Extension Version(s) -typedef enum _ze_cache_reservation_ext_version_t +/// @brief Event Query Kernel Timestamps Extension Version(s) +typedef enum _ze_event_query_kernel_timestamps_ext_version_t { - ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_* ENUMs -} ze_cache_reservation_ext_version_t; +} ze_event_query_kernel_timestamps_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache Reservation Region -typedef enum _ze_cache_ext_region_t +/// @brief Event query kernel timestamps flags +typedef uint32_t ze_event_query_kernel_timestamps_ext_flags_t; +typedef enum _ze_event_query_kernel_timestamps_ext_flag_t { - ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use - ///< ::ZE_CACHE_EXT_REGION_DEFAULT. - ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use - ///< ::ZE_CACHE_EXT_REGION_RESERVED. - ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use - ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. - ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme - ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region - ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region - ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL = ZE_BIT(0), ///< Kernel timestamp results + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED = ZE_BIT(1), ///< Device event timestamps synchronized to the host time domain + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_* ENUMs -} ze_cache_ext_region_t; +} ze_event_query_kernel_timestamps_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure +/// @brief Event query kernel timestamps properties /// /// @details -/// - This structure must be passed to ::zeDeviceGetCacheProperties via the -/// `pNext` member of ::ze_device_cache_properties_t -/// - Used for determining the max cache reservation allowed on device. Size -/// of zero means no reservation available. -typedef struct _ze_cache_reservation_ext_desc_t +/// - This structure may be returned from ::zeDeviceGetProperties, via the +/// `pNext` member of ::ze_device_properties_t. +typedef struct _ze_event_query_kernel_timestamps_ext_properties_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 + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - size_t maxCacheReservationSize; ///< [out] max cache reservation size + ze_event_query_kernel_timestamps_ext_flags_t flags; ///< [out] 0 or some combination of + ///< ::ze_event_query_kernel_timestamps_ext_flag_t flags -} ze_cache_reservation_ext_desc_t; +} ze_event_query_kernel_timestamps_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief Kernel timestamp clock data synchronized to the host time domain +typedef struct _ze_synchronized_timestamp_data_ext_t +{ + uint64_t kernelStart; ///< [out] start of kernel execution in nanoseconds, on the host time + ///< domain. + uint64_t kernelEnd; ///< [out] end of kernel execution in nanoseconds, on the host time domain. + +} ze_synchronized_timestamp_data_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Synchronized kernel timestamp result +typedef struct _ze_synchronized_timestamp_result_ext_t +{ + ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data; free running device clock when device was + ///< active,on the host time domain + ze_synchronized_timestamp_data_ext_t context; ///< [out] context specific active data; only includes clocks while context + ///< was actively executing on the device, on the host time domain + +} ze_synchronized_timestamp_result_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event query kernel timestamps results properties +typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_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). + ze_kernel_timestamp_result_t* pKernelTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ///< kernel timestamp results + ze_synchronized_timestamp_result_ext_t* pSynchronizedTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ///< synchronized timestamp results + +} ze_event_query_kernel_timestamps_results_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query an event's timestamp value on the host, with domain preference. /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @remarks -/// _Analogues_ -/// - None +/// - For collecting *only* kernel timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. +/// - For collecting synchronized timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps +/// are also available from this type of event pool, but there is a +/// performance cost. +/// - The destination memory will be unmodified if the event has not been +/// signaled. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13387,730 +12840,622 @@ typedef struct _ze_cache_reservation_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section -/// -/// @details -/// - The application may call this function to assign VA to particular -/// reservartion region -/// -/// @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 == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region +zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. +// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure builder. #if !defined(__GNUC__) -#pragma region eventquerytimestamps +#pragma region RTASBuilder #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// @brief Event Query Timestamps Extension Name -#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" -#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +#ifndef ZE_RTAS_BUILDER_EXP_NAME +/// @brief Ray Tracing Acceleration Structure Builder Extension Name +#define ZE_RTAS_BUILDER_EXP_NAME "ZE_experimental_rtas_builder" +#endif // ZE_RTAS_BUILDER_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Event Query Timestamps Extension Version(s) -typedef enum _ze_event_query_timestamps_exp_version_t +/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +typedef enum _ze_rtas_builder_exp_version_t { - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs + ZE_RTAS_BUILDER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RTAS_BUILDER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs -} ze_event_query_timestamps_exp_version_t; +} ze_rtas_builder_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @brief Ray tracing acceleration structure device flags +typedef uint32_t ze_rtas_device_exp_flags_t; +typedef enum _ze_rtas_device_exp_flag_t +{ + ZE_RTAS_DEVICE_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use + ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs + +} ze_rtas_device_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure format /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// extension. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @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 == hEvent` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. - ); +/// - This is an opaque ray tracing acceleration structure format +/// identifier. +typedef enum _ze_rtas_format_exp_t +{ + ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format + ZE_RTAS_FORMAT_EXP_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXP_* ENUMs -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. -#if !defined(__GNUC__) -#pragma region imagememoryproperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME -/// @brief Image Memory Properties Extension Name -#define ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME "ZE_experimental_image_memory_properties" -#endif // ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME +} ze_rtas_format_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image Memory Properties Extension Version(s) -typedef enum _ze_image_memory_properties_exp_version_t +/// @brief Ray tracing acceleration structure builder flags +typedef uint32_t ze_rtas_builder_exp_flags_t; +typedef enum _ze_rtas_builder_exp_flag_t { - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_* ENUMs + ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs -} ze_image_memory_properties_exp_version_t; +} ze_rtas_builder_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image memory properties -typedef struct _ze_image_memory_properties_exp_t +/// @brief Ray tracing acceleration structure builder parallel operation flags +typedef uint32_t ze_rtas_parallel_operation_exp_flags_t; +typedef enum _ze_rtas_parallel_operation_exp_flag_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). - uint64_t size; ///< [out] size of image allocation in bytes. - uint64_t rowPitch; ///< [out] size of image row in bytes. - uint64_t slicePitch; ///< [out] size of image slice in bytes. + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs -} ze_image_memory_properties_exp_t; +} ze_rtas_parallel_operation_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 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. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @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` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. - ); +/// @brief Ray tracing acceleration structure builder geometry flags +typedef uint32_t ze_rtas_builder_geometry_exp_flags_t; +typedef enum _ze_rtas_builder_geometry_exp_flag_t +{ + ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader + ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_* ENUMs + +} ze_rtas_builder_geometry_exp_flag_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image views. -#if !defined(__GNUC__) -#pragma region imageview -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_EXT_NAME -/// @brief Image View Extension Name -#define ZE_IMAGE_VIEW_EXT_NAME "ZE_extension_image_view" -#endif // ZE_IMAGE_VIEW_EXT_NAME +/// @brief Packed ray tracing acceleration structure builder geometry flags (see +/// ::ze_rtas_builder_geometry_exp_flags_t) +typedef uint8_t ze_rtas_builder_packed_geometry_exp_flags_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Extension Version(s) -typedef enum _ze_image_view_ext_version_t +/// @brief Ray tracing acceleration structure builder instance flags +typedef uint32_t ze_rtas_builder_instance_exp_flags_t; +typedef enum _ze_rtas_builder_instance_exp_flag_t { - ZE_IMAGE_VIEW_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to + ///< be non-opaque + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it + ///< to be opaque + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs -} ze_image_view_ext_version_t; +} ze_rtas_builder_instance_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Packed ray tracing acceleration structure builder instance flags (see +/// ::ze_rtas_builder_instance_exp_flags_t) +typedef uint8_t ze_rtas_builder_packed_instance_exp_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build operation flags /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_IMAGE_VIEW_EXT_NAME extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @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 == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT -ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view - ); +/// - These flags allow the application to tune the acceleration structure +/// build operation. +/// - The acceleration structure builder implementation might choose to use +/// spatial splitting to split large or long primitives into smaller +/// pieces. This may result in any-hit shaders being invoked multiple +/// times for non-opaque primitives, unless +/// ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +/// - Usage of any of these flags may reduce ray tracing performance. +typedef uint32_t ze_rtas_builder_build_op_exp_flags_t; +typedef enum _ze_rtas_builder_build_op_exp_flag_t +{ + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_* ENUMs + +} ze_rtas_builder_build_op_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_EXP_NAME -/// @brief Image View Extension Name -#define ZE_IMAGE_VIEW_EXP_NAME "ZE_experimental_image_view" -#endif // ZE_IMAGE_VIEW_EXP_NAME +/// @brief Ray tracing acceleration structure builder build quality hint +/// +/// @details +/// - Depending on use case different quality modes for acceleration +/// structure build are supported. +/// - A low-quality build builds an acceleration structure fast, but at the +/// cost of some reduction in ray tracing performance. This mode is +/// recommended for dynamic content, such as animated characters. +/// - A medium-quality build uses a compromise between build quality and ray +/// tracing performance. This mode should be used by default. +/// - Higher ray tracing performance can be achieved by using a high-quality +/// build, but acceleration structure build performance might be +/// significantly reduced. +typedef enum _ze_rtas_builder_build_quality_hint_exp_t +{ + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW = 0, ///< build low-quality acceleration structure (fast) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH = 2, ///< build high-quality acceleration structure (slow) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_* ENUMs + +} ze_rtas_builder_build_quality_hint_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Extension Version(s) -typedef enum _ze_image_view_exp_version_t +/// @brief Ray tracing acceleration structure builder geometry type +typedef enum _ze_rtas_builder_geometry_type_exp_t { - ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES = 0, ///< triangle mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS = 1, ///< quad mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL = 2, ///< procedural geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE = 3, ///< instance geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs -} ze_image_view_exp_version_t; +} ze_rtas_builder_geometry_type_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Packed ray tracing acceleration structure builder geometry type (see +/// ::ze_rtas_builder_geometry_type_exp_t) +typedef uint8_t ze_rtas_builder_packed_geometry_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure data buffer element format /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_IMAGE_VIEW_EXP_NAME extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// - Note: This function is deprecated and replaced by -/// ::zeImageViewCreateExt. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @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 == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT -ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view - ); +/// - Specifies the format of data buffer elements. +/// - Data buffers may contain instancing transform matrices, triangle/quad +/// vertex indices, etc... +typedef enum _ze_rtas_builder_input_data_format_exp_t +{ + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_column_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see + ///< ::ze_rtas_transform_float3x4_row_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see + ///< ::ze_rtas_triangle_indices_uint32_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_* ENUMs + +} ze_rtas_builder_input_data_format_exp_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image views for planar images. -#if !defined(__GNUC__) -#pragma region imageviewplanar -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_PLANAR_EXT_NAME -/// @brief Image View Planar Extension Name -#define ZE_IMAGE_VIEW_PLANAR_EXT_NAME "ZE_extension_image_view_planar" -#endif // ZE_IMAGE_VIEW_PLANAR_EXT_NAME +/// @brief Packed ray tracing acceleration structure data buffer element format +/// (see ::ze_rtas_builder_input_data_format_exp_t) +typedef uint8_t ze_rtas_builder_packed_input_data_format_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Planar Extension Version(s) -typedef enum _ze_image_view_planar_ext_version_t -{ - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs +/// @brief Handle of ray tracing acceleration structure builder object +typedef struct _ze_rtas_builder_exp_handle_t *ze_rtas_builder_exp_handle_t; -} ze_image_view_planar_ext_version_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder parallel +/// operation object +typedef struct _ze_rtas_parallel_operation_exp_handle_t *ze_rtas_parallel_operation_exp_handle_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image view planar descriptor -typedef struct _ze_image_view_planar_ext_desc_t +/// @brief Ray tracing acceleration structure builder descriptor +typedef struct _ze_rtas_builder_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 planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) - -} ze_image_view_planar_ext_desc_t; + ze_rtas_builder_exp_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_PLANAR_EXP_NAME -/// @brief Image View Planar Extension Name -#define ZE_IMAGE_VIEW_PLANAR_EXP_NAME "ZE_experimental_image_view_planar" -#endif // ZE_IMAGE_VIEW_PLANAR_EXP_NAME +} ze_rtas_builder_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Planar Extension Version(s) -typedef enum _ze_image_view_planar_exp_version_t +/// @brief Ray tracing acceleration structure builder properties +typedef struct _ze_rtas_builder_exp_properties_t { - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs + 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). + ze_rtas_builder_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder flags + size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is expected to succeed; however, it is possible that the build + ///< may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY + size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is guaranteed to not run out of memory. + size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration + ///< structure build. -} ze_image_view_planar_exp_version_t; +} ze_rtas_builder_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image view planar descriptor -typedef struct _ze_image_view_planar_exp_desc_t +/// @brief Ray tracing acceleration structure builder parallel operation +/// properties +typedef struct _ze_rtas_parallel_operation_exp_properties_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 + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t planeIndex; ///< [DEPRECATED] no longer supported, use - ///< ::ze_image_view_planar_ext_desc_t instead + ze_rtas_parallel_operation_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation + ///< flags + uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation -} ze_image_view_planar_exp_desc_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for specifying kernel scheduling hints. -#if !defined(__GNUC__) -#pragma region kernelSchedulingHints -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME -/// @brief Kernel Scheduling Hints Extension Name -#define ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME "ZE_experimental_scheduling_hints" -#endif // ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME +} ze_rtas_parallel_operation_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel Scheduling Hints Extension Version(s) -typedef enum _ze_scheduling_hints_exp_version_t +/// @brief Ray tracing acceleration structure device properties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +/// member of ::ze_device_properties_t. +/// - The implementation shall populate `format` with a value other than +/// ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. +typedef struct _ze_rtas_device_exp_properties_t { - ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs + 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). + ze_rtas_device_exp_flags_t flags; ///< [out] ray tracing acceleration structure device flags + ze_rtas_format_exp_t rtasFormat; ///< [out] ray tracing acceleration structure format + uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer -} ze_scheduling_hints_exp_version_t; +} ze_rtas_device_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported kernel scheduling hint flags -typedef uint32_t ze_scheduling_hint_exp_flags_t; -typedef enum _ze_scheduling_hint_exp_flag_t +/// @brief A 3-component vector type +typedef struct _ze_rtas_float3_exp_t { - ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1), ///< Hint that the kernel prefers round-robin scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2), ///< Hint that the kernel prefers stall-based round-robin scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs + float x; ///< [in] x-coordinate of float3 vector + float y; ///< [in] y-coordinate of float3 vector + float z; ///< [in] z-coordinate of float3 vector -} ze_scheduling_hint_exp_flag_t; +} ze_rtas_float3_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device kernel scheduling hint properties queried using -/// ::zeDeviceGetModuleProperties +/// @brief 3x4 affine transformation in column-major layout /// /// @details -/// - This structure may be returned from ::zeDeviceGetModuleProperties, via -/// the `pNext` member of ::ze_device_module_properties_t. -typedef struct _ze_scheduling_hint_exp_properties_t +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_column_major_exp_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). - ze_scheduling_hint_exp_flags_t schedulingHintFlags; ///< [out] Supported kernel scheduling hints. - ///< May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix -} ze_scheduling_hint_exp_properties_t; +} ze_rtas_transform_float3x4_column_major_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel scheduling hint descriptor +/// @brief 3x4 affine transformation in column-major layout with aligned column +/// vectors /// /// @details -/// - This structure may be passed to ::zeKernelSchedulingHintExp. -typedef struct _ze_scheduling_hint_exp_desc_t +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +/// - The column vectors are aligned to 16-bytes and pad members are +/// ignored. +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_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_scheduling_hint_exp_flags_t flags; ///< [in] flags specifying kernel scheduling hints. - ///< must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float pad0; ///< [in] ignored padding + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float pad1; ///< [in] ignored padding + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float pad2; ///< [in] ignored padding + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + float pad3; ///< [in] ignored padding -} ze_scheduling_hint_exp_desc_t; +} ze_rtas_transform_float3x4_aligned_column_major_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Provide kernel scheduling hints that may improve performance +/// @brief 3x4 affine transformation in row-major layout /// /// @details -/// - The scheduling hints may improve performance only and are not required -/// for correctness. -/// - If a specified scheduling hint is unsupported it will be silently -/// ignored. -/// - If two conflicting scheduling hints are specified there is no defined behavior; -/// the hints may be ignored or one hint may be chosen arbitrarily. -/// - The application must not call this function from simultaneous threads -/// with the same kernel handle. -/// - 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 == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pHint` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pHint->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -ZE_APIEXPORT ze_result_t ZE_APICALL -zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor - ); - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for One-Definition-Rule Linkage Types -#if !defined(__GNUC__) -#pragma region linkonceodr -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_LINKONCE_ODR_EXT_NAME -/// @brief Linkonce ODR Extension Name -#define ZE_LINKONCE_ODR_EXT_NAME "ZE_extension_linkonce_odr" -#endif // ZE_LINKONCE_ODR_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Linkonce ODR Extension Version(s) -typedef enum _ze_linkonce_odr_ext_version_t +/// - A 3x4 affine transformation in row-major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_row_major_exp_t { - ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs - -} ze_linkonce_odr_ext_version_t; + float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix + float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix + float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix + float p_x; ///< [in] element 3 of row 0 of 3x4 matrix + float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix + float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix + float p_y; ///< [in] element 3 of row 1 of 3x4 matrix + float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix + float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix + float p_z; ///< [in] element 3 of row 2 of 3x4 matrix -#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 +} ze_rtas_transform_float3x4_row_major_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Power Saving Hint Extension Version(s) -typedef enum _ze_power_saving_hint_exp_version_t +/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +/// in each dimension +typedef struct _ze_rtas_aabb_exp_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_rtas_float3_exp_t lower; ///< [in] lower bounds of AABB + ze_rtas_float3_exp_t upper; ///< [in] upper bounds of AABB -} ze_power_saving_hint_exp_version_t; +} ze_rtas_aabb_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device types -typedef enum _ze_power_saving_hint_type_t +/// @brief Triangle represented using 3 vertex indices +/// +/// @details +/// - Represents a triangle using 3 vertex indices that index into a vertex +/// array that needs to be provided together with the index array. +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_triangle_indices_uint32_exp_t { - ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minumum 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 + uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex + ///< array + uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array -} ze_power_saving_hint_type_t; +} ze_rtas_triangle_indices_uint32_exp_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; +/// @brief Quad represented using 4 vertex indices +/// +/// @details +/// - Represents a quad composed of 4 indices that index into a vertex array +/// that needs to be provided together with the index array. +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_quad_indices_uint32_exp_t +{ + uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array + uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array + uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Subgroups -#if !defined(__GNUC__) -#pragma region subgroups -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SUBGROUPS_EXT_NAME -/// @brief Subgroups Extension Name -#define ZE_SUBGROUPS_EXT_NAME "ZE_extension_subgroups" -#endif // ZE_SUBGROUPS_EXT_NAME +} ze_rtas_quad_indices_uint32_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Subgroups Extension Version(s) -typedef enum _ze_subgroup_ext_version_t +/// @brief Ray tracing acceleration structure builder geometry info +typedef struct _ze_rtas_builder_geometry_info_exp_t { - ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs - -} ze_subgroup_ext_version_t; + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for EU Count -#if !defined(__GNUC__) -#pragma region EUCount -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EU_COUNT_EXT_NAME -/// @brief EU Count Extension Name -#define ZE_EU_COUNT_EXT_NAME "ZE_extension_eu_count" -#endif // ZE_EU_COUNT_EXT_NAME +} ze_rtas_builder_geometry_info_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief EU Count Extension Version(s) -typedef enum _ze_eu_count_ext_version_t +/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// +/// @details +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t { - ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t triangleFormat; ///< [in] format of triangle buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + uint32_t triangleCount; ///< [in] number of triangles in triangle buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format -} ze_eu_count_ext_version_t; +} ze_rtas_builder_triangles_geometry_info_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief EU count queried using ::zeDeviceGetProperties +/// @brief Ray tracing acceleration structure builder quad mesh geometry info /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t. -/// - Used for determining the total number of EUs available on device. -typedef struct _ze_eu_count_ext_t +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_builder_quads_geometry_info_exp_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 numTotalEUs; ///< [out] Total number of EUs available - -} ze_eu_count_ext_t; + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t quadFormat; ///< [in] format of quad buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + uint32_t quadCount; ///< [in] number of quads in quad buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for PCI Properties -#if !defined(__GNUC__) -#pragma region PCIProperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_PCI_PROPERTIES_EXT_NAME -/// @brief PCI Properties Extension Name -#define ZE_PCI_PROPERTIES_EXT_NAME "ZE_extension_pci_properties" -#endif // ZE_PCI_PROPERTIES_EXT_NAME +} ze_rtas_builder_quads_geometry_info_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief PCI Properties Extension Version(s) -typedef enum _ze_pci_properties_ext_version_t +/// @brief AABB callback function parameters +typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t { - ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs + 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 primID; ///< [in] first primitive to return bounds for + uint32_t primIDCount; ///< [in] number of primitives to return bounds for + void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor + void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExp function + ze_rtas_aabb_exp_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to -} ze_pci_properties_ext_version_t; +} ze_rtas_geometry_aabbs_exp_cb_params_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device PCI address +/// @brief Callback function pointer type to return AABBs for a range of +/// procedural primitives +typedef void (*ze_rtas_geometry_aabbs_cb_exp_t)( + ze_rtas_geometry_aabbs_exp_cb_params_t* params ///< [in] callback function parameters structure + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder procedural primitives +/// geometry info /// /// @details -/// - This structure may be passed to ::zeDevicePciGetPropertiesExt as an -/// attribute of ::ze_pci_ext_properties_t. -/// - A PCI BDF address is the bus:device:function address of the device and -/// is useful for locating the device in the PCI switch fabric. -typedef struct _ze_pci_address_ext_t +/// - A host-side bounds callback function is invoked by the acceleration +/// structure builder to query the bounds of procedural primitives on +/// demand. The callback is passed some `pGeomUserPtr` that can point to +/// an application-side representation of the procedural primitives. +/// Further, a second `pBuildUserPtr`, which is set by a parameter to +/// ::zeRTASBuilderBuildExp, is passed to the callback. This allows the +/// build to change the bounds of the procedural geometry, for example, to +/// build a BVH only over a short time range to implement multi-segment +/// motion blur. +typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t { - uint32_t domain; ///< [out] PCI domain number - uint32_t bus; ///< [out] PCI BDF bus number - uint32_t device; ///< [out] PCI BDF device number - uint32_t function; ///< [out] PCI BDF function number + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + uint8_t reserved; ///< [in] reserved for future use + uint32_t primCount; ///< [in] number of primitives in geometry + ze_rtas_geometry_aabbs_cb_exp_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box + ///< for a range of primitives + void* pGeomUserPtr; ///< [in] user data pointer passed to callback -} ze_pci_address_ext_t; +} ze_rtas_builder_procedural_geometry_info_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device PCI speed -typedef struct _ze_pci_speed_ext_t +/// @brief Ray tracing acceleration structure builder instance geometry info +typedef struct _ze_rtas_builder_instance_geometry_info_exp_t { - int32_t genVersion; ///< [out] The link generation. A value of -1 means that this property is - ///< unknown. - int32_t width; ///< [out] The number of lanes. A value of -1 means that this property is - ///< unknown. - int64_t maxBandwidth; ///< [out] The theoretical maximum bandwidth in bytes/sec (sum of all - ///< lanes). A value of -1 means that this property is unknown. + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE + ze_rtas_builder_packed_instance_exp_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation + uint32_t instanceUserID; ///< [in] user-specified identifier for the instance + void* pTransform; ///< [in] object-to-world instance transformation in specified format + ze_rtas_aabb_exp_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced + ///< acceleration structure + void* pAccelerationStructure; ///< [in] pointer to acceleration structure to instantiate -} ze_pci_speed_ext_t; +} ze_rtas_builder_instance_geometry_info_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Static PCI properties -typedef struct _ze_pci_ext_properties_t +/// @brief +typedef struct _ze_rtas_builder_build_op_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_pci_address_ext_t address; ///< [out] The BDF address - ze_pci_speed_ext_t maxSpeed; ///< [out] Fastest port configuration supported by the device (sum of all - ///< lanes) + ze_rtas_format_exp_t rtasFormat; ///< [in] ray tracing acceleration structure format + ze_rtas_builder_build_quality_hint_exp_t buildQuality; ///< [in] acceleration structure build quality hint + ze_rtas_builder_build_op_exp_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t + ///< flags + const ze_rtas_builder_geometry_info_exp_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ///< pointers to geometry infos + uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when + ///< `ppGeometries` is NULL -} ze_pci_ext_properties_t; +} ze_rtas_builder_build_op_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Get PCI properties - address, max speed +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details /// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14127,109 +13472,26 @@ typedef struct _ze_pci_ext_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pPciProperties` +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. +zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for sRGB -#if !defined(__GNUC__) -#pragma region SRGB -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SRGB_EXT_NAME -/// @brief sRGB Extension Name -#define ZE_SRGB_EXT_NAME "ZE_extension_srgb" -#endif // ZE_SRGB_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief sRGB Extension Version(s) -typedef enum _ze_srgb_ext_version_t -{ - ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs - -} ze_srgb_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief sRGB image descriptor -/// -/// @details -/// - This structure may be passed to ::zeImageCreate via the `pNext` member -/// of ::ze_image_desc_t -/// - Used for specifying that the image is in sRGB format. -typedef struct _ze_srgb_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_bool_t sRGB; ///< [in] Is sRGB. - -} ze_srgb_ext_desc_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Image Copy To/From Memory -#if !defined(__GNUC__) -#pragma region imageCopy -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_COPY_EXT_NAME -/// @brief Image Copy Extension Name -#define ZE_IMAGE_COPY_EXT_NAME "ZE_extension_image_copy" -#endif // ZE_IMAGE_COPY_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image Copy Extension Version(s) -typedef enum _ze_image_copy_ext_version_t -{ - ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs - -} ze_image_copy_ext_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies from an image to device or shared memory. +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - The application must ensure the memory pointed to by dstptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the source -/// image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, 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. -/// -/// @remarks -/// _Analogues_ -/// - clEnqueueReadImage +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14246,65 +13508,30 @@ typedef enum _ze_image_copy_ext_version_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hSrcImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies to an image from device or shared memory. +/// @brief Checks ray tracing acceleration structure format compatibility /// /// @details -/// - The application must ensure the memory pointed to by srcptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by srcptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the -/// destination image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, 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. -/// -/// @remarks -/// _Analogues_ -/// - clEnqueueWriteImage +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -14318,79 +13545,80 @@ zeCommandListAppendImageCopyToMemoryExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for Querying Image Allocation Properties. -#if !defined(__GNUC__) -#pragma region imageQueryAllocProperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME -/// @brief Image Query Allocation Properties Extension Name -#define ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME "ZE_extension_image_query_alloc_properties" -#endif // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image Query Allocation Properties Extension Version(s) -typedef enum _ze_image_query_alloc_properties_ext_version_t -{ - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_* ENUMs - -} ze_image_query_alloc_properties_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image allocation properties queried using -/// ::zeImageGetAllocPropertiesExt -typedef struct _ze_image_allocation_ext_properties_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). - uint64_t id; ///< [out] identifier for this allocation - -} ze_image_allocation_ext_properties_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves attributes of an image allocation +/// @brief Build ray tracing acceleration structure /// /// @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 +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - It is the user's responsibility to manage the acceleration structure +/// buffer allocation, de-allocation, and potential prefetching to the +/// device memory. The required size of the acceleration structure buffer +/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. +/// The acceleration structure buffer must be a shared USM allocation and +/// should be present on the host at build time. The referenced scene data +/// (index- and vertex- buffers) can be standard host allocations, and +/// will not be referenced into by the build acceleration structure. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes based on a query for the estimated size properties. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. +/// - When using the "expected" size for the acceleration structure buffer, +/// the acceleration structure construction may fail with +/// ::ZE_RESULT_EXP_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. +/// - 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. +/// - All provided data buffers must be host-accessible. +/// - The acceleration structure buffer must be a USM allocation. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - Acceleration structure construction may be parallelized by passing a +/// valid handle to a parallel operation object and joining that parallel +/// operation using ::zeRTASParallelOperationJoinExp with user-provided +/// worker threads. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." +/// +/// @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 @@ -14398,77 +13626,79 @@ typedef struct _ze_image_allocation_ext_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pImageAllocProperties` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties +zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Linkage Inspection -#if !defined(__GNUC__) -#pragma region linkageInspection -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_LINKAGE_INSPECTION_EXT_NAME -/// @brief Linkage Inspection Extension Name -#define ZE_LINKAGE_INSPECTION_EXT_NAME "ZE_extension_linkage_inspection" -#endif // ZE_LINKAGE_INSPECTION_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Linkage Inspection Extension Version(s) -typedef enum _ze_linkage_inspection_ext_version_t -{ - ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs - -} ze_linkage_inspection_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported module linkage inspection flags -typedef uint32_t ze_linkage_inspection_ext_flags_t; -typedef enum _ze_linkage_inspection_ext_flag_t -{ - ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules - ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1), ///< List all imports of modules that do not have a corresponding export - ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules - ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs - -} ze_linkage_inspection_ext_flag_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Module linkage inspection descriptor +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @details -/// - This structure may be passed to ::zeModuleInspectLinkageExt. -typedef struct _ze_linkage_inspection_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_linkage_inspection_ext_flags_t flags; ///< [in] flags specifying module linkage inspection. - ///< must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. - -} ze_linkage_inspection_ext_desc_t; +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief List Imports & Exports +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - List all the import & unresolveable import dependencies & exports of a -/// set of modules -/// -/// @remarks -/// _Analogues_ -/// - None +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14484,160 +13714,91 @@ typedef struct _ze_linkage_inspection_ext_desc_t /// - ::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 == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pInspectDesc` -/// + `nullptr == phModules` -/// + `nullptr == phLog` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pInspectDesc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phParallelOperation` ZE_APIEXPORT ze_result_t ZE_APICALL -zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. +zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ///< [out] handle of parallel operation object ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting memory compression hints. -#if !defined(__GNUC__) -#pragma region memoryCompressionHints -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME -/// @brief Memory Compression Hints Extension Name -#define ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME "ZE_extension_memory_compression_hints" -#endif // ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Memory Compression Hints Extension Version(s) -typedef enum _ze_memory_compression_hints_ext_version_t -{ - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_* ENUMs - -} ze_memory_compression_hints_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported memory compression hints flags -typedef uint32_t ze_memory_compression_hints_ext_flags_t; -typedef enum _ze_memory_compression_hints_ext_flag_t -{ - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0), ///< Hint Driver implementation to make allocation compressible - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_* ENUMs - -} ze_memory_compression_hints_ext_flag_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Compression hints memory allocation descriptor +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties /// /// @details -/// - This structure may be passed to ::zeMemAllocShared or -/// ::zeMemAllocDevice, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t. -/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` -/// member of ::ze_host_mem_alloc_desc_t. -/// - This structure may be passed to ::zeImageCreate, via the `pNext` -/// member of ::ze_image_desc_t. -typedef struct _ze_memory_compression_hints_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_memory_compression_hints_ext_flags_t flags; ///< [in] flags specifying if allocation should be compressible or not. - ///< Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; - -} ze_memory_compression_hints_ext_desc_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Memory Free Policies -#if !defined(__GNUC__) -#pragma region memoryFreePolicies -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MEMORY_FREE_POLICIES_EXT_NAME -/// @brief Memory Free Policies Extension Name -#define ZE_MEMORY_FREE_POLICIES_EXT_NAME "ZE_extension_memory_free_policies" -#endif // ZE_MEMORY_FREE_POLICIES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Memory Free Policies Extension Version(s) -typedef enum _ze_memory_free_policies_ext_version_t -{ - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_FREE_POLICIES_EXT_VERSION_* ENUMs - -} ze_memory_free_policies_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported memory free policy capability flags -typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; -typedef enum _ze_driver_memory_free_policy_ext_flag_t -{ - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< Blocks until all commands using the memory are complete before - ///< scheduling memory to be freed. Does not guarantee memory is freed upon - ///< return, only that it is safe and is scheduled to be freed. Actual - ///< freeing of memory is specific to user mode driver and kernel mode - ///< driver implementation and may be done asynchronously. - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< Immediately schedules the memory to be freed and returns without - ///< blocking. Memory may be freed after all commands using the memory are - ///< complete. Actual freeing of memory is specific to user mode driver and - ///< kernel mode driver implementation and may be done asynchronously. - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_* ENUMs - -} ze_driver_memory_free_policy_ext_flag_t; +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties ///< [in,out] query result for parallel operation properties + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Driver memory free properties queried using ::zeDriverGetProperties +/// @brief Joins a parallel build operation /// /// @details -/// - All drivers must support an immediate free policy, which is the -/// default free policy. -/// - This structure may be returned from ::zeDriverGetProperties, via the -/// `pNext` member of ::ze_driver_properties_t. -typedef struct _ze_driver_memory_free_ext_properties_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). - ze_driver_memory_free_policy_ext_flags_t freePolicies; ///< [out] Supported memory free policies. - ///< must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. - -} ze_driver_memory_free_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Memory free descriptor with free policy -typedef struct _ze_memory_free_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_driver_memory_free_policy_ext_flags_t freePolicy; ///< [in] flags specifying the memory free policy. - ///< must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; - ///< default behavior is to free immediately. - -} ze_memory_free_ext_desc_t; +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion +/// +/// @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 == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory on the -/// context using the specified free policy. +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object /// /// @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. +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. /// - The application must **not** call this function from simultaneous -/// threads with the same pointer. +/// threads with the same parallel operation handle. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -14655,306 +13816,177 @@ typedef struct _ze_memory_free_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemFreeDesc` -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < pMemFreeDesc->freePolicy` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hParallelOperation` ZE_APIEXPORT ze_result_t ZE_APICALL -zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free +zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Bandwidth +// Intel 'oneAPI' Level-Zero Extension APIs for Counter-based Event Pools. @deprecated since 1.15 #if !defined(__GNUC__) -#pragma region bandwidth +#pragma region counterbasedeventpool #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_BANDWIDTH_PROPERTIES_EXP_NAME -/// @brief Bandwidth Extension Name -#define ZE_BANDWIDTH_PROPERTIES_EXP_NAME "ZE_experimental_bandwidth_properties" -#endif // ZE_BANDWIDTH_PROPERTIES_EXP_NAME +#ifndef ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME +/// @brief Counter-based Event Pools Extension Name +#define ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME "ZE_experimental_event_pool_counter_based" +#endif // ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Bandwidth Extension Version(s) -typedef enum _ze_bandwidth_properties_exp_version_t +/// @brief Counter-based Event Pools Extension Version(s) +typedef enum _ze_event_pool_counter_based_exp_version_t { - ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_* ENUMs + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_* ENUMs -} ze_bandwidth_properties_exp_version_t; +} ze_event_pool_counter_based_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief P2P Bandwidth Properties -/// -/// @details -/// - This structure may be passed to ::zeDeviceGetP2PProperties by having -/// the pNext member of ::ze_device_p2p_properties_t point at this struct. -typedef struct _ze_device_p2p_bandwidth_exp_properties_t +/// @brief Supported event flags for defining counter-based event pools. +typedef uint32_t ze_event_pool_counter_based_exp_flags_t; +typedef enum _ze_event_pool_counter_based_exp_flag_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 logicalBandwidth; ///< [out] total logical design bandwidth for all links connecting the two - ///< devices - uint32_t physicalBandwidth; ///< [out] total physical design bandwidth for all links connecting the two - ///< devices - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit - uint32_t logicalLatency; ///< [out] average logical design latency for all links connecting the two - ///< devices - uint32_t physicalLatency; ///< [out] average physical design latency for all links connecting the two - ///< devices - ze_latency_unit_t latencyUnit; ///< [out] latency unit + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE = ZE_BIT(0), ///< Counter-based event pool is used for immediate command lists (default) + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE = ZE_BIT(1), ///< Counter-based event pool is for non-immediate command lists + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_* ENUMs -} ze_device_p2p_bandwidth_exp_properties_t; +} ze_event_pool_counter_based_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Copy Bandwidth Properties -/// -/// @details -/// - This structure may be passed to -/// ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of -/// ::ze_command_queue_group_properties_t point at this struct. -/// - [DEPRECATED] -typedef struct _ze_copy_bandwidth_exp_properties_t +/// @brief Event pool descriptor for counter-based events. This structure may be +/// passed to ::zeEventPoolCreate as pNext member of +/// ::ze_event_pool_desc_t. @deprecated since 1.15 +typedef struct _ze_event_pool_counter_based_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t copyBandwidth; ///< [out] design bandwidth supported by this engine type for copy - ///< operations - ze_bandwidth_unit_t copyBandwidthUnit; ///< [out] copy bandwidth unit + ze_event_pool_counter_based_exp_flags_t flags; ///< [in] mode flags. + ///< must be 0 (default) or a valid value of ::ze_event_pool_counter_based_exp_flag_t + ///< default behavior is counter-based event pool is only used for + ///< immediate command lists. -} ze_copy_bandwidth_exp_properties_t; +} ze_event_pool_counter_based_exp_desc_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device Local Identifier (LUID) +// Intel 'oneAPI' Level-Zero Extension for supporting bindless images. #if !defined(__GNUC__) -#pragma region deviceLUID +#pragma region bindlessimages #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_LUID_EXT_NAME -/// @brief Device Local Identifier (LUID) Extension Name -#define ZE_DEVICE_LUID_EXT_NAME "ZE_extension_device_luid" -#endif // ZE_DEVICE_LUID_EXT_NAME +#ifndef ZE_BINDLESS_IMAGE_EXP_NAME +/// @brief Image Memory Properties Extension Name +#define ZE_BINDLESS_IMAGE_EXP_NAME "ZE_experimental_bindless_image" +#endif // ZE_BINDLESS_IMAGE_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Local Identifier (LUID) Extension Version(s) -typedef enum _ze_device_luid_ext_version_t +/// @brief Bindless Image Extension Version(s) +typedef enum _ze_bindless_image_exp_version_t { - ZE_DEVICE_LUID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_LUID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs + ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs -} ze_device_luid_ext_version_t; +} ze_bindless_image_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MAX_DEVICE_LUID_SIZE_EXT -/// @brief Maximum device local identifier (LUID) size in bytes -#define ZE_MAX_DEVICE_LUID_SIZE_EXT 8 -#endif // ZE_MAX_DEVICE_LUID_SIZE_EXT +/// @brief Image flags for Bindless images +typedef uint32_t ze_image_bindless_exp_flags_t; +typedef enum _ze_image_bindless_exp_flag_t +{ + ZE_IMAGE_BINDLESS_EXP_FLAG_BINDLESS = ZE_BIT(0), ///< Bindless images are created with ::zeImageCreate. The image handle + ///< created with this flag is valid on both host and device. + ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE = ZE_BIT(1), ///< Bindless sampled images are created with ::zeImageCreate by combining + ///< BINDLESS and SAMPLED_IMAGE. + ///< Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. + ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs + +} ze_image_bindless_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device local identifier (LUID) -typedef struct _ze_device_luid_ext_t -{ - uint8_t id[ZE_MAX_DEVICE_LUID_SIZE_EXT]; ///< [out] opaque data representing a device LUID - -} ze_device_luid_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Device LUID properties queried using ::zeDeviceGetProperties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetProperties, via the -/// `pNext` member of ::ze_device_properties_t. -typedef struct _ze_device_luid_ext_properties_t +/// @brief Image descriptor for bindless images. This structure may be passed to +/// ::zeImageCreate via pNext member of ::ze_image_desc_t. +typedef struct _ze_image_bindless_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_device_luid_ext_t luid; ///< [out] locally unique identifier (LUID). - ///< The returned LUID can be cast to a LUID object and must be equal to - ///< the locally - ///< unique identifier of an IDXGIAdapter1 object that corresponds to the device. - uint32_t nodeMask; ///< [out] node mask. - ///< The returned node mask must contain exactly one bit. - ///< If the device is running on an operating system that supports the - ///< Direct3D 12 API - ///< and the device corresponds to an individual device in a linked device - ///< adapter, the - ///< returned node mask identifies the Direct3D 12 node corresponding to - ///< the device. - ///< Otherwise, the returned node mask must be 1. - -} ze_device_luid_ext_properties_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Fabric Topology Discovery -#if !defined(__GNUC__) -#pragma region fabric -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_FABRIC_EXP_NAME -/// @brief Fabric Topology Discovery Extension Name -#define ZE_FABRIC_EXP_NAME "ZE_experimental_fabric" -#endif // ZE_FABRIC_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Topology Discovery Extension Version(s) -typedef enum _ze_fabric_exp_version_t -{ - ZE_FABRIC_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_FABRIC_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FABRIC_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EXP_VERSION_* ENUMs - -} ze_fabric_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE -/// @brief Maximum fabric edge model string size -#define ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE 256 -#endif // ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Vertex types -typedef enum _ze_fabric_vertex_exp_type_t -{ - ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN = 0, ///< Fabric vertex type is unknown - ZE_FABRIC_VERTEX_EXP_TYPE_DEVICE = 1, ///< Fabric vertex represents a device - ZE_FABRIC_VERTEX_EXP_TYPE_SUBDEVICE = 2, ///< Fabric vertex represents a subdevice - ZE_FABRIC_VERTEX_EXP_TYPE_SWITCH = 3, ///< Fabric vertex represents a switch - ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs + ze_image_bindless_exp_flags_t flags; ///< [in] image flags. + ///< must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t + ///< default behavior is bindless images are not used when creating handles + ///< via ::zeImageCreate. + ///< When the flag is passed to ::zeImageCreate, then only the memory for + ///< the image is allocated. + ///< Additional image handles can be created with ::zeImageViewCreateExt. + ///< When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, + ///< ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t. -} ze_fabric_vertex_exp_type_t; +} ze_image_bindless_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric edge duplexity -typedef enum _ze_fabric_edge_exp_duplexity_t +/// @brief Image descriptor for bindless images created from pitched allocations. +/// This structure may be passed to ::zeImageCreate via pNext member of +/// ::ze_image_desc_t. +typedef struct _ze_image_pitched_exp_desc_t { - ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN = 0, ///< Fabric edge duplexity is unknown - ZE_FABRIC_EDGE_EXP_DUPLEXITY_HALF_DUPLEX = 1, ///< Fabric edge is half duplex, i.e. stated bandwidth is obtained in only - ///< one direction at time - ZE_FABRIC_EDGE_EXP_DUPLEXITY_FULL_DUPLEX = 2, ///< Fabric edge is full duplex, i.e. stated bandwidth is supported in both - ///< directions simultaneously - ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs + 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). + void* ptr; ///< [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice -} ze_fabric_edge_exp_duplexity_t; +} ze_image_pitched_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief PCI address +/// @brief Device specific properties for pitched allocations /// /// @details -/// - A PCI BDF address is the bus:device:function address of the device and -/// is useful for locating the device in the PCI switch fabric. -typedef struct _ze_fabric_vertex_pci_exp_address_t -{ - uint32_t domain; ///< [out] PCI domain number - uint32_t bus; ///< [out] PCI BDF bus number - uint32_t device; ///< [out] PCI BDF device number - uint32_t function; ///< [out] PCI BDF function number - -} ze_fabric_vertex_pci_exp_address_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Vertex properties -typedef struct _ze_fabric_vertex_exp_properties_t +/// - This structure may be passed to ::zeDeviceGetImageProperties via the +/// pNext member of ::ze_device_image_properties_t. +typedef struct _ze_device_pitched_alloc_exp_properties_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). - ze_uuid_t uuid; ///< [out] universal unique identifier. If the vertex is co-located with a - ///< device/subdevice, then this uuid will match that of the corresponding - ///< device/subdevice - ze_fabric_vertex_exp_type_t type; ///< [out] does the fabric vertex represent a device, subdevice, or switch? - ze_bool_t remote; ///< [out] does the fabric vertex live on the local node or on a remote - ///< node? - ze_fabric_vertex_pci_exp_address_t address; ///< [out] B/D/F address of fabric vertex & associated device/subdevice if - ///< available + size_t maxImageLinearWidth; ///< [out] Maximum image linear width. + size_t maxImageLinearHeight; ///< [out] Maximum image linear height. -} ze_fabric_vertex_exp_properties_t; +} ze_device_pitched_alloc_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Edge properties -typedef struct _ze_fabric_edge_exp_properties_t +/// @brief Pitch information for 2-dimensional linear pitched allocations +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetImageProperties in +/// conjunction with the ::ze_device_pitched_alloc_exp_properties_t via +/// its pNext member +typedef struct _ze_pitched_alloc_2dimage_linear_pitch_exp_info_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). - ze_uuid_t uuid; ///< [out] universal unique identifier. - char model[ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]; ///< [out] Description of fabric edge technology. Will be set to the string - ///< "unkown" if this cannot be determined for this edge - uint32_t bandwidth; ///< [out] design bandwidth - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit - uint32_t latency; ///< [out] design latency - ze_latency_unit_t latencyUnit; ///< [out] latency unit - ze_fabric_edge_exp_duplexity_t duplexity; ///< [out] Duplexity of the fabric edge + size_t pitchAlign; ///< [out] Required pitch Aligment in Bytes. + size_t maxSupportedPitch; ///< [out] Maximum allowed pitch in Bytes. -} ze_fabric_edge_exp_properties_t; +} ze_pitched_alloc_2dimage_linear_pitch_exp_info_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices within a driver +/// @brief Retrieves pitch information that can be used to allocate USM memory +/// for a given image. /// /// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices. -/// - The application may call this function from simultaneous threads. +/// - Retrieves pitch for 2D image given the width, height and size in bytes +/// - The memory is then allocated using ::zeMemAllocDevice by providing +/// input size calculated as the returned pitch value multiplied by image height +/// - The application may call this function from simultaneous threads /// - The implementation of this function must be thread-safe. -/// -/// @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 == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves a fabric sub-vertex from a fabric vertex -/// -/// @details -/// - Multiple calls to this function will return identical fabric vertex -/// handles, in the same order. -/// - The number of handles returned from this function is affected by the -/// `ZE_AFFINITY_MASK` environment variable. -/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14971,29 +14003,27 @@ zeFabricVertexGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. +zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric vertex. +/// @brief Get bindless device offset for image /// /// @details -/// - The application may call this function from simultaneous threads. +/// - 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. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME +/// extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15010,89 +14040,72 @@ zeFabricVertexGetSubVerticesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pVertexProperties` +/// + `nullptr == pDeviceOffset` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties ///< [in,out] query result for fabric vertex properties +zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns device handle from fabric vertex handle. -/// -/// @details -/// - 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 == hVertex` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phDevice` -/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE -/// + Provided fabric vertex handle does not correspond to a device or subdevice. -/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE -/// + Provided fabric vertex handle corresponds to remote device or subdevice. -ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex - ); +/// @brief Specify user defined pitch for pitched linear image allocations. This +/// structure may be passed to ::zeImageCreate in conjunction with +/// ::ze_image_pitched_exp_desc_t via its pNext member +typedef struct _ze_custom_pitch_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). + size_t rowPitch; ///< [in] user programmed aligned pitch for pitched linear image + ///< allocations. This pitch should satisfy the pitchAlign requirement in + ///< ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t + size_t slicePitch; ///< [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. + +} ze_custom_pitch_exp_desc_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. +#if !defined(__GNUC__) +#pragma region commandListClone +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns fabric vertex handle from device handle. -/// -/// @details -/// - 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 == phVertex` -/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX -/// + Provided device handle does not correspond to a fabric vertex. -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device - ); +#ifndef ZE_COMMAND_LIST_CLONE_EXP_NAME +/// @brief Command List Clone Extension Name +#define ZE_COMMAND_LIST_CLONE_EXP_NAME "ZE_experimental_command_list_clone" +#endif // ZE_COMMAND_LIST_CLONE_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves all fabric edges between provided pair of fabric vertices +/// @brief Command List Clone Extension Version(s) +typedef enum _ze_command_list_clone_exp_version_t +{ + ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_COMMAND_LIST_CLONE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_COMMAND_LIST_CLONE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_LIST_CLONE_EXP_VERSION_* ENUMs + +} ze_command_list_clone_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a command list as the clone of another command list. /// /// @details -/// - A fabric edge represents one or more physical links between two fabric -/// vertices. +/// - @deprecated since 1.17 +/// - The source command list must be created with the +/// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. +/// - The source command list must be closed prior to cloning. +/// - The source command list may be cloned while it is running on the +/// device. +/// - The cloned command list inherits all properties of the source command +/// list. +/// - The cloned command list must be destroyed prior to the source command +/// list. +/// - The application must only use the command list for the device, or its +/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -15111,33 +14124,51 @@ zeDeviceGetFabricVertexExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertexA` -/// + `nullptr == hVertexB` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == phClonedCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. +zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. +#if !defined(__GNUC__) +#pragma region immediateCommandListAppend +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME +/// @brief Immediate Command List Append Extension Name +#define ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME "ZE_experimental_immediate_command_list_append" +#endif // ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices connected by a fabric edge +/// @brief Immediate Command List Append Extension Version(s) +typedef enum _ze_immediate_command_list_append_exp_version_t +{ + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_* ENUMs + +} ze_immediate_command_list_append_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends command lists to dispatch from an immediate command list. /// /// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices via a fabric edge. +/// - @deprecated since 1.16. Please use +/// ::zeCommandListImmediateAppendCommandListsWithParameters. +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The command lists passed to this function in the `phCommandLists` +/// argument must be regular command lists (i.e. not immediate command +/// lists). /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15154,21 +14185,35 @@ zeFabricEdgeGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` +/// + `nullptr == hCommandListImmediate` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phVertexA` -/// + `nullptr == phVertexB` +/// + `nullptr == phCommandLists` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. +zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric edge. +/// @brief Appends command lists to dispatch from an immediate command list with +/// additional parameters. /// /// @details +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The command lists passed to this function in the `phCommandLists` +/// argument must be regular command lists (i.e. not immediate command +/// lists). /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -15179,7 +14224,6 @@ zeFabricEdgeGetVerticesExp( /// - ::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 @@ -15187,366 +14231,328 @@ zeFabricEdgeGetVerticesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` +/// + `nullptr == hCommandListImmediate` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pEdgeProperties` +/// + `nullptr == phCommandLists` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties ///< [in,out] query result for fabric edge properties +zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device Memory Properties +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs with dynamic properties. #if !defined(__GNUC__) -#pragma region memoryProperties +#pragma region mutableCommandList #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME -/// @brief Device Memory Properties Extension Name -#define ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME "ZE_extension_device_memory_properties" -#endif // ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME +#ifndef ZE_MUTABLE_COMMAND_LIST_EXP_NAME +/// @brief Mutable Command List Extension Name +#define ZE_MUTABLE_COMMAND_LIST_EXP_NAME "ZE_experimental_mutable_command_list" +#endif // ZE_MUTABLE_COMMAND_LIST_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Memory Properties Extension Version(s) -typedef enum _ze_device_memory_properties_ext_version_t +/// @brief Mutable Command List Extension Version(s) +typedef enum _ze_mutable_command_list_exp_version_t { - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_* ENUMs + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_* ENUMs -} ze_device_memory_properties_ext_version_t; +} ze_mutable_command_list_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory module types -typedef enum _ze_device_memory_ext_type_t +/// @brief Mutable command flags +typedef uint32_t ze_mutable_command_exp_flags_t; +typedef enum _ze_mutable_command_exp_flag_t { - ZE_DEVICE_MEMORY_EXT_TYPE_HBM = 0, ///< HBM memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM2 = 1, ///< HBM2 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR = 2, ///< DDR memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR2 = 3, ///< DDR2 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR3 = 4, ///< DDR3 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR4 = 5, ///< DDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR5 = 6, ///< DDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR = 7, ///< LPDDR memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR3 = 8, ///< LPDDR3 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR4 = 9, ///< LPDDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5 = 10, ///< LPDDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_SRAM = 11, ///< SRAM memory - ZE_DEVICE_MEMORY_EXT_TYPE_L1 = 12, ///< L1 cache - ZE_DEVICE_MEMORY_EXT_TYPE_L3 = 13, ///< L3 cache - ZE_DEVICE_MEMORY_EXT_TYPE_GRF = 14, ///< Execution unit register file - ZE_DEVICE_MEMORY_EXT_TYPE_SLM = 15, ///< Execution unit shared local memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR4 = 16, ///< GDDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5 = 17, ///< GDDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5X = 18, ///< GDDR5X memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6 = 19, ///< GDDR6 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6X = 20, ///< GDDR6X memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR7 = 21, ///< GDDR7 memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM2E = 22, ///< HBM2E memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM3 = 23, ///< HBM3 memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM3E = 24, ///< HBM3E memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM4 = 25, ///< HBM4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5X = 26, ///< LPDDR5X memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR6 = 27, ///< LPDDR6 memory - ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs + ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS = ZE_BIT(0), ///< kernel arguments + ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT = ZE_BIT(1), ///< kernel group count + ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE = ZE_BIT(2), ///< kernel group size + ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET = ZE_BIT(3), ///< kernel global offset + ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT = ZE_BIT(4), ///< command signal event + ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS = ZE_BIT(5), ///< command wait events + ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION = ZE_BIT(6), ///< command kernel + ZE_MUTABLE_COMMAND_EXP_FLAG_GRAPH_ARGUMENTS = ZE_BIT(7), ///< graph arguments + ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs -} ze_device_memory_ext_type_t; +} ze_mutable_command_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory properties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetMemoryProperties via -/// the `pNext` member of ::ze_device_memory_properties_t -typedef struct _ze_device_memory_ext_properties_t +/// @brief Mutable command identifier descriptor +typedef struct _ze_mutable_command_id_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_device_memory_ext_type_t type; ///< [out] The memory type - uint64_t physicalSize; ///< [out] Physical memory size in bytes. A value of 0 indicates that this - ///< property is not known. However, a call to ::zesMemoryGetState() will - ///< correctly return the total size of usable memory. - uint32_t readBandwidth; ///< [out] Design bandwidth for reads - uint32_t writeBandwidth; ///< [out] Design bandwidth for writes - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit - -} ze_device_memory_ext_properties_t; + ze_mutable_command_exp_flags_t flags; ///< [in] mutable command flags. + ///< - must be 0 (default, equivalent to setting all flags bar kernel + ///< instruction), or a valid combination of ::ze_mutable_command_exp_flag_t + ///< - in order to include kernel instruction mutation, + ///< ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Bfloat16 Conversions -#if !defined(__GNUC__) -#pragma region bfloat16conversions -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_BFLOAT16_CONVERSIONS_EXT_NAME -/// @brief Bfloat16 Conversions Extension Name -#define ZE_BFLOAT16_CONVERSIONS_EXT_NAME "ZE_extension_bfloat16_conversions" -#endif // ZE_BFLOAT16_CONVERSIONS_EXT_NAME +} ze_mutable_command_id_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Bfloat16 Conversions Extension Version(s) -typedef enum _ze_bfloat16_conversions_ext_version_t +/// @brief Mutable command list flags +typedef uint32_t ze_mutable_command_list_exp_flags_t; +typedef enum _ze_mutable_command_list_exp_flag_t { - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs - -} ze_bfloat16_conversions_ext_version_t; + ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved + ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_* ENUMs -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device IP Version -#if !defined(__GNUC__) -#pragma region deviceipversion -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_IP_VERSION_EXT_NAME -/// @brief Device IP Version Extension Name -#define ZE_DEVICE_IP_VERSION_EXT_NAME "ZE_extension_device_ip_version" -#endif // ZE_DEVICE_IP_VERSION_EXT_NAME +} ze_mutable_command_list_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device IP Version Extension Version(s) -typedef enum _ze_device_ip_version_version_t +/// @brief Mutable command list properties +typedef struct _ze_mutable_command_list_exp_properties_t { - ZE_DEVICE_IP_VERSION_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_IP_VERSION_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs + 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). + ze_mutable_command_list_exp_flags_t mutableCommandListFlags; ///< [out] mutable command list flags + ze_mutable_command_exp_flags_t mutableCommandFlags; ///< [out] mutable command flags -} ze_device_ip_version_version_t; +} ze_mutable_command_list_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device IP version queried using ::zeDeviceGetProperties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t -typedef struct _ze_device_ip_version_ext_t +/// @brief Mutable command list descriptor +typedef struct _ze_mutable_command_list_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 ipVersion; ///< [out] Device IP version. The meaning of the device IP version is - ///< implementation-defined, but newer devices should have a higher - ///< version than older devices. - -} ze_device_ip_version_ext_t; + ze_mutable_command_list_exp_flags_t flags; ///< [in] mutable command list flags. + ///< - must be 0 (default) or a valid combination of ::ze_mutable_command_list_exp_flag_t -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for querying kernel max group size properties. -#if !defined(__GNUC__) -#pragma region kernelMaxGroupSizeProperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME -/// @brief Kernel Max Group Size Properties Extension Name -#define ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME "ZE_extension_kernel_max_group_size_properties" -#endif // ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME +} ze_mutable_command_list_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel Max Group Size Properties Extension Version(s) -typedef enum _ze_kernel_max_group_size_properties_ext_version_t +/// @brief Mutable commands descriptor +typedef struct _ze_mutable_commands_exp_desc_t { - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + 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 flags; ///< [in] must be 0, this field is reserved for future use -} ze_kernel_max_group_size_properties_ext_version_t; +} ze_mutable_commands_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Additional kernel max group size properties -/// -/// @details -/// - This structure may be passed to ::zeKernelGetProperties, via the -/// `pNext` member of ::ze_kernel_properties_t, to query additional kernel -/// max group size properties. -typedef struct _ze_kernel_max_group_size_properties_ext_t +/// @brief Mutable kernel argument descriptor +typedef struct _ze_mutable_kernel_argument_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t maxGroupSize; ///< [out] maximum group size that can be used to execute the kernel. This - ///< value may be less than or equal to the `maxTotalGroupSize` member of - ///< ::ze_device_compute_properties_t. + uint64_t commandId; ///< [in] command identifier + uint32_t argIndex; ///< [in] kernel argument index + size_t argSize; ///< [in] kernel argument size + const void* pArgValue; ///< [in] pointer to kernel argument value -} ze_kernel_max_group_size_properties_ext_t; +} ze_mutable_kernel_argument_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief compiler-independent type -typedef ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_ext_properties_t; +/// @brief Mutable kernel group count descriptor +typedef struct _ze_mutable_group_count_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). + uint64_t commandId; ///< [in] command identifier + const ze_group_count_t* pGroupCount; ///< [in] pointer to group count -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for querying sub-allocations properties. -#if !defined(__GNUC__) -#pragma region subAllocationsProperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SUB_ALLOCATIONS_EXP_NAME -/// @brief Sub-Allocations Properties Extension Name -#define ZE_SUB_ALLOCATIONS_EXP_NAME "ZE_experimental_sub_allocations" -#endif // ZE_SUB_ALLOCATIONS_EXP_NAME +} ze_mutable_group_count_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Sub-Allocations Properties Extension Version(s) -typedef enum _ze_sub_allocations_exp_version_t +/// @brief Mutable kernel group size descriptor +typedef struct _ze_mutable_group_size_exp_desc_t { - ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SUB_ALLOCATIONS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs + 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). + uint64_t commandId; ///< [in] command identifier + uint32_t groupSizeX; ///< [in] group size for X dimension to use for the kernel + uint32_t groupSizeY; ///< [in] group size for Y dimension to use for the kernel + uint32_t groupSizeZ; ///< [in] group size for Z dimension to use for the kernel -} ze_sub_allocations_exp_version_t; +} ze_mutable_group_size_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Properties returned for a sub-allocation -typedef struct _ze_sub_allocation_t +/// @brief Mutable kernel global offset descriptor +typedef struct _ze_mutable_global_offset_exp_desc_t { - void* base; ///< [in,out][optional] base address of the sub-allocation - size_t size; ///< [in,out][optional] size of the allocation + 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). + uint64_t commandId; ///< [in] command identifier + uint32_t offsetX; ///< [in] global offset for X dimension to use for this kernel + uint32_t offsetY; ///< [in] global offset for Y dimension to use for this kernel + uint32_t offsetZ; ///< [in] global offset for Z dimension to use for this kernel -} ze_sub_allocation_t; +} ze_mutable_global_offset_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Sub-Allocations Properties -/// -/// @details -/// - This structure may be passed to ::zeMemGetAllocProperties, via the -/// `pNext` member of ::ze_memory_allocation_properties_t. -typedef struct _ze_memory_sub_allocations_exp_properties_t +/// @brief Mutable graph argument descriptor +typedef struct _ze_mutable_graph_argument_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t* pCount; ///< [in,out] pointer to the number of sub-allocations. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-allocations on which the allocation has been divided. - ///< if count is greater than the number of sub-allocations, then the - ///< driver shall update the value with the correct number of sub-allocations. - ze_sub_allocation_t* pSubAllocations; ///< [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. - ///< if count is less than the number of sub-allocations available, then - ///< driver shall only retrieve properties for that number of sub-allocations. + uint64_t commandId; ///< [in] command identifier + uint32_t argIndex; ///< [in] graph argument index + const void* pArgValue; ///< [in] pointer to graph argument value -} ze_memory_sub_allocations_exp_properties_t; +} ze_mutable_graph_argument_exp_desc_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting the querying of synchronized event timestamps. -#if !defined(__GNUC__) -#pragma region eventQueryKernelTimestamps -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME -/// @brief Event Query Kernel Timestamps Extension Name -#define ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME "ZE_extension_event_query_kernel_timestamps" -#endif // ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Event Query Kernel Timestamps Extension Version(s) -typedef enum _ze_event_query_kernel_timestamps_ext_version_t -{ - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_* ENUMs - -} ze_event_query_kernel_timestamps_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps flags -typedef uint32_t ze_event_query_kernel_timestamps_ext_flags_t; -typedef enum _ze_event_query_kernel_timestamps_ext_flag_t -{ - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL = ZE_BIT(0), ///< Kernel timestamp results - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED = ZE_BIT(1), ///< Device event timestamps synchronized to the host time domain - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_* ENUMs - -} ze_event_query_kernel_timestamps_ext_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps properties +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties, via the -/// `pNext` member of ::ze_device_properties_t. -typedef struct _ze_event_query_kernel_timestamps_ext_properties_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). - ze_event_query_kernel_timestamps_ext_flags_t flags; ///< [out] 0 or some combination of - ///< ::ze_event_query_kernel_timestamps_ext_flag_t flags - -} ze_event_query_kernel_timestamps_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel timestamp clock data synchronized to the host time domain -typedef struct _ze_synchronized_timestamp_data_ext_t -{ - uint64_t kernelStart; ///< [out] start of kernel execution in nanoseconds, on the host time - ///< domain. - uint64_t kernelEnd; ///< [out] end of kernel execution in nanoseconds, on the host time domain. - -} ze_synchronized_timestamp_data_ext_t; +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Synchronized kernel timestamp result -typedef struct _ze_synchronized_timestamp_result_ext_t -{ - ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data; free running device clock when device was - ///< active,on the host time domain - ze_synchronized_timestamp_data_ext_t context; ///< [out] context specific active data; only includes clocks while context - ///< was actively executing on the device, on the host time domain - -} ze_synchronized_timestamp_result_ext_t; +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. Provides possible kernel handles for +/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION +/// flag is present. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps results properties -typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_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). - ze_kernel_timestamp_result_t* pKernelTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ///< kernel timestamp results - ze_synchronized_timestamp_result_ext_t* pSynchronizedTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ///< synchronized timestamp results - -} ze_event_query_kernel_timestamps_results_ext_properties_t; +/// @brief Updates mutable commands. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Invalid kernel argument or not matching update descriptor provided +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Query an event's timestamp value on the host, with domain preference. +/// @brief Query whether a command list was created with the mutable command list +/// extension. /// /// @details -/// - For collecting *only* kernel timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. -/// - For collecting synchronized timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps -/// are also available from this type of event pool, but there is a -/// performance cost. -/// - The destination memory will be unmodified if the event has not been -/// signaled. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15563,622 +14569,1822 @@ typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == pIsMutable` ZE_APIEXPORT ze_result_t ZE_APICALL -zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. +zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure builder. -#if !defined(__GNUC__) -#pragma region RTASBuilder -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_RTAS_BUILDER_EXP_NAME -/// @brief Ray Tracing Acceleration Structure Builder Extension Name -#define ZE_RTAS_BUILDER_EXP_NAME "ZE_experimental_rtas_builder" -#endif // ZE_RTAS_BUILDER_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) -typedef enum _ze_rtas_builder_exp_version_t -{ - ZE_RTAS_BUILDER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_RTAS_BUILDER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs - -} ze_rtas_builder_exp_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device flags -typedef uint32_t ze_rtas_device_exp_flags_t; -typedef enum _ze_rtas_device_exp_flag_t -{ - ZE_RTAS_DEVICE_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use - ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs +/// @brief Updates the signal event for a mutable command in a mutable command +/// list. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - The type, scope and flags of the signal event must match those of the +/// source command. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - 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 == hCommandList` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ); -} ze_rtas_device_exp_flag_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Updates the wait events for a mutable command in a mutable command +/// list. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - The number of wait events must match that of the source command. +/// - The type, scope and flags of the wait events must match those of the +/// source command. +/// - Passing `nullptr` as the wait events will update the command to not +/// wait on any events prior to dispatch. +/// - Passing `nullptr` as an event on event wait list will remove event +/// dependency from this wait list slot. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + The `numWaitEvents` parameter does not match that of the original command. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure format +/// @brief Updates the kernel for a mutable command in a mutable command list. /// /// @details -/// - This is an opaque ray tracing acceleration structure format -/// identifier. -typedef enum _ze_rtas_format_exp_t -{ - ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format - ZE_RTAS_FORMAT_EXP_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code - ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXP_* ENUMs +/// - This function may only be called for a mutable command list. +/// - The kernel handle must be from the provided list for given command id. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - This function must be called before updating kernel arguments and +/// dispatch parameters, when kernel is mutated. +/// - 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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCommandId` +/// + `nullptr == phKernels` +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE +/// + Invalid kernel handle provided for the mutation kernel instruction operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to + ); -} ze_rtas_format_exp_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for retrieving kernel binary program data. +#if !defined(__GNUC__) +#pragma region kernelBinary +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_GET_KERNEL_BINARY_EXP_NAME +/// @brief Get Kernel Binary Extension Name +#define ZE_GET_KERNEL_BINARY_EXP_NAME "ZE_extension_kernel_binary_exp" +#endif // ZE_GET_KERNEL_BINARY_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder flags -typedef uint32_t ze_rtas_builder_exp_flags_t; -typedef enum _ze_rtas_builder_exp_flag_t +/// @brief Get Kernel Binary Extension Version(s) +typedef enum _ze_kernel_get_binary_exp_version_t { - ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs + ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_GET_BINARY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs -} ze_rtas_builder_exp_flag_t; +} ze_kernel_get_binary_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation flags -typedef uint32_t ze_rtas_parallel_operation_exp_flags_t; -typedef enum _ze_rtas_parallel_operation_exp_flag_t -{ - ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs +/// @brief Retrieves kernel binary program data (ISA GEN format). +/// +/// @details +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data +/// for kernel handle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == pSize` +/// + `nullptr == pKernelBinary` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ); -} ze_rtas_parallel_operation_exp_flag_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Driver Direct Device Interface (DDI) Handles +#if !defined(__GNUC__) +#pragma region driverDDIHandles +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DRIVER_DDI_HANDLES_EXT_NAME +/// @brief Driver Direct Device Interface (DDI) Handles Extension Name +#define ZE_DRIVER_DDI_HANDLES_EXT_NAME "ZE_extension_driver_ddi_handles" +#endif // ZE_DRIVER_DDI_HANDLES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry flags -typedef uint32_t ze_rtas_builder_geometry_exp_flags_t; -typedef enum _ze_rtas_builder_geometry_exp_flag_t +/// @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) +typedef enum _ze_driver_ddi_handles_ext_version_t { - ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader - ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_* ENUMs - -} ze_rtas_builder_geometry_exp_flag_t; + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLES_EXT_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry flags (see -/// ::ze_rtas_builder_geometry_exp_flags_t) -typedef uint8_t ze_rtas_builder_packed_geometry_exp_flags_t; +} ze_driver_ddi_handles_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance flags -typedef uint32_t ze_rtas_builder_instance_exp_flags_t; -typedef enum _ze_rtas_builder_instance_exp_flag_t +/// @brief Driver Direct Device Interface (DDI) Handle Extension Flags +typedef uint32_t ze_driver_ddi_handle_ext_flags_t; +typedef enum _ze_driver_ddi_handle_ext_flag_t { - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to - ///< be non-opaque - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it - ///< to be opaque - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0), ///< Driver Supports DDI Handles Extension + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs -} ze_rtas_builder_instance_exp_flag_t; +} ze_driver_ddi_handle_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder instance flags (see -/// ::ze_rtas_builder_instance_exp_flags_t) -typedef uint8_t ze_rtas_builder_packed_instance_exp_flags_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build operation flags +/// @brief Driver DDI Handles properties queried using ::zeDriverGetProperties /// /// @details -/// - These flags allow the application to tune the acceleration structure -/// build operation. -/// - The acceleration structure builder implementation might choose to use -/// spatial splitting to split large or long primitives into smaller -/// pieces. This may result in any-hit shaders being invoked multiple -/// times for non-opaque primitives, unless -/// ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. -/// - Usage of any of these flags may reduce ray tracing performance. -typedef uint32_t ze_rtas_builder_build_op_exp_flags_t; -typedef enum _ze_rtas_builder_build_op_exp_flag_t +/// - This structure may be returned from ::zeDriverGetProperties, via the +/// `pNext` member of ::ze_driver_properties_t. +/// - Starting from spec version 1.17, support for this extension is assumed +/// for any driver reporting API version 1.17 or later via +/// ::zeDriverGetApiVersion; the loader does NOT need to query the +/// extension property for such drivers. +/// - For drivers reporting API version 1.16 or earlier, the loader must +/// check for this extension before using DDI handles. +/// - This guarantee enables Level Zero extensions introduced in spec v1.17 +/// or later to embed handles directly inside Level Zero structures (e.g., +/// via pNext chains) without requiring the loader to translate or unwrap +/// handles. +/// - Additionally, drivers may assume the loader will dispatch calls +/// exclusively via the DDI tables embedded in their handles; the only +/// exception is the global DDI table used during driver initialization +/// and to read the reported API version. +typedef struct _ze_driver_ddi_handles_ext_properties_t { - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_* ENUMs + 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). + ze_driver_ddi_handle_ext_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t -} ze_rtas_builder_build_op_exp_flag_t; +} ze_driver_ddi_handles_ext_properties_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for external semaphores +#if !defined(__GNUC__) +#pragma region externalSemaphores +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build quality hint -/// -/// @details -/// - Depending on use case different quality modes for acceleration -/// structure build are supported. -/// - A low-quality build builds an acceleration structure fast, but at the -/// cost of some reduction in ray tracing performance. This mode is -/// recommended for dynamic content, such as animated characters. -/// - A medium-quality build uses a compromise between build quality and ray -/// tracing performance. This mode should be used by default. -/// - Higher ray tracing performance can be achieved by using a high-quality -/// build, but acceleration structure build performance might be -/// significantly reduced. -typedef enum _ze_rtas_builder_build_quality_hint_exp_t -{ - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW = 0, ///< build low-quality acceleration structure (fast) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH = 2, ///< build high-quality acceleration structure (slow) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_* ENUMs - -} ze_rtas_builder_build_quality_hint_exp_t; +#ifndef ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME +/// @brief External Semaphores Extension Name +#define ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME "ZE_extension_external_semaphores" +#endif // ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry type -typedef enum _ze_rtas_builder_geometry_type_exp_t +/// @brief External Semaphores Extension Version +typedef enum _ze_external_semaphore_ext_version_t { - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES = 0, ///< triangle mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS = 1, ///< quad mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL = 2, ///< procedural geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE = 3, ///< instance geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs -} ze_rtas_builder_geometry_type_exp_t; +} ze_external_semaphore_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry type (see -/// ::ze_rtas_builder_geometry_type_exp_t) -typedef uint8_t ze_rtas_builder_packed_geometry_type_exp_t; +/// @brief Handle of external semaphore object +typedef struct _ze_external_semaphore_ext_handle_t *ze_external_semaphore_ext_handle_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure data buffer element format -/// -/// @details -/// - Specifies the format of data buffer elements. -/// - Data buffers may contain instancing transform matrices, triangle/quad -/// vertex indices, etc... -typedef enum _ze_rtas_builder_input_data_format_exp_t +/// @brief External Semaphores Type Flags +typedef uint32_t ze_external_semaphore_ext_flags_t; +typedef enum _ze_external_semaphore_ext_flag_t { - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_column_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see - ///< ::ze_rtas_transform_float3x4_row_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see - ///< ::ze_rtas_triangle_indices_uint32_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_* ENUMs - -} ze_rtas_builder_input_data_format_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure data buffer element format -/// (see ::ze_rtas_builder_input_data_format_exp_t) -typedef uint8_t ze_rtas_builder_packed_input_data_format_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder object -typedef struct _ze_rtas_builder_exp_handle_t *ze_rtas_builder_exp_handle_t; + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_FD = ZE_BIT(0), ///< Semaphore is an Linux opaque file descriptor + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32 = ZE_BIT(1), ///< Semaphore is an opaque Win32 handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32_KMT = ZE_BIT(2), ///< Semaphore is an opaque Win32 KMT handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE = ZE_BIT(3), ///< Semaphore is a D3D12 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D11_FENCE = ZE_BIT(4), ///< Semaphore is a D3D11 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX = ZE_BIT(5), ///< Semaphore is a keyed mutex for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX_KMT = ZE_BIT(6), ///< Semaphore is a keyed mutex for Win32 KMT + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7), ///< Semaphore is a Vulkan Timeline semaphore for Linux + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8), ///< Semaphore is a Vulkan Timeline semaphore for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder parallel -/// operation object -typedef struct _ze_rtas_parallel_operation_exp_handle_t *ze_rtas_parallel_operation_exp_handle_t; +} ze_external_semaphore_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder descriptor -typedef struct _ze_rtas_builder_exp_desc_t +/// @brief External Semaphore Descriptor +typedef struct _ze_external_semaphore_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_rtas_builder_exp_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + ze_external_semaphore_ext_flags_t flags; ///< [in] The flags describing the type of the semaphore. + ///< must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. + ///< When importing a semaphore, pNext should be pointing to one of the + ///< following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. -} ze_rtas_builder_exp_desc_t; +} ze_external_semaphore_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder properties -typedef struct _ze_rtas_builder_exp_properties_t +/// @brief External Semaphore Win32 Descriptor +typedef struct _ze_external_semaphore_win32_ext_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_builder_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder flags - size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is expected to succeed; however, it is possible that the build - ///< may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY - size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is guaranteed to not run out of memory. - size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration - ///< structure build. + void* handle; ///< [in] Win32 handle of the semaphore. + ///< Must be a valid Win32 handle. + const char* name; ///< [in] Name of the semaphore. + ///< Must be a valid null-terminated string. -} ze_rtas_builder_exp_properties_t; +} ze_external_semaphore_win32_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation -/// properties -typedef struct _ze_rtas_parallel_operation_exp_properties_t +/// @brief External Semaphore FD Descriptor +typedef struct _ze_external_semaphore_fd_ext_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_parallel_operation_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation - ///< flags - uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + int fd; ///< [in] File descriptor of the semaphore. + ///< Must be a valid file descriptor. -} ze_rtas_parallel_operation_exp_properties_t; +} ze_external_semaphore_fd_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device properties -/// -/// @details -/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` -/// member of ::ze_device_properties_t. -/// - The implementation shall populate `format` with a value other than -/// ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. -typedef struct _ze_rtas_device_exp_properties_t +/// @brief External Semaphore Signal parameters +typedef struct _ze_external_semaphore_signal_params_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_device_exp_flags_t flags; ///< [out] ray tracing acceleration structure device flags - ze_rtas_format_exp_t rtasFormat; ///< [out] ray tracing acceleration structure format - uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer + uint64_t value; ///< [in] [optional] Value to signal. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. -} ze_rtas_device_exp_properties_t; +} ze_external_semaphore_signal_params_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-component vector type -typedef struct _ze_rtas_float3_exp_t +/// @brief External Semaphore Wait parameters +typedef struct _ze_external_semaphore_wait_params_ext_t { - float x; ///< [in] x-coordinate of float3 vector - float y; ///< [in] y-coordinate of float3 vector - float z; ///< [in] z-coordinate of float3 vector + 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). + uint64_t value; ///< [in] [optional] Value to wait for. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. -} ze_rtas_float3_exp_t; +} ze_external_semaphore_wait_params_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in column-major layout +/// @brief Import an external semaphore /// /// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_column_major_exp_t -{ - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix - -} ze_rtas_transform_float3x4_column_major_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in column-major layout with aligned column -/// vectors +/// - Imports an external semaphore. +/// - This function may be called from simultaneous threads with the same +/// device handle. +/// - The implementation of this function should be lock-free. /// -/// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -/// - The column vectors are aligned to 16-bytes and pad members are -/// ignored. -typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_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 == desc` +/// + `nullptr == phSemaphore` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1ff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Release an external semaphore +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the semaphore before it is released. +/// - The application must **not** call this function from simultaneous +/// threads with the same semaphore handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hSemaphore` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Signal an external semaphore +/// +/// @details +/// - Signals an external semaphore. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == signalParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == signalParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Wait on external semaphores +/// +/// @details +/// - Waits on external semaphores. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - 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_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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == waitParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == waitParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size +#if !defined(__GNUC__) +#pragma region CacheLineSize +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CACHELINE_SIZE_EXT_NAME +/// @brief CacheLine Size Extension Name +#define ZE_CACHELINE_SIZE_EXT_NAME "ZE_extension_device_cache_line_size" +#endif // ZE_CACHELINE_SIZE_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheLine Size Extension Version(s) +typedef enum _ze_device_cache_line_size_ext_version_t { - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float pad0; ///< [in] ignored padding - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float pad1; ///< [in] ignored padding - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float pad2; ///< [in] ignored padding - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix - float pad3; ///< [in] ignored padding + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_* ENUMs -} ze_rtas_transform_float3x4_aligned_column_major_exp_t; +} ze_device_cache_line_size_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetCacheProperties via +/// the `pNext` member of ::ze_device_cache_properties_t. +/// - Used for determining the cache line size supported on a device. +typedef struct _ze_device_cache_line_size_ext_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 cacheLineSize; ///< [out] The cache line size in bytes. + +} ze_device_cache_line_size_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure. +#if !defined(__GNUC__) +#pragma region RTAS +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_RTAS_EXT_NAME +/// @brief Ray Tracing Acceleration Structure Extension Name +#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" +#endif // ZE_RTAS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +typedef enum _ze_rtas_builder_ext_version_t +{ + ZE_RTAS_BUILDER_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RTAS_BUILDER_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_VERSION_* ENUMs + +} ze_rtas_builder_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device flags +typedef uint32_t ze_rtas_device_ext_flags_t; +typedef enum _ze_rtas_device_ext_flag_t +{ + ZE_RTAS_DEVICE_EXT_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use + ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXT_FLAG_* ENUMs + +} ze_rtas_device_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure format +/// +/// @details +/// - This is an opaque ray tracing acceleration structure format +/// identifier. +typedef enum _ze_rtas_format_ext_t +{ + ZE_RTAS_FORMAT_EXT_INVALID = 0x0, ///< Invalid acceleration structure format code + ZE_RTAS_FORMAT_EXT_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXT_* ENUMs + +} ze_rtas_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder flags +typedef uint32_t ze_rtas_builder_ext_flags_t; +typedef enum _ze_rtas_builder_ext_flag_t +{ + ZE_RTAS_BUILDER_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_FLAG_* ENUMs + +} ze_rtas_builder_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation flags +typedef uint32_t ze_rtas_parallel_operation_ext_flags_t; +typedef enum _ze_rtas_parallel_operation_ext_flag_t +{ + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_* ENUMs + +} ze_rtas_parallel_operation_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry flags +typedef uint32_t ze_rtas_builder_geometry_ext_flags_t; +typedef enum _ze_rtas_builder_geometry_ext_flag_t +{ + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_* ENUMs + +} ze_rtas_builder_geometry_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry flags (see +/// ::ze_rtas_builder_geometry_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_geometry_ext_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance flags +typedef uint32_t ze_rtas_builder_instance_ext_flags_t; +typedef enum _ze_rtas_builder_instance_ext_flag_t +{ + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to + ///< be non-opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it + ///< to be opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_* ENUMs + +} ze_rtas_builder_instance_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder instance flags (see +/// ::ze_rtas_builder_instance_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_instance_ext_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build operation flags +/// +/// @details +/// - These flags allow the application to tune the acceleration structure +/// build operation. +/// - The acceleration structure builder implementation might choose to use +/// spatial splitting to split large or long primitives into smaller +/// pieces. This may result in any-hit shaders being invoked multiple +/// times for non-opaque primitives, unless +/// ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +/// - Usage of any of these flags may reduce ray tracing performance. +typedef uint32_t ze_rtas_builder_build_op_ext_flags_t; +typedef enum _ze_rtas_builder_build_op_ext_flag_t +{ + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_* ENUMs + +} ze_rtas_builder_build_op_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build quality hint +/// +/// @details +/// - Depending on use case different quality modes for acceleration +/// structure build are supported. +/// - A low-quality build builds an acceleration structure fast, but at the +/// cost of some reduction in ray tracing performance. This mode is +/// recommended for dynamic content, such as animated characters. +/// - A medium-quality build uses a compromise between build quality and ray +/// tracing performance. This mode should be used by default. +/// - Higher ray tracing performance can be achieved by using a high-quality +/// build, but acceleration structure build performance might be +/// significantly reduced. +typedef enum _ze_rtas_builder_build_quality_hint_ext_t +{ + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW = 0, ///< build low-quality acceleration structure (fast) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH = 2, ///< build high-quality acceleration structure (slow) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_* ENUMs + +} ze_rtas_builder_build_quality_hint_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry type +typedef enum _ze_rtas_builder_geometry_type_ext_t +{ + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES = 0, ///< triangle mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS = 1, ///< quad mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL = 2, ///< procedural geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE = 3, ///< instance geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_* ENUMs + +} ze_rtas_builder_geometry_type_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry type (see +/// ::ze_rtas_builder_geometry_type_ext_t) +typedef uint8_t ze_rtas_builder_packed_geometry_type_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure data buffer element format +/// +/// @details +/// - Specifies the format of data buffer elements. +/// - Data buffers may contain instancing transform matrices, triangle/quad +/// vertex indices, etc... +typedef enum _ze_rtas_builder_input_data_format_ext_t +{ + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see + ///< ::ze_rtas_transform_float3x4_row_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see + ///< ::ze_rtas_triangle_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_* ENUMs + +} ze_rtas_builder_input_data_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure data buffer element format +/// (see ::ze_rtas_builder_input_data_format_ext_t) +typedef uint8_t ze_rtas_builder_packed_input_data_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder object +typedef struct _ze_rtas_builder_ext_handle_t *ze_rtas_builder_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder parallel +/// operation object +typedef struct _ze_rtas_parallel_operation_ext_handle_t *ze_rtas_parallel_operation_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder descriptor +typedef struct _ze_rtas_builder_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_rtas_builder_ext_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + +} ze_rtas_builder_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder properties +typedef struct _ze_rtas_builder_ext_properties_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). + ze_rtas_builder_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder flags + size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is expected to succeed; however, it is possible that the build + ///< may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY + size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is guaranteed to not run out of memory. + size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration + ///< structure build. + +} ze_rtas_builder_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation +/// properties +typedef struct _ze_rtas_parallel_operation_ext_properties_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). + ze_rtas_parallel_operation_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation + ///< flags + uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + +} ze_rtas_parallel_operation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device properties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +/// member of ::ze_device_properties_t. +/// - The implementation shall populate `format` with a value other than +/// ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. +typedef struct _ze_rtas_device_ext_properties_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). + ze_rtas_device_ext_flags_t flags; ///< [out] ray tracing acceleration structure device flags + ze_rtas_format_ext_t rtasFormat; ///< [out] ray tracing acceleration structure format + uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer + +} ze_rtas_device_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-component vector type +typedef struct _ze_rtas_float3_ext_t +{ + float x; ///< [in] x-coordinate of float3 vector + float y; ///< [in] y-coordinate of float3 vector + float z; ///< [in] z-coordinate of float3 vector + +} ze_rtas_float3_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + +} ze_rtas_transform_float3x4_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout with aligned column +/// vectors +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +/// - The column vectors are aligned to 16-bytes and pad members are +/// ignored. +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float pad0; ///< [in] ignored padding + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float pad1; ///< [in] ignored padding + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float pad2; ///< [in] ignored padding + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + float pad3; ///< [in] ignored padding + +} ze_rtas_transform_float3x4_aligned_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in row-major layout +/// +/// @details +/// - A 3x4 affine transformation in row-major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t +{ + float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix + float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix + float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix + float p_x; ///< [in] element 3 of row 0 of 3x4 matrix + float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix + float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix + float p_y; ///< [in] element 3 of row 1 of 3x4 matrix + float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix + float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix + float p_z; ///< [in] element 3 of row 2 of 3x4 matrix + +} ze_rtas_transform_float3x4_row_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +/// in each dimension +typedef struct _ze_rtas_aabb_ext_t +{ + ze_rtas_float3_ext_t lower; ///< [in] lower bounds of AABB + ze_rtas_float3_ext_t upper; ///< [in] upper bounds of AABB + +} ze_rtas_aabb_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Triangle represented using 3 vertex indices +/// +/// @details +/// - Represents a triangle using 3 vertex indices that index into a vertex +/// array that needs to be provided together with the index array. +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_triangle_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex + ///< array + uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + +} ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Quad represented using 4 vertex indices +/// +/// @details +/// - Represents a quad composed of 4 indices that index into a vertex array +/// that needs to be provided together with the index array. +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_quad_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array + uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array + uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + +} ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry info +typedef struct _ze_rtas_builder_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type + +} ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// +/// @details +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t triangleFormat; ///< [in] format of triangle buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t triangleCount; ///< [in] number of triangles in triangle buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + +} ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder quad mesh geometry info +/// +/// @details +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t quadFormat; ///< [in] format of quad buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t quadCount; ///< [in] number of quads in quad buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + +} ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief AABB callback function parameters +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_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 primID; ///< [in] first primitive to return bounds for + uint32_t primIDCount; ///< [in] number of primitives to return bounds for + void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor + void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExt function + ze_rtas_aabb_ext_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + +} ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function pointer type to return AABBs for a range of +/// procedural primitives +typedef void (*ze_rtas_geometry_aabbs_cb_ext_t)( + ze_rtas_geometry_aabbs_ext_cb_params_t* params ///< [in] callback function parameters structure + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder procedural primitives +/// geometry info +/// +/// @details +/// - A host-side bounds callback function is invoked by the acceleration +/// structure builder to query the bounds of procedural primitives on +/// demand. The callback is passed some `pGeomUserPtr` that can point to +/// an application-side representation of the procedural primitives. +/// Further, a second `pBuildUserPtr`, which is set by a parameter to +/// ::zeRTASBuilderBuildExt, is passed to the callback. This allows the +/// build to change the bounds of the procedural geometry, for example, to +/// build a BVH only over a short time range to implement multi-segment +/// motion blur. +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + uint8_t reserved; ///< [in] reserved for future use + uint32_t primCount; ///< [in] number of primitives in geometry + ze_rtas_geometry_aabbs_cb_ext_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box + ///< for a range of primitives + void* pGeomUserPtr; ///< [in] user data pointer passed to callback + +} ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance geometry info +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE + ze_rtas_builder_packed_instance_ext_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t transformFormat; ///< [in] format of the specified transformation + uint32_t instanceUserID; ///< [in] user-specified identifier for the instance + void* pTransform; ///< [in] object-to-world instance transformation in specified format + ze_rtas_aabb_ext_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced + ///< acceleration structure + void* pAccelerationStructure; ///< [in] device pointer to acceleration structure to instantiate + +} ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief +typedef struct _ze_rtas_builder_build_op_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_rtas_format_ext_t rtasFormat; ///< [in] ray tracing acceleration structure format + ze_rtas_builder_build_quality_hint_ext_t buildQuality; ///< [in] acceleration structure build quality hint + ze_rtas_builder_build_op_ext_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t + ///< flags + const ze_rtas_builder_geometry_info_ext_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ///< pointers to geometry infos + uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when + ///< `ppGeometries` is NULL + +} ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// +/// @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 == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves ray tracing acceleration structure builder properties +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Checks ray tracing acceleration structure format compatibility +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::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 == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Build ray tracing acceleration structure +/// +/// @details +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. +/// - 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. +/// - 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. +/// - 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. +/// - 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. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - 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. +/// - A successfully constructed acceleration structure is generally +/// non-copyable. It can only get copied from host to device using the +/// special ::zeRTASBuilderCommandListAppendCopyExt function. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." +/// +/// @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 == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. +/// +/// @details +/// - The memory pointed to by srcptr must be host memory containing a valid +/// ray tracing acceleration structure. +/// - The number of bytes to copy must be larger or equal to the size of the +/// ray tracing acceleration structure. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - 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, +/// and the memory was allocated, 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. +/// +/// @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 == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in row-major layout +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @details -/// - A 3x4 affine transformation in row-major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_row_major_exp_t -{ - float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix - float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix - float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix - float p_x; ///< [in] element 3 of row 0 of 3x4 matrix - float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix - float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix - float p_y; ///< [in] element 3 of row 1 of 3x4 matrix - float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix - float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix - float p_z; ///< [in] element 3 of row 2 of 3x4 matrix - -} ze_rtas_transform_float3x4_row_major_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds -/// in each dimension -typedef struct _ze_rtas_aabb_exp_t -{ - ze_rtas_float3_exp_t lower; ///< [in] lower bounds of AABB - ze_rtas_float3_exp_t upper; ///< [in] upper bounds of AABB - -} ze_rtas_aabb_exp_t; +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Triangle represented using 3 vertex indices +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - Represents a triangle using 3 vertex indices that index into a vertex -/// array that needs to be provided together with the index array. -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_triangle_indices_uint32_exp_t -{ - uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex - ///< array - uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array - -} ze_rtas_triangle_indices_uint32_exp_t; +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// +/// @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 == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ///< [out] handle of parallel operation object + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Quad represented using 4 vertex indices +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties /// /// @details -/// - Represents a quad composed of 4 indices that index into a vertex array -/// that needs to be provided together with the index array. -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_quad_indices_uint32_exp_t -{ - uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array - uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array - uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array - -} ze_rtas_quad_indices_uint32_exp_t; +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties ///< [in,out] query result for parallel operation properties + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry info -typedef struct _ze_rtas_builder_geometry_info_exp_t -{ - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type - -} ze_rtas_builder_geometry_info_exp_t; +/// @brief Joins a parallel build operation +/// +/// @details +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion +/// +/// @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 == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t -{ - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t triangleFormat; ///< [in] format of triangle buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 - uint32_t triangleCount; ///< [in] number of triangles in triangle buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. +/// +/// @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 == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); -} ze_rtas_builder_triangles_geometry_info_exp_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Device Vector Sizes Query +#if !defined(__GNUC__) +#pragma region deviceVectorSizes +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_VECTOR_SIZES_EXT_NAME +/// @brief Device Vector Sizes Query Extension Name +#define ZE_DEVICE_VECTOR_SIZES_EXT_NAME "ZE_extension_device_vector_sizes" +#endif // ZE_DEVICE_VECTOR_SIZES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder quad mesh geometry info -/// -/// @details -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_builder_quads_geometry_info_exp_t +/// @brief Device Vector Sizes Query Extension Version(s) +typedef enum _ze_device_vector_sizes_ext_version_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t quadFormat; ///< [in] format of quad buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 - uint32_t quadCount; ///< [in] number of quads in quad buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_* ENUMs -} ze_rtas_builder_quads_geometry_info_exp_t; +} ze_device_vector_sizes_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief AABB callback function parameters -typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t +/// @brief Device Vector Width Properties queried using +/// $DeviceGetVectorWidthPropertiesExt +typedef struct _ze_device_vector_width_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 primID; ///< [in] first primitive to return bounds for - uint32_t primIDCount; ///< [in] number of primitives to return bounds for - void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor - void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExp function - ze_rtas_aabb_exp_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + uint32_t vector_width_size; ///< [out] The associated vector width size supported by the device. + uint32_t preferred_vector_width_char; ///< [out] The preferred vector width size for char type supported by the device. + uint32_t preferred_vector_width_short; ///< [out] The preferred vector width size for short type supported by the device. + uint32_t preferred_vector_width_int; ///< [out] The preferred vector width size for int type supported by the device. + uint32_t preferred_vector_width_long; ///< [out] The preferred vector width size for long type supported by the device. + uint32_t preferred_vector_width_float; ///< [out] The preferred vector width size for float type supported by the device. + uint32_t preferred_vector_width_double; ///< [out] The preferred vector width size for double type supported by the device. + uint32_t preferred_vector_width_half; ///< [out] The preferred vector width size for half type supported by the device. + uint32_t native_vector_width_char; ///< [out] The native vector width size for char type supported by the device. + uint32_t native_vector_width_short; ///< [out] The native vector width size for short type supported by the device. + uint32_t native_vector_width_int; ///< [out] The native vector width size for int type supported by the device. + uint32_t native_vector_width_long; ///< [out] The native vector width size for long type supported by the device. + uint32_t native_vector_width_float; ///< [out] The native vector width size for float type supported by the device. + uint32_t native_vector_width_double; ///< [out] The native vector width size for double type supported by the device. + uint32_t native_vector_width_half; ///< [out] The native vector width size for half type supported by the device. -} ze_rtas_geometry_aabbs_exp_cb_params_t; +} ze_device_vector_width_properties_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function pointer type to return AABBs for a range of -/// procedural primitives -typedef void (*ze_rtas_geometry_aabbs_cb_exp_t)( - ze_rtas_geometry_aabbs_exp_cb_params_t* params ///< [in] callback function parameters structure +/// @brief Retrieves the vector width properties of the device. +/// +/// @details +/// - Properties are reported for each vector width supported by the device. +/// - Multiple calls to this function will return properties in the same +/// order. +/// - The number of vector width properties is reported thru the pCount +/// parameter which is updated by the driver given pCount == 0. +/// - The application may provide a buffer that is larger than the number of +/// properties, but the application must set pCount to the number of +/// properties to retrieve. +/// - 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 == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Mapping External Memory as part of host allocation +#if !defined(__GNUC__) +#pragma region externalMemMap +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME +/// @brief External Memory Mapping Extension Name +#define ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME "ZE_extension_external_memmap_sysmem" +#endif // ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder procedural primitives -/// geometry info +/// @brief External Memory Mapping Extension Version(s) +typedef enum _ze_external_memmap_sysmem_ext_version_t +{ + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_* ENUMs + +} ze_external_memmap_sysmem_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Maps external system memory for an allocation /// /// @details -/// - A host-side bounds callback function is invoked by the acceleration -/// structure builder to query the bounds of procedural primitives on -/// demand. The callback is passed some `pGeomUserPtr` that can point to -/// an application-side representation of the procedural primitives. -/// Further, a second `pBuildUserPtr`, which is set by a parameter to -/// ::zeRTASBuilderBuildExp, is passed to the callback. This allows the -/// build to change the bounds of the procedural geometry, for example, to -/// build a BVH only over a short time range to implement multi-segment -/// motion blur. -typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t +/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` +/// member of ::ze_host_mem_alloc_desc_t to map system memory for a host +/// allocation. +/// - The `pSystemMemory` pointer and `size` being mapped must be aligned to +/// the host page size. The host page size must be queried using +/// operating-system-specific calls, as the mapped memory originates from +/// the system allocator rather than from Level-Zero; there is no +/// Level-Zero query for this value. +/// - On success, the pointer returned from ::zeMemAllocHost is identical to +/// `pSystemMemory`; the mapping preserves the virtual address, so the +/// same address is valid on both the host and the device. +/// - Memory from the application's heap, stack, or statically-allocated +/// (global) storage is supported. Support for memory obtained by other +/// means is platform- and driver-dependent and is not guaranteed. If +/// `pSystemMemory` points to a memory type that cannot be mapped, +/// ::zeMemAllocHost returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +/// - Host memory that is read-only can only be mapped successfully when the +/// ::ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY flag is set in +/// ::ze_host_mem_alloc_desc_t; in that case device access to the mapped +/// memory is read-only. +/// - The system memory referenced by `pSystemMemory` must remain valid for +/// the entire lifetime of the resulting allocation. Freeing or unmapping +/// the underlying system memory before the allocation is released results +/// in undefined behavior. +/// - Mapped memory ranges must not overlap. Releasing a mapping with +/// ::zeMemFree tears down the device page-table entries for its virtual +/// address range. Because these page tables are shared across imports, +/// releasing a mapping that overlaps another import also tears down the +/// overlapping device page-table entries, leaving the other allocation +/// invalid for device access. The host system memory itself is +/// unaffected. +/// - After mapping, ::zeMemGetAllocProperties reports the allocation type +/// as ::ZE_MEMORY_TYPE_HOST_IMPORTED. +/// - The mapping is released by passing the pointer to ::zeMemFree, like +/// any other host allocation. +typedef struct _ze_external_memmap_sysmem_ext_desc_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - uint8_t reserved; ///< [in] reserved for future use - uint32_t primCount; ///< [in] number of primitives in geometry - ze_rtas_geometry_aabbs_cb_exp_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box - ///< for a range of primitives - void* pGeomUserPtr; ///< [in] user data pointer passed to callback + 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). + void* pSystemMemory; ///< [in] system memory pointer to map; must be page-aligned. + uint64_t size; ///< [in] size of the system memory to map; must be a multiple of the page + ///< size. -} ze_rtas_builder_procedural_geometry_info_exp_t; +} ze_external_memmap_sysmem_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for retrieving kernel memory allocation properties. +#if !defined(__GNUC__) +#pragma region kernelAllocationProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME +/// @brief Get Kernel Allocation Properties Extension Name +#define ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME "ZE_experimental_kernel_allocation_properties" +#endif // ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance geometry info -typedef struct _ze_rtas_builder_instance_geometry_info_exp_t +/// @brief Get Kernel Allocation Properties Extension Version(s) +typedef enum _ze_kernel_get_allocation_properties_exp_version_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE - ze_rtas_builder_packed_instance_exp_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation - uint32_t instanceUserID; ///< [in] user-specified identifier for the instance - void* pTransform; ///< [in] object-to-world instance transformation in specified format - ze_rtas_aabb_exp_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced - ///< acceleration structure - void* pAccelerationStructure; ///< [in] pointer to acceleration structure to instantiate + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_* ENUMs -} ze_rtas_builder_instance_geometry_info_exp_t; +} ze_kernel_get_allocation_properties_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief -typedef struct _ze_rtas_builder_build_op_exp_desc_t +/// @brief Kernel allocation properties +typedef struct _ze_kernel_allocation_exp_properties_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 + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_format_exp_t rtasFormat; ///< [in] ray tracing acceleration structure format - ze_rtas_builder_build_quality_hint_exp_t buildQuality; ///< [in] acceleration structure build quality hint - ze_rtas_builder_build_op_exp_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t - ///< flags - const ze_rtas_builder_geometry_info_exp_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of - ///< pointers to geometry infos - uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when - ///< `ppGeometries` is NULL + uint64_t base; ///< [out] base address of the allocation + size_t size; ///< [out] size of allocation + ze_memory_type_t type; ///< [out] type of allocation + uint32_t argIndex; ///< [out] kernel argument index for current allocation, -1 for driver + ///< internal (not kernel argument) allocations -} ze_rtas_builder_build_op_exp_desc_t; +} ze_kernel_allocation_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Retrieves kernel allocation properties. /// /// @details +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns array of kernel allocation properties for kernel handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16195,233 +16401,182 @@ typedef struct _ze_rtas_builder_build_op_exp_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object +zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties ///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device UsableMem Size Properties Extension +#if !defined(__GNUC__) +#pragma region deviceusablememproperties +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties -/// -/// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == hBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties - ); +#ifndef ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME +/// @brief Device Usable Memory Size Properties Extension Name +#define ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME "ZE_extension_device_usablemem_size_properties" +#endif // ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility -/// -/// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @returns -/// - ::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 == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B - ); +/// @brief Device Usable Mem Size Extension Version(s) +typedef enum _ze_device_usablemem_size_properties_ext_version_t +{ + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_device_usablemem_size_properties_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Memory access property to discover current status of usable memory /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - It is the user's responsibility to manage the acceleration structure -/// buffer allocation, de-allocation, and potential prefetching to the -/// device memory. The required size of the acceleration structure buffer -/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. -/// The acceleration structure buffer must be a shared USM allocation and -/// should be present on the host at build time. The referenced scene data -/// (index- and vertex- buffers) can be standard host allocations, and -/// will not be referenced into by the build acceleration structure. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes based on a query for the estimated size properties. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. -/// - When using the "expected" size for the acceleration structure buffer, -/// the acceleration structure construction may fail with -/// ::ZE_RESULT_EXP_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. -/// - 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. -/// - All provided data buffers must be host-accessible. -/// - The acceleration structure buffer must be a USM allocation. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - Acceleration structure construction may be parallelized by passing a -/// valid handle to a parallel operation object and joining that parallel -/// operation using ::zeRTASParallelOperationJoinExp with user-provided -/// worker threads. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." -/// -/// @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 == hBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes - ); +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_usablemem_size_ext_properties_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). + uint64_t currUsableMemSize; ///< [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. + +} ze_device_usablemem_size_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Image Format Support +#if !defined(__GNUC__) +#pragma region imageFormatSupport +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME +/// @brief Image Format Support Extension Name +#define ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME "ZE_extension_image_format_support" +#endif // ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Image Format Support Extension Version(s) +typedef enum _ze_image_format_support_ext_version_t +{ + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_* ENUMs + +} ze_image_format_support_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image format support query properties /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. -/// - The implementation of this function must be thread-safe. -/// -/// @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 == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ); +/// - This structure may be passed to ::zeImageGetProperties via the pNext +/// member of ::ze_image_properties_t. +/// - The implementation shall populate the supported field based on the +/// ::ze_image_desc_t and ::ze_device_handle_t passed to +/// ::zeImageGetProperties. +/// - This provides a mechanism to query format support without requiring +/// image creation. +typedef struct _ze_image_format_support_ext_properties_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). + ze_bool_t supported; ///< [out] boolean flag indicating whether the image format is supported on + ///< the queried device + +} ze_image_format_support_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for setting the IPC memory handle type requested at memory allocation time. +#if !defined(__GNUC__) +#pragma region ipcMemHandleType +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME +/// @brief IPC Memory Handle Type Extension Name +#define ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME "ZE_extension_ipc_mem_handle_type" +#endif // ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object +/// @brief IPC Memory Handle Type Extension Version(s) +typedef enum _ze_ipc_mem_handle_type_ext_version_t +{ + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_* ENUMs + +} ze_ipc_mem_handle_type_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported IPC memory handle type flags +typedef uint32_t ze_ipc_mem_handle_type_flags_t; +typedef enum _ze_ipc_mem_handle_type_flag_t +{ + ZE_IPC_MEM_HANDLE_TYPE_FLAG_DEFAULT = ZE_BIT(0), ///< Local IPC memory handle type for use within the same device. This is + ///< the default if no flags are specified and does not indicate if the + ///< handle is shareable across devices or machines. + ZE_IPC_MEM_HANDLE_TYPE_FLAG_FABRIC_ACCESSIBLE = ZE_BIT(1), ///< Fabric accessible IPC memory handle type for use across devices or + ///< machines via a supported fabric. + ZE_IPC_MEM_HANDLE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_FLAG_* ENUMs + +} ze_ipc_mem_handle_type_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief ['IPC Memory Handle Type Extension Descriptor', 'Used in +/// ::zeMemGetIpcHandleWithProperties, ::zeMemAllocDevice, and +/// ::zeMemAllocHost, ::zePhysicalMemCreate to specify the IPC memory +/// handle type to create for this allocation.'] +typedef struct _ze_ipc_mem_handle_type_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_ipc_mem_handle_type_flags_t typeFlags; ///< [in] valid combination of ::ze_ipc_mem_handle_type_flag_t + +} ze_ipc_mem_handle_type_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 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. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16438,27 +16593,113 @@ zeRTASBuilderDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` +/// + `nullptr == ptr` +/// + `nullptr == pIpcHandle` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ///< [out] handle of parallel operation object +zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Level-Zero Extension for Record and Replay of Graphs. +#if !defined(__GNUC__) +#pragma region graph +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_RECORD_REPLAY_GRAPH_EXT_NAME +/// @brief Record and Replay Graph Extension Name +#define ZE_RECORD_REPLAY_GRAPH_EXT_NAME "ZE_extension_record_replay_graph" +#endif // ZE_RECORD_REPLAY_GRAPH_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties +/// @brief Record and Replay Graph Extension Version(s) +typedef enum _ze_record_replay_graph_ext_version_t +{ + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_VERSION_* ENUMs + +} ze_record_replay_graph_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Record and Replay Graph capability flags +typedef uint32_t ze_record_replay_graph_ext_flags_t; +typedef enum _ze_record_replay_graph_ext_flag_t +{ + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_IMMUTABLE_GRAPH = ZE_BIT(0), ///< Supports graphs that can't mutate + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_MUTABLE_GRAPH = ZE_BIT(1), ///< Supports graphs that can mutate + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS = ZE_BIT(2), ///< Supports appending a subgraph into a graph + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST = ZE_BIT(3), ///< Supports appending a command list into a graph + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC = ZE_BIT(4), ///< Supports waiting/signaling events that were created with both + ///< ZEX_COUNTER_BASED_EVENT_FLAG_IPC and + ///< ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL + ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_* ENUMs + +} ze_record_replay_graph_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported Record and Replay Graph properties. This structure is +/// accepted as pNext to ::ze_device_properties_t +typedef struct _ze_record_replay_graph_ext_properties_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). + ze_record_replay_graph_ext_flags_t graphFlags; ///< [out] record and replay flags + +} ze_record_replay_graph_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of an executable graph object +typedef struct _ze_executable_graph_handle_t *ze_executable_graph_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Record and Replay Graph dump mode +typedef enum _ze_record_replay_graph_ext_dump_mode_t +{ + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_DETAILED = 0x0, ///< detailed mode (default) + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_SIMPLE = 0x1, ///< simple mode + ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RECORD_REPLAY_GRAPH_EXT_DUMP_MODE_* ENUMs + +} ze_record_replay_graph_ext_dump_mode_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Record and Replay Graph dump descriptor /// /// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - Accepted as pNext in ::zeGraphDumpContentsExt. +typedef struct _ze_record_replay_graph_ext_dump_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_record_replay_graph_ext_dump_mode_t mode; ///< [in] graph dump mode + +} ze_record_replay_graph_ext_dump_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function pointer type invoked when a graph is destroyed +typedef void (ZE_CALLBACK_CONV *zex_mem_graph_free_callback_fn_t)( + void* pUserData ///< [in][optional] user data pointer provided at callback registration + ///< time + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a new graph object. +/// +/// @details +/// - A newly created graph is an empty container for captured operations. +/// - The application may instantiate executable graph objects from a +/// recorded graph using ::zeGraphInstantiateExt. +/// - The application may begin capturing into an empty graph using +/// ::zeCommandListBeginCaptureIntoGraphExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16475,21 +16716,88 @@ zeRTASParallelOperationCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == phGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties ///< [in,out] query result for parallel operation properties +zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Begins recording asynchronous append operations into a new graph +/// associated with an immediate command list. /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion +/// - Graph capture is intended for asynchronous append operations only; +/// synchronous operations are not supported while capture is active and +/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - The application must call this function only with an immediate command +/// list. +/// - The application must not call this function with a synchronous +/// immediate command list. +/// - After this call succeeds, append operations issued to the command list +/// are recorded into a graph and are not submitted to the device. Events +/// used by these operations are not signaled until capture ends and the +/// graph is instantiated and executed. +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while +/// capture is active, calling +/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is +/// active, calling ::zeCommandListAppendGraphExt on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - While capture is active, host-side synchronization operations on +/// recorded work, such as ::zeCommandListHostSynchronize or +/// ::zeEventHostSynchronize, return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - While capture is active, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph +/// cannot be used outside the graph; such use returns an error +/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). +/// - The command list on which capture starts is called the primary command +/// list for a given capture session. +/// - If an event signaled by a captured command list is used in the wait +/// list of another immediate command list, that command list also enters +/// graph capture mode. This creates a fork. The command list from which +/// the fork originated is called the parent, and the forked command list +/// is called the child. A child command list may itself be used to create +/// additional forks, resulting in a tree of command lists participating +/// in the same graph capture. +/// - Subsequent signals from the parent command list to a child command +/// list are allowed and do not create additional forks or capture +/// sessions; the child command list remains in the same capture session +/// as the parent command list. +/// - Each fork must be joined by signaling on the child command list and by +/// waiting on the parent command list. +/// - A child command list may signal multiple times back to the parent +/// command list, but only the last signal on the child command list may +/// become part of the join operation. +/// - Child command lists continue recording as long as the primary command +/// list is in capture mode. +/// - Commands that append work (for example, compute kernels or data +/// transfers) to a recording child command list after the intended join +/// operation are treated as unjoined work, and the graph is considered +/// invalid. Commands that do not append work (for example, event signal +/// and wait operations) are allowed after the join operation and do not +/// invalidate the graph. +/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply to recording child command lists as well. +/// - It is invalid to merge two separate graph capture sessions (i.e. with +/// different primary command lists) by waiting on an event associated +/// with a different graph (operation will return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event +/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error +/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append +/// operations. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16506,23 +16814,25 @@ zeRTASParallelOperationGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object +zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Begins recording asynchronous append operations into an existing +/// graph. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. -/// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. -/// - The implementation of this function must be thread-safe. +/// - The graph must be created with ::zeGraphCreateExt before calling this +/// function. +/// - The graph must be empty when capture begins. +/// - After this call succeeds, the command list enters graph capture mode +/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16539,177 +16849,69 @@ zeRTASParallelOperationJoinExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Counter-based Event Pools. @deprecated since 1.15 -#if !defined(__GNUC__) -#pragma region counterbasedeventpool -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME -/// @brief Counter-based Event Pools Extension Name -#define ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME "ZE_experimental_event_pool_counter_based" -#endif // ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Counter-based Event Pools Extension Version(s) -typedef enum _ze_event_pool_counter_based_exp_version_t -{ - ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_* ENUMs - -} ze_event_pool_counter_based_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported event flags for defining counter-based event pools. -typedef uint32_t ze_event_pool_counter_based_exp_flags_t; -typedef enum _ze_event_pool_counter_based_exp_flag_t -{ - ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE = ZE_BIT(0), ///< Counter-based event pool is used for immediate command lists (default) - ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE = ZE_BIT(1), ///< Counter-based event pool is for non-immediate command lists - ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_* ENUMs - -} ze_event_pool_counter_based_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Event pool descriptor for counter-based events. This structure may be -/// passed to ::zeEventPoolCreate as pNext member of -/// ::ze_event_pool_desc_t. @deprecated since 1.15 -typedef struct _ze_event_pool_counter_based_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). - ze_event_pool_counter_based_exp_flags_t flags; ///< [in] mode flags. - ///< must be 0 (default) or a valid value of ::ze_event_pool_counter_based_exp_flag_t - ///< default behavior is counter-based event pool is only used for - ///< immediate command lists. - -} ze_event_pool_counter_based_exp_desc_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting bindless images. -#if !defined(__GNUC__) -#pragma region bindlessimages -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_BINDLESS_IMAGE_EXP_NAME -/// @brief Image Memory Properties Extension Name -#define ZE_BINDLESS_IMAGE_EXP_NAME "ZE_experimental_bindless_image" -#endif // ZE_BINDLESS_IMAGE_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Bindless Image Extension Version(s) -typedef enum _ze_bindless_image_exp_version_t -{ - ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs - -} ze_bindless_image_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image flags for Bindless images -typedef uint32_t ze_image_bindless_exp_flags_t; -typedef enum _ze_image_bindless_exp_flag_t -{ - ZE_IMAGE_BINDLESS_EXP_FLAG_BINDLESS = ZE_BIT(0), ///< Bindless images are created with ::zeImageCreate. The image handle - ///< created with this flag is valid on both host and device. - ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE = ZE_BIT(1), ///< Bindless sampled images are created with ::zeImageCreate by combining - ///< BINDLESS and SAMPLED_IMAGE. - ///< Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. - ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs - -} ze_image_bindless_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image descriptor for bindless images. This structure may be passed to -/// ::zeImageCreate via pNext member of ::ze_image_desc_t. -typedef struct _ze_image_bindless_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). - ze_image_bindless_exp_flags_t flags; ///< [in] image flags. - ///< must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t - ///< default behavior is bindless images are not used when creating handles - ///< via ::zeImageCreate. - ///< When the flag is passed to ::zeImageCreate, then only the memory for - ///< the image is allocated. - ///< Additional image handles can be created with ::zeImageViewCreateExt. - ///< When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, - ///< ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t. - -} ze_image_bindless_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image descriptor for bindless images created from pitched allocations. -/// This structure may be passed to ::zeImageCreate via pNext member of -/// ::ze_image_desc_t. -typedef struct _ze_image_pitched_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). - void* ptr; ///< [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice - -} ze_image_pitched_exp_desc_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Device specific properties for pitched allocations +/// @brief Queries whether a command list is in graph capture mode. /// /// @details -/// - This structure may be passed to ::zeDeviceGetImageProperties via the -/// pNext member of ::ze_device_image_properties_t. -typedef struct _ze_device_pitched_alloc_exp_properties_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). - size_t maxImageLinearWidth; ///< [out] Maximum image linear width. - size_t maxImageLinearHeight; ///< [out] Maximum image linear height. - -} ze_device_pitched_alloc_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Pitch information for 2-dimensional linear pitched allocations +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is +/// in graph capture mode. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is +/// not in graph capture mode. /// -/// @details -/// - This structure may be passed to ::zeDeviceGetImageProperties in -/// conjunction with the ::ze_device_pitched_alloc_exp_properties_t via -/// its pNext member -typedef struct _ze_pitched_alloc_2dimage_linear_pitch_exp_info_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). - size_t pitchAlign; ///< [out] Required pitch Aligment in Bytes. - size_t maxSupportedPitch; ///< [out] Maximum allowed pitch in Bytes. - -} ze_pitched_alloc_2dimage_linear_pitch_exp_info_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 == hCommandList` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves pitch information that can be used to allocate USM memory -/// for a given image. +/// @brief Ends graph capture on the primary command list and returns the +/// recorded graph. /// /// @details -/// - Retrieves pitch for 2D image given the width, height and size in bytes -/// - The memory is then allocated using ::zeMemAllocDevice by providing -/// input size calculated as the returned pitch value multiplied by image height -/// - 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. -/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension. +/// - This function may only be called on the primary command list used with +/// ::zeCommandListBeginGraphCaptureExt or +/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, +/// the returned graph handle is the same graph handle that was provided +/// when capture began. +/// - The returned graph must be instantiated before execution. +/// - This call ends graph capture mode on all command lists participating +/// in the same graph capture (including forks). +/// - After this call succeeds, subsequent append operations submit work to +/// the device normally. +/// - If capture mode is not active on the command list, an error is +/// returned. +/// - After this call succeeds, events signaled by previously captured +/// commands do not create new forks. +/// - After this call succeeds, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the +/// application and don't interfere with recorded state. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16726,27 +16928,33 @@ typedef struct _ze_pitched_alloc_2dimage_linear_pitch_exp_info_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// + if graph contains unjoined forks +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ZE_APIEXPORT ze_result_t ZE_APICALL -zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch +zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Get bindless device offset for image +/// @brief Returns the graph associated with a command list that is in graph +/// capture mode. /// /// @details -/// - 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. -/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME -/// extension. +/// - This function may only be called while the command list is in graph +/// capture mode. +/// - The returned graph handle cannot be instantiated until capture is +/// ended by ::zeCommandListEndGraphCaptureExt. +/// - This function does not transfer ownership of the graph handle. +/// - If the command list is not in graph capture mode, an error is returned +/// and `*phGraph` is set to null. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16763,74 +16971,26 @@ zeMemGetPitchFor2dImage( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDeviceOffset` +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image +zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Specify user defined pitch for pitched linear image allocations. This -/// structure may be passed to ::zeImageCreate in conjunction with -/// ::ze_image_pitched_exp_desc_t via its pNext member -typedef struct _ze_custom_pitch_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). - size_t rowPitch; ///< [in] user programmed aligned pitch for pitched linear image - ///< allocations. This pitch should satisfy the pitchAlign requirement in - ///< ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t - size_t slicePitch; ///< [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. - -} ze_custom_pitch_exp_desc_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. -#if !defined(__GNUC__) -#pragma region commandListClone -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_COMMAND_LIST_CLONE_EXP_NAME -/// @brief Command List Clone Extension Name -#define ZE_COMMAND_LIST_CLONE_EXP_NAME "ZE_experimental_command_list_clone" -#endif // ZE_COMMAND_LIST_CLONE_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Command List Clone Extension Version(s) -typedef enum _ze_command_list_clone_exp_version_t -{ - ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_COMMAND_LIST_CLONE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_COMMAND_LIST_CLONE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_LIST_CLONE_EXP_VERSION_* ENUMs - -} ze_command_list_clone_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a command list as the clone of another command list. +/// @brief Returns the primary command list associated with a graph capture +/// session. /// /// @details -/// - @deprecated since 1.17 -/// - The source command list must be created with the -/// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. -/// - The source command list must be closed prior to cloning. -/// - The source command list may be cloned while it is running on the -/// device. -/// - The cloned command list inherits all properties of the source command -/// list. -/// - The cloned command list must be destroyed prior to the source command -/// list. -/// - The application must only use the command list for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The returned command list is the command list that initiated capture +/// for the graph during its recording stage. +/// - This function can be called while the graph is being recorded and +/// after capture has ended. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16847,51 +17007,26 @@ typedef enum _ze_command_list_clone_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phClonedCommandList` +/// + `nullptr == phCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list +zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. -#if !defined(__GNUC__) -#pragma region immediateCommandListAppend -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME -/// @brief Immediate Command List Append Extension Name -#define ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME "ZE_experimental_immediate_command_list_append" -#endif // ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Immediate Command List Append Extension Version(s) -typedef enum _ze_immediate_command_list_append_exp_version_t -{ - ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_* ENUMs - -} ze_immediate_command_list_append_exp_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends command lists to dispatch from an immediate command list. +/// @brief Registers a host callback that is invoked when a graph is destroyed. /// /// @details -/// - @deprecated since 1.16. Please use -/// ::zeCommandListImmediateAppendCommandListsWithParameters. -/// - The application must call this function only with command lists -/// created with ::zeCommandListCreateImmediate. -/// - The command lists passed to this function in the `phCommandLists` -/// argument must be regular command lists (i.e. not immediate command -/// lists). -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - Callbacks may be registered while a graph is being recorded or after +/// executable graph instances have been created from it. +/// - Multiple callbacks may be registered for the same graph. +/// - All registered callbacks are invoked when the graph is destroyed. +/// - The callback must not call Level Zero APIs that use the graph being +/// destroyed. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16908,37 +17043,40 @@ typedef enum _ze_immediate_command_list_append_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandListImmediate` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phCommandLists` +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) +zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends command lists to dispatch from an immediate command list with -/// additional parameters. +/// @brief Creates an executable graph object from a recorded graph. /// /// @details -/// - The application must call this function only with command lists -/// created with ::zeCommandListCreateImmediate. -/// - The command lists passed to this function in the `phCommandLists` -/// argument must be regular command lists (i.e. not immediate command -/// lists). -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - Multiple executable graph objects may be created from a single +/// recorded graph. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16947,6 +17085,7 @@ zeCommandListImmediateAppendCommandListsExp( /// - ::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 @@ -16954,206 +17093,36 @@ zeCommandListImmediateAppendCommandListsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandListImmediate` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phCommandLists` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported +/// + `nullptr == phExecutableGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) +zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs with dynamic properties. -#if !defined(__GNUC__) -#pragma region mutableCommandList -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MUTABLE_COMMAND_LIST_EXP_NAME -/// @brief Mutable Command List Extension Name -#define ZE_MUTABLE_COMMAND_LIST_EXP_NAME "ZE_experimental_mutable_command_list" -#endif // ZE_MUTABLE_COMMAND_LIST_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable Command List Extension Version(s) -typedef enum _ze_mutable_command_list_exp_version_t -{ - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_* ENUMs - -} ze_mutable_command_list_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable command flags -typedef uint32_t ze_mutable_command_exp_flags_t; -typedef enum _ze_mutable_command_exp_flag_t -{ - ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS = ZE_BIT(0), ///< kernel arguments - ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT = ZE_BIT(1), ///< kernel group count - ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE = ZE_BIT(2), ///< kernel group size - ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET = ZE_BIT(3), ///< kernel global offset - ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT = ZE_BIT(4), ///< command signal event - ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS = ZE_BIT(5), ///< command wait events - ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION = ZE_BIT(6), ///< command kernel - ZE_MUTABLE_COMMAND_EXP_FLAG_GRAPH_ARGUMENTS = ZE_BIT(7), ///< graph arguments - ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs - -} ze_mutable_command_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable command identifier descriptor -typedef struct _ze_mutable_command_id_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). - ze_mutable_command_exp_flags_t flags; ///< [in] mutable command flags. - ///< - must be 0 (default, equivalent to setting all flags bar kernel - ///< instruction), or a valid combination of ::ze_mutable_command_exp_flag_t - ///< - in order to include kernel instruction mutation, - ///< ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included - -} ze_mutable_command_id_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable command list flags -typedef uint32_t ze_mutable_command_list_exp_flags_t; -typedef enum _ze_mutable_command_list_exp_flag_t -{ - ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved - ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_* ENUMs - -} ze_mutable_command_list_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable command list properties -typedef struct _ze_mutable_command_list_exp_properties_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). - ze_mutable_command_list_exp_flags_t mutableCommandListFlags; ///< [out] mutable command list flags - ze_mutable_command_exp_flags_t mutableCommandFlags; ///< [out] mutable command flags - -} ze_mutable_command_list_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable command list descriptor -typedef struct _ze_mutable_command_list_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). - ze_mutable_command_list_exp_flags_t flags; ///< [in] mutable command list flags. - ///< - must be 0 (default) or a valid combination of ::ze_mutable_command_list_exp_flag_t - -} ze_mutable_command_list_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable commands descriptor -typedef struct _ze_mutable_commands_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 flags; ///< [in] must be 0, this field is reserved for future use - -} ze_mutable_commands_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable kernel argument descriptor -typedef struct _ze_mutable_kernel_argument_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). - uint64_t commandId; ///< [in] command identifier - uint32_t argIndex; ///< [in] kernel argument index - size_t argSize; ///< [in] kernel argument size - const void* pArgValue; ///< [in] pointer to kernel argument value - -} ze_mutable_kernel_argument_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable kernel group count descriptor -typedef struct _ze_mutable_group_count_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). - uint64_t commandId; ///< [in] command identifier - const ze_group_count_t* pGroupCount; ///< [in] pointer to group count - -} ze_mutable_group_count_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable kernel group size descriptor -typedef struct _ze_mutable_group_size_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). - uint64_t commandId; ///< [in] command identifier - uint32_t groupSizeX; ///< [in] group size for X dimension to use for the kernel - uint32_t groupSizeY; ///< [in] group size for Y dimension to use for the kernel - uint32_t groupSizeZ; ///< [in] group size for Z dimension to use for the kernel - -} ze_mutable_group_size_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable kernel global offset descriptor -typedef struct _ze_mutable_global_offset_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). - uint64_t commandId; ///< [in] command identifier - uint32_t offsetX; ///< [in] global offset for X dimension to use for this kernel - uint32_t offsetY; ///< [in] global offset for Y dimension to use for this kernel - uint32_t offsetZ; ///< [in] global offset for Z dimension to use for this kernel - -} ze_mutable_global_offset_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Mutable graph argument descriptor -typedef struct _ze_mutable_graph_argument_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). - uint64_t commandId; ///< [in] command identifier - uint32_t argIndex; ///< [in] graph argument index - const void* pArgValue; ///< [in] pointer to graph argument value - -} ze_mutable_graph_argument_exp_desc_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns a unique command identifier for the next command to be -/// appended to a command list. +/// @brief Appends execution of an executable graph to a command list. /// /// @details -/// - This function may only be called for a mutable command list. -/// - This function may not be called on a closed command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - The destination command list must match the type and execution +/// characteristics of the command list used to initiate recording, +/// including the queue group ordinal and immediate mode configuration. +/// - Only one execution of the same executable graph object may run at a +/// time; concurrent graph execution requires multiple executable graph +/// instances. +/// - If this function is called while the executable graph is already +/// running, the new execution is scheduled after the current execution +/// completes. +/// - Graph execution obeys the implicit in-order dependency semantics of +/// the destination command list. +/// - If `hSignalEvent` is provided, it is signaled after all recorded +/// append operations on all recorded queues complete. +/// - If wait events are provided, graph execution does not begin until all +/// wait events are satisfied. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17171,31 +17140,22 @@ typedef struct _ze_mutable_graph_argument_exp_desc_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == pCommandId` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written +zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns a unique command identifier for the next command to be -/// appended to a command list. Provides possible kernel handles for -/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION -/// flag is present. -/// -/// @details -/// - This function may only be called for a mutable command list. -/// - This function may not be called on a closed command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// @brief Returns the recorded graph used to instantiate an executable graph. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17212,36 +17172,25 @@ zeCommandListGetNextCommandIdExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == pCommandId` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phSourceGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written +zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates mutable commands. +/// @brief Queries whether a graph is empty. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no +/// operations. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains +/// recorded operations. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17249,6 +17198,7 @@ zeCommandListGetNextCommandIdWithKernelsExp( /// - ::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 @@ -17257,25 +17207,20 @@ zeCommandListGetNextCommandIdWithKernelsExp( /// - ::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 == desc` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Invalid kernel argument or not matching update descriptor provided +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member +zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Query whether a command list was created with the mutable command list -/// extension. +/// @brief Writes a DOT description of a recorded graph to disk. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The generated DOT output captures the graph structure and recorded +/// append operations. +/// - Kernel node output includes kernel names, argument lists, and argument +/// types and values. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17292,31 +17237,25 @@ zeCommandListUpdateMutableCommandsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pIsMutable` +/// + `nullptr == filePath` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension +zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the signal event for a mutable command in a mutable command -/// list. +/// @brief Destroys an executable graph object. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The type, scope and flags of the signal event must match those of the -/// source command. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - The executable graph must not be in use or executing on any command +/// list when it is destroyed. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17333,34 +17272,20 @@ zeCommandListIsMutableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion +zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the wait events for a mutable command in a mutable command -/// list. +/// @brief Destroys a recorded graph object. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The number of wait events must match that of the source command. -/// - The type, scope and flags of the wait events must match those of the -/// source command. -/// - Passing `nullptr` as the wait events will update the command to not -/// wait on any events prior to dispatch. -/// - Passing `nullptr` as an event on event wait list will remove event -/// dependency from this wait list slot. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - All executable graph instances created from the recorded graph must be +/// destroyed before this function is called. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17377,33 +17302,45 @@ zeCommandListUpdateMutableCommandSignalEventExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + The `numWaitEvents` parameter does not match that of the original command. +/// + `nullptr == hGraph` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Append Host Function +#if !defined(__GNUC__) +#pragma region hostFunction +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Host Function callback type +typedef void (ZE_CALLBACK_CONV *ze_host_function_callback_t)( + void* pUserData ///< [in][optional] user data pointer ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the kernel for a mutable command in a mutable command list. +/// @brief Appends a host function call into a command list. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The kernel handle must be from the provided list for given command id. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - This function must be called before updating kernel arguments and -/// dispatch parameters, when kernel is mutated. -/// - 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. +/// - The host function will be executed on the host when the command list +/// reaches this point during execution. +/// - The host function callback must be of type +/// ::ze_host_function_callback_t. +/// - The host function must **not** call any Level Zero API functions. +/// - The host function may access USM shared and USM host allocations. +/// - The runtime invokes the host function asynchronously to API calls. +/// - Device may wait for preceding commands to finish before invoking the +/// callback (i.e. callbacks may introduce implicit synchronization point +/// on the device). +/// - Device will wait for all phWaitEvents to be signaled before executing +/// the host function. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17412,7 +17349,6 @@ zeCommandListUpdateMutableCommandWaitEventsExp( /// - ::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 @@ -17421,20 +17357,84 @@ zeCommandListUpdateMutableCommandWaitEventsExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCommandId` -/// + `nullptr == phKernels` -/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE -/// + Invalid kernel handle provided for the mutation kernel instruction operation. +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandKernelsExp( +zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Virtual Memory Read-Only Properties +#if !defined(__GNUC__) +#pragma region virtualMemReadOnlyProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME +/// @brief Virtual Memory Read-Only Properties Extension Name +#define ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME "ZE_extension_virtual_mem_readonly_properties" +#endif // ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Virtual Memory Read-Only Properties Extension Version(s) +typedef enum _ze_virtual_mem_readonly_properties_ext_version_t +{ + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_virtual_mem_readonly_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read-only memory page capability values +typedef enum _ze_device_readonly_memory_capability_t +{ + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE = 0, ///< Read-only attribute has no effect; the driver does not act on it. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT = 1, ///< Read-only attribute is a performance hint to the OS; writes may still + ///< succeed without fault. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED = 2, ///< Read-only attribute is hardware-enforced; writes to read-only pages + ///< will cause a device fault. + ZE_DEVICE_READONLY_MEMORY_CAPABILITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_READONLY_MEMORY_CAPABILITY_* ENUMs + +} ze_device_readonly_memory_capability_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device read-only memory capability properties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_readonly_memory_ext_properties_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). + ze_device_readonly_memory_capability_t readonlyCapability; ///< [out] Indicates device behavior when + ///< ::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no + ///< effect; writes succeed normally. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a + ///< performance hint; writes may still succeed. + ///< ::ZE_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is + ///< hardware-enforced; writes cause a device fault. + +} ze_device_readonly_memory_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/ze_ddi.h b/include/ze_ddi.h index a6204a24..580ad2c2 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZE_DDI_H @@ -286,93 +286,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationExpProcAddrTable_ ze_rtas_parallel_operation_exp_dditable_t* ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphCreateExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphCreateExt_t)( - ze_context_handle_t, - const void*, - ze_graph_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphGetPrimaryCommandListExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphGetPrimaryCommandListExt_t)( - ze_graph_handle_t, - ze_command_list_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphSetDestructionCallbackExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphSetDestructionCallbackExt_t)( - ze_graph_handle_t, - zex_mem_graph_free_callback_fn_t, - void*, - const void* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphInstantiateExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphInstantiateExt_t)( - ze_graph_handle_t, - const void*, - ze_executable_graph_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphIsEmptyExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphIsEmptyExt_t)( - ze_graph_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphDumpContentsExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphDumpContentsExt_t)( - ze_graph_handle_t, - const char*, - const void* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGraphDestroyExt -typedef ze_result_t (ZE_APICALL *ze_pfnGraphDestroyExt_t)( - ze_graph_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of Graph functions pointers -typedef struct _ze_graph_dditable_t -{ - ze_pfnGraphCreateExt_t pfnCreateExt; - ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt; - ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt; - ze_pfnGraphInstantiateExt_t pfnInstantiateExt; - ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt; - ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt; - ze_pfnGraphDestroyExt_t pfnDestroyExt; -} ze_graph_dditable_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGetGraphProcAddrTable -typedef ze_result_t (ZE_APICALL *ze_pfnGetGraphProcAddrTable_t)( - ze_api_version_t, - ze_graph_dditable_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeInit typedef ze_result_t (ZE_APICALL *ze_pfnInit_t)( @@ -417,49 +330,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetGlobalProcAddrTable_t)( ze_global_dditable_t* ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeExecutableGraphGetSourceGraphExt -typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphGetSourceGraphExt_t)( - ze_executable_graph_handle_t, - ze_graph_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeExecutableGraphDestroyExt -typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphDestroyExt_t)( - ze_executable_graph_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of ExecutableGraph functions pointers -typedef struct _ze_executable_graph_dditable_t -{ - ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt; - ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt; -} ze_executable_graph_dditable_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGetExecutableGraphProcAddrTable -typedef ze_result_t (ZE_APICALL *ze_pfnGetExecutableGraphProcAddrTable_t)( - ze_api_version_t, - ze_executable_graph_dditable_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeDriverGet typedef ze_result_t (ZE_APICALL *ze_pfnDriverGet_t)( @@ -3208,6 +3078,136 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetFabricEdgeExpProcAddrTable_t)( ze_fabric_edge_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphCreateExt_t)( + ze_context_handle_t, + const void*, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphGetPrimaryCommandListExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphGetPrimaryCommandListExt_t)( + ze_graph_handle_t, + ze_command_list_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphSetDestructionCallbackExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphSetDestructionCallbackExt_t)( + ze_graph_handle_t, + zex_mem_graph_free_callback_fn_t, + void*, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphInstantiateExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphInstantiateExt_t)( + ze_graph_handle_t, + const void*, + ze_executable_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphIsEmptyExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphIsEmptyExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphDumpContentsExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphDumpContentsExt_t)( + ze_graph_handle_t, + const char*, + const void* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphDestroyExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of Graph functions pointers +typedef struct _ze_graph_dditable_t +{ + ze_pfnGraphCreateExt_t pfnCreateExt; + ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt; + ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt; + ze_pfnGraphInstantiateExt_t pfnInstantiateExt; + ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt; + ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt; + ze_pfnGraphDestroyExt_t pfnDestroyExt; +} ze_graph_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetGraphProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetGraphProcAddrTable_t)( + ze_api_version_t, + ze_graph_dditable_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeExecutableGraphGetSourceGraphExt +typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphGetSourceGraphExt_t)( + ze_executable_graph_handle_t, + ze_graph_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeExecutableGraphDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnExecutableGraphDestroyExt_t)( + ze_executable_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of ExecutableGraph functions pointers +typedef struct _ze_executable_graph_dditable_t +{ + ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt; + ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt; +} ze_executable_graph_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetExecutableGraphProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetExecutableGraphProcAddrTable_t)( + ze_api_version_t, + ze_executable_graph_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Container for all DDI tables typedef struct _ze_dditable_t @@ -3216,9 +3216,7 @@ typedef struct _ze_dditable_t ze_rtas_builder_exp_dditable_t RTASBuilderExp; ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; - ze_graph_dditable_t Graph; ze_global_dditable_t Global; - ze_executable_graph_dditable_t ExecutableGraph; ze_driver_dditable_t Driver; ze_driver_exp_dditable_t DriverExp; ze_device_dditable_t Device; @@ -3244,6 +3242,8 @@ typedef struct _ze_dditable_t ze_virtual_mem_dditable_t VirtualMem; ze_fabric_vertex_exp_dditable_t FabricVertexExp; ze_fabric_edge_exp_dditable_t FabricEdgeExp; + ze_graph_dditable_t Graph; + ze_executable_graph_dditable_t ExecutableGraph; } ze_dditable_t; /// @brief Container for all DDI tables with version and tables set by the Driver typedef struct _ze_dditable_driver_t @@ -3254,9 +3254,7 @@ typedef struct _ze_dditable_driver_t ze_rtas_builder_exp_dditable_t * RTASBuilderExp; ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; - ze_graph_dditable_t * Graph; ze_global_dditable_t * Global; - ze_executable_graph_dditable_t * ExecutableGraph; ze_driver_dditable_t * Driver; ze_driver_exp_dditable_t * DriverExp; ze_device_dditable_t * Device; @@ -3282,6 +3280,8 @@ typedef struct _ze_dditable_driver_t ze_virtual_mem_dditable_t * VirtualMem; ze_fabric_vertex_exp_dditable_t * FabricVertexExp; ze_fabric_edge_exp_dditable_t * FabricEdgeExp; + ze_graph_dditable_t * Graph; + ze_executable_graph_dditable_t * ExecutableGraph; } ze_dditable_driver_t; #if defined(__cplusplus) diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index a73ba6db..8c58af0f 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zer.py b/include/zer.py index b983b735..b49058ad 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.23 + @version v1.17-r1.17.24 """ import platform diff --git a/include/zer_api.h b/include/zer_api.h index 6bacda3e..26623afb 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZER_API_H diff --git a/include/zer_ddi.h b/include/zer_ddi.h index 3828f3b7..de9b3e81 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZER_DDI_H diff --git a/include/zes.py b/include/zes.py index 99354236..11a13da9 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.23 + @version v1.17-r1.17.24 """ import platform @@ -2172,155 +2172,6 @@ class zes_temp_config_t(Structure): ## driver. ] -############################################################################### -## @brief Device ECC default properties Extension Name -ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME = "ZES_extension_device_ecc_default_properties" - -############################################################################### -## @brief Device ECC default properties Extension Version(s) -class zes_device_ecc_default_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 zes_device_ecc_default_properties_ext_version_t(c_int): - def __str__(self): - return str(zes_device_ecc_default_properties_ext_version_v(self.value)) - - -############################################################################### -## @brief This structure may be passed to ::zesDeviceGetEccState as pNext member -## of ::zes_device_ecc_properties_t. -class zes_device_ecc_default_properties_ext_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). - ("defaultState", zes_device_ecc_state_t) ## [out] Default ECC state - ] - -############################################################################### -## @brief PCI Link Speed Downgrade Extension Name -ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME = "ZES_extension_pci_link_speed_downgrade" - -############################################################################### -## @brief PCI Link Speed Downgrade Extension Version(s) -class zes_pci_link_speed_downgrade_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_pci_link_speed_downgrade_ext_version_t(c_int): - def __str__(self): - return str(zes_pci_link_speed_downgrade_ext_version_v(self.value)) - - -############################################################################### -## @brief Query PCIe downgrade status. -## -## @details -## - This structure can be passed in the 'pNext' of ::zes_pci_state_t -class zes_pci_link_speed_downgrade_ext_state_t(Structure): - _fields_ = [ - ("stype", zes_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). - ("pciLinkSpeedDowngradeStatus", ze_bool_t) ## [out] Returns the current PCIe downgrade status. - ] - -############################################################################### -## @brief Query PCIe downgrade capability. -## -## @details -## - This structure can be passed in the 'pNext' of ::zes_pci_properties_t -class zes_pci_link_speed_downgrade_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). - ("pciLinkSpeedUpdateCapable", ze_bool_t), ## [out] Returns if PCIe downgrade capability is available. - ("maxPciGenSupported", c_int32_t) ## [out] Returns the max supported PCIe generation of the device. -1 - ## indicates the information is not available - ] - -############################################################################### -## @brief Device State Extension Name -ZES_DEVICE_EXT_STATE_NAME = "ZES_extension_device_state" - -############################################################################### -## @brief Device State Extension Version(s) -class zes_device_ext_state_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_ext_state_version_t(c_int): - def __str__(self): - return str(zes_device_ext_state_version_v(self.value)) - - -############################################################################### -## @brief Device state flags -class zes_device_state_ext_flags_v(IntEnum): - NORMAL = ZE_BIT(0) ## The device is operating normally - 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 - -class zes_device_state_ext_flags_t(c_int): - def __str__(self): - return hex(self.value) - - -############################################################################### -## @brief 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 -class zes_device_ext_state_t(Structure): - _fields_ = [ - ("stype", zes_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). - ("flags", zes_device_state_ext_flags_t) ## [out] Device state flags. Returns 0 (if state cannot be determined) or - ## a combination of ::zes_device_state_ext_flags_t - ] - -############################################################################### -## @brief OEM Serial ID Extension Name -ZES_OEM_SERIAL_ID_EXT_NAME = "ZES_extension_oem_serial_id" - -############################################################################### -## @brief OEM Serial ID Extension Version(s) -class zes_oem_serial_id_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_oem_serial_id_ext_version_t(c_int): - def __str__(self): - return str(zes_oem_serial_id_ext_version_v(self.value)) - - -############################################################################### -## @brief Maximum OEM serial ID string size -ZES_OEM_SERIAL_ID_SIZE = 1024 - -############################################################################### -## @brief OEM Serial ID Properties structure -## -## @details -## - This structure can be passed as an extension structure to -## ::zesDeviceGetProperties via pNext member -## - Returns the OEM serial ID of the device -class zes_oem_serial_id_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). - ("length", c_ushort), ## [out] OEM serial ID length - ("oemSerialId", c_char * ZES_OEM_SERIAL_ID_SIZE) ## [out] OEM serial ID for the device. - ] - ############################################################################### ## @brief Power Limits Extension Name ZES_POWER_LIMITS_EXT_NAME = "ZES_extension_power_limits" @@ -2764,6 +2615,155 @@ class zes_vf_util_engine_exp2_t(Structure): ## Refer to the formulae above for calculating the utilization percent ] +############################################################################### +## @brief Device ECC default properties Extension Name +ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME = "ZES_extension_device_ecc_default_properties" + +############################################################################### +## @brief Device ECC default properties Extension Version(s) +class zes_device_ecc_default_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 zes_device_ecc_default_properties_ext_version_t(c_int): + def __str__(self): + return str(zes_device_ecc_default_properties_ext_version_v(self.value)) + + +############################################################################### +## @brief This structure may be passed to ::zesDeviceGetEccState as pNext member +## of ::zes_device_ecc_properties_t. +class zes_device_ecc_default_properties_ext_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). + ("defaultState", zes_device_ecc_state_t) ## [out] Default ECC state + ] + +############################################################################### +## @brief PCI Link Speed Downgrade Extension Name +ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME = "ZES_extension_pci_link_speed_downgrade" + +############################################################################### +## @brief PCI Link Speed Downgrade Extension Version(s) +class zes_pci_link_speed_downgrade_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_pci_link_speed_downgrade_ext_version_t(c_int): + def __str__(self): + return str(zes_pci_link_speed_downgrade_ext_version_v(self.value)) + + +############################################################################### +## @brief Query PCIe downgrade status. +## +## @details +## - This structure can be passed in the 'pNext' of ::zes_pci_state_t +class zes_pci_link_speed_downgrade_ext_state_t(Structure): + _fields_ = [ + ("stype", zes_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). + ("pciLinkSpeedDowngradeStatus", ze_bool_t) ## [out] Returns the current PCIe downgrade status. + ] + +############################################################################### +## @brief Query PCIe downgrade capability. +## +## @details +## - This structure can be passed in the 'pNext' of ::zes_pci_properties_t +class zes_pci_link_speed_downgrade_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). + ("pciLinkSpeedUpdateCapable", ze_bool_t), ## [out] Returns if PCIe downgrade capability is available. + ("maxPciGenSupported", c_int32_t) ## [out] Returns the max supported PCIe generation of the device. -1 + ## indicates the information is not available + ] + +############################################################################### +## @brief Device State Extension Name +ZES_DEVICE_EXT_STATE_NAME = "ZES_extension_device_state" + +############################################################################### +## @brief Device State Extension Version(s) +class zes_device_ext_state_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_ext_state_version_t(c_int): + def __str__(self): + return str(zes_device_ext_state_version_v(self.value)) + + +############################################################################### +## @brief Device state flags +class zes_device_state_ext_flags_v(IntEnum): + NORMAL = ZE_BIT(0) ## The device is operating normally + 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 + +class zes_device_state_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief 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 +class zes_device_ext_state_t(Structure): + _fields_ = [ + ("stype", zes_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). + ("flags", zes_device_state_ext_flags_t) ## [out] Device state flags. Returns 0 (if state cannot be determined) or + ## a combination of ::zes_device_state_ext_flags_t + ] + +############################################################################### +## @brief OEM Serial ID Extension Name +ZES_OEM_SERIAL_ID_EXT_NAME = "ZES_extension_oem_serial_id" + +############################################################################### +## @brief OEM Serial ID Extension Version(s) +class zes_oem_serial_id_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_oem_serial_id_ext_version_t(c_int): + def __str__(self): + return str(zes_oem_serial_id_ext_version_v(self.value)) + + +############################################################################### +## @brief Maximum OEM serial ID string size +ZES_OEM_SERIAL_ID_SIZE = 1024 + +############################################################################### +## @brief OEM Serial ID Properties structure +## +## @details +## - This structure can be passed as an extension structure to +## ::zesDeviceGetProperties via pNext member +## - Returns the OEM serial ID of the device +class zes_oem_serial_id_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). + ("length", c_ushort), ## [out] OEM serial ID length + ("oemSerialId", c_char * ZES_OEM_SERIAL_ID_SIZE) ## [out] OEM serial ID for the device. + ] + ############################################################################### __use_win_types = "Windows" == platform.uname()[0] diff --git a/include/zes_api.h b/include/zes_api.h index e93a359b..00103a27 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZES_API_H @@ -515,26 +515,6 @@ typedef struct _zes_temp_threshold_t zes_temp_threshold_t; /// @brief Forward-declare zes_temp_config_t typedef struct _zes_temp_config_t zes_temp_config_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zes_device_ecc_default_properties_ext_t -typedef struct _zes_device_ecc_default_properties_ext_t zes_device_ecc_default_properties_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zes_pci_link_speed_downgrade_ext_state_t -typedef struct _zes_pci_link_speed_downgrade_ext_state_t zes_pci_link_speed_downgrade_ext_state_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zes_pci_link_speed_downgrade_ext_properties_t -typedef struct _zes_pci_link_speed_downgrade_ext_properties_t zes_pci_link_speed_downgrade_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zes_device_ext_state_t -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_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -603,6 +583,26 @@ typedef struct _zes_vf_util_mem_exp2_t zes_vf_util_mem_exp2_t; /// @brief Forward-declare zes_vf_util_engine_exp2_t typedef struct _zes_vf_util_engine_exp2_t zes_vf_util_engine_exp2_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_device_ecc_default_properties_ext_t +typedef struct _zes_device_ecc_default_properties_ext_t zes_device_ecc_default_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_pci_link_speed_downgrade_ext_state_t +typedef struct _zes_pci_link_speed_downgrade_ext_state_t zes_pci_link_speed_downgrade_ext_state_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_pci_link_speed_downgrade_ext_properties_t +typedef struct _zes_pci_link_speed_downgrade_ext_properties_t zes_pci_link_speed_downgrade_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_device_ext_state_t +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; + #if !defined(__GNUC__) #pragma endregion @@ -7466,229 +7466,6 @@ zesTemperatureGetState( ///< in degrees Celsius. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Sysman Extension APIs Device-ECC default properties -#if !defined(__GNUC__) -#pragma region eccState -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME -/// @brief Device ECC default properties Extension Name -#define ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME "ZES_extension_device_ecc_default_properties" -#endif // ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Device ECC default properties Extension Version(s) -typedef enum _zes_device_ecc_default_properties_ext_version_t -{ - ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 - ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_* ENUMs - -} zes_device_ecc_default_properties_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief This structure may be passed to ::zesDeviceGetEccState as pNext member -/// of ::zes_device_ecc_properties_t. -typedef struct _zes_device_ecc_default_properties_ext_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). - zes_device_ecc_state_t defaultState; ///< [out] Default ECC state - -} zes_device_ecc_default_properties_ext_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Sysman Extension APIs for PCI Link Speed Downgrade -#if !defined(__GNUC__) -#pragma region pciLinkSpeedDowngrade -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME -/// @brief PCI Link Speed Downgrade Extension Name -#define ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME "ZES_extension_pci_link_speed_downgrade" -#endif // ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief PCI Link Speed Downgrade Extension Version(s) -typedef enum _zes_pci_link_speed_downgrade_ext_version_t -{ - ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_* ENUMs - -} zes_pci_link_speed_downgrade_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Query PCIe downgrade status. -/// -/// @details -/// - This structure can be passed in the 'pNext' of ::zes_pci_state_t -typedef struct _zes_pci_link_speed_downgrade_ext_state_t -{ - zes_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_bool_t pciLinkSpeedDowngradeStatus; ///< [out] Returns the current PCIe downgrade status. - -} zes_pci_link_speed_downgrade_ext_state_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Query PCIe downgrade capability. -/// -/// @details -/// - This structure can be passed in the 'pNext' of ::zes_pci_properties_t -typedef struct _zes_pci_link_speed_downgrade_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). - ze_bool_t pciLinkSpeedUpdateCapable; ///< [out] Returns if PCIe downgrade capability is available. - int32_t maxPciGenSupported; ///< [out] Returns the max supported PCIe generation of the device. -1 - ///< indicates the information is not available - -} zes_pci_link_speed_downgrade_ext_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Update PCI Link Speed (Downgrade or Upgrade (restore to its default -/// speed)) -/// -/// @details -/// - This function allows updating the PCI link speed to downgrade or -/// upgrade (restore to its default speed) the connection. -/// -/// @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_NULL_POINTER -/// + `nullptr == pendingAction` -/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS -/// + User does not have permissions to perform this operation. -ZE_APIEXPORT ze_result_t ZE_APICALL -zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ); - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Device State -#if !defined(__GNUC__) -#pragma region deviceState -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZES_DEVICE_EXT_STATE_NAME -/// @brief Device State Extension Name -#define ZES_DEVICE_EXT_STATE_NAME "ZES_extension_device_state" -#endif // ZES_DEVICE_EXT_STATE_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Device State Extension Version(s) -typedef enum _zes_device_ext_state_version_t -{ - ZES_DEVICE_EXT_STATE_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZES_DEVICE_EXT_STATE_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_DEVICE_EXT_STATE_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_EXT_STATE_VERSION_* ENUMs - -} zes_device_ext_state_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Device state flags -typedef uint32_t zes_device_state_ext_flags_t; -typedef enum _zes_device_state_ext_flag_t -{ - ZES_DEVICE_STATE_EXT_FLAG_NORMAL = ZE_BIT(0), ///< The device is operating normally - 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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_STATE_EXT_FLAG_* ENUMs - -} zes_device_state_ext_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief 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 -typedef struct _zes_device_ext_state_t -{ - zes_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). - zes_device_state_ext_flags_t flags; ///< [out] Device state flags. Returns 0 (if state cannot be determined) or - ///< a combination of ::zes_device_state_ext_flags_t - -} zes_device_ext_state_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Sysman Extension APIs for OEM Serial ID -#if !defined(__GNUC__) -#pragma region oemSerialId -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZES_OEM_SERIAL_ID_EXT_NAME -/// @brief OEM Serial ID Extension Name -#define ZES_OEM_SERIAL_ID_EXT_NAME "ZES_extension_oem_serial_id" -#endif // ZES_OEM_SERIAL_ID_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief OEM Serial ID Extension Version(s) -typedef enum _zes_oem_serial_id_ext_version_t -{ - ZES_OEM_SERIAL_ID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZES_OEM_SERIAL_ID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_OEM_SERIAL_ID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_OEM_SERIAL_ID_EXT_VERSION_* ENUMs - -} zes_oem_serial_id_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZES_OEM_SERIAL_ID_SIZE -/// @brief Maximum OEM serial ID string size -#define ZES_OEM_SERIAL_ID_SIZE 1024 -#endif // ZES_OEM_SERIAL_ID_SIZE - -/////////////////////////////////////////////////////////////////////////////// -/// @brief OEM Serial ID Properties structure -/// -/// @details -/// - This structure can be passed as an extension structure to -/// ::zesDeviceGetProperties via pNext member -/// - Returns the OEM serial ID of the device -typedef struct _zes_oem_serial_id_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). - uint16_t length; ///< [out] OEM serial ID length - char oemSerialId[ZES_OEM_SERIAL_ID_SIZE]; ///< [out] OEM serial ID for the device. - -} zes_oem_serial_id_ext_properties_t; - #if !defined(__GNUC__) #pragma endregion #endif @@ -9226,6 +9003,229 @@ zesVFManagementGetVFCapabilitiesExp2( zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs Device-ECC default properties +#if !defined(__GNUC__) +#pragma region eccState +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME +/// @brief Device ECC default properties Extension Name +#define ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME "ZES_extension_device_ecc_default_properties" +#endif // ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device ECC default properties Extension Version(s) +typedef enum _zes_device_ecc_default_properties_ext_version_t +{ + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_* ENUMs + +} zes_device_ecc_default_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief This structure may be passed to ::zesDeviceGetEccState as pNext member +/// of ::zes_device_ecc_properties_t. +typedef struct _zes_device_ecc_default_properties_ext_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). + zes_device_ecc_state_t defaultState; ///< [out] Default ECC state + +} zes_device_ecc_default_properties_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for PCI Link Speed Downgrade +#if !defined(__GNUC__) +#pragma region pciLinkSpeedDowngrade +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME +/// @brief PCI Link Speed Downgrade Extension Name +#define ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME "ZES_extension_pci_link_speed_downgrade" +#endif // ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief PCI Link Speed Downgrade Extension Version(s) +typedef enum _zes_pci_link_speed_downgrade_ext_version_t +{ + ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_* ENUMs + +} zes_pci_link_speed_downgrade_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query PCIe downgrade status. +/// +/// @details +/// - This structure can be passed in the 'pNext' of ::zes_pci_state_t +typedef struct _zes_pci_link_speed_downgrade_ext_state_t +{ + zes_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_bool_t pciLinkSpeedDowngradeStatus; ///< [out] Returns the current PCIe downgrade status. + +} zes_pci_link_speed_downgrade_ext_state_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query PCIe downgrade capability. +/// +/// @details +/// - This structure can be passed in the 'pNext' of ::zes_pci_properties_t +typedef struct _zes_pci_link_speed_downgrade_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). + ze_bool_t pciLinkSpeedUpdateCapable; ///< [out] Returns if PCIe downgrade capability is available. + int32_t maxPciGenSupported; ///< [out] Returns the max supported PCIe generation of the device. -1 + ///< indicates the information is not available + +} zes_pci_link_speed_downgrade_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Update PCI Link Speed (Downgrade or Upgrade (restore to its default +/// speed)) +/// +/// @details +/// - This function allows updating the PCI link speed to downgrade or +/// upgrade (restore to its default speed) the connection. +/// +/// @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_NULL_POINTER +/// + `nullptr == pendingAction` +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to perform this operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Device State +#if !defined(__GNUC__) +#pragma region deviceState +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_EXT_STATE_NAME +/// @brief Device State Extension Name +#define ZES_DEVICE_EXT_STATE_NAME "ZES_extension_device_state" +#endif // ZES_DEVICE_EXT_STATE_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device State Extension Version(s) +typedef enum _zes_device_ext_state_version_t +{ + ZES_DEVICE_EXT_STATE_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_DEVICE_EXT_STATE_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_DEVICE_EXT_STATE_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_EXT_STATE_VERSION_* ENUMs + +} zes_device_ext_state_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device state flags +typedef uint32_t zes_device_state_ext_flags_t; +typedef enum _zes_device_state_ext_flag_t +{ + ZES_DEVICE_STATE_EXT_FLAG_NORMAL = ZE_BIT(0), ///< The device is operating normally + 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_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_STATE_EXT_FLAG_* ENUMs + +} zes_device_state_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 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 +typedef struct _zes_device_ext_state_t +{ + zes_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). + zes_device_state_ext_flags_t flags; ///< [out] Device state flags. Returns 0 (if state cannot be determined) or + ///< a combination of ::zes_device_state_ext_flags_t + +} zes_device_ext_state_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for OEM Serial ID +#if !defined(__GNUC__) +#pragma region oemSerialId +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_OEM_SERIAL_ID_EXT_NAME +/// @brief OEM Serial ID Extension Name +#define ZES_OEM_SERIAL_ID_EXT_NAME "ZES_extension_oem_serial_id" +#endif // ZES_OEM_SERIAL_ID_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief OEM Serial ID Extension Version(s) +typedef enum _zes_oem_serial_id_ext_version_t +{ + ZES_OEM_SERIAL_ID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_OEM_SERIAL_ID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_OEM_SERIAL_ID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_OEM_SERIAL_ID_EXT_VERSION_* ENUMs + +} zes_oem_serial_id_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_OEM_SERIAL_ID_SIZE +/// @brief Maximum OEM serial ID string size +#define ZES_OEM_SERIAL_ID_SIZE 1024 +#endif // ZES_OEM_SERIAL_ID_SIZE + +/////////////////////////////////////////////////////////////////////////////// +/// @brief OEM Serial ID Properties structure +/// +/// @details +/// - This structure can be passed as an extension structure to +/// ::zesDeviceGetProperties via pNext member +/// - Returns the OEM serial ID of the device +typedef struct _zes_oem_serial_id_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). + uint16_t length; ///< [out] OEM serial ID length + char oemSerialId[ZES_OEM_SERIAL_ID_SIZE]; ///< [out] OEM serial ID for the device. + +} zes_oem_serial_id_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/zes_ddi.h b/include/zes_ddi.h index 70ce6894..513ffa74 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZES_DDI_H diff --git a/include/zet.py b/include/zet.py index c68a9e2d..9c86340f 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.23 + @version v1.17-r1.17.24 """ import platform @@ -602,170 +602,6 @@ class zet_tracer_exp_desc_t(Structure): ("pUserData", c_void_p) ## [in] pointer passed to every tracer's callbacks ] -############################################################################### -## @brief Concurrent Metric Groups Experimental Extension Name -ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME = "ZET_experimental_concurrent_metric_groups" - -############################################################################### -## @brief Concurrent Metric Groups Experimental Extension Version(s) -class zet_concurrent_metric_groups_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class zet_concurrent_metric_groups_exp_version_t(c_int): - def __str__(self): - return str(zet_concurrent_metric_groups_exp_version_v(self.value)) - - -############################################################################### -## @brief Metric Tracer Experimental Extension Name -ZET_METRICS_TRACER_EXP_NAME = "ZET_experimental_metric_tracer" - -############################################################################### -## @brief Metric Tracer Experimental Extension Version(s) -class zet_metric_tracer_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class zet_metric_tracer_exp_version_t(c_int): - def __str__(self): - return str(zet_metric_tracer_exp_version_v(self.value)) - - -############################################################################### -## @brief Handle of metric tracer's object -class zet_metric_tracer_exp_handle_t(c_void_p): - pass - -############################################################################### -## @brief Handle of metric decoder's object -class zet_metric_decoder_exp_handle_t(c_void_p): - pass - -############################################################################### -## @brief Metric tracer descriptor -class zet_metric_tracer_exp_desc_t(Structure): - _fields_ = [ - ("stype", zet_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). - ("notifyEveryNBytes", c_ulong) ## [in,out] number of collected bytes after which notification event will - ## be signaled. If the requested value is not supported exactly, then the - ## driver may use a value that is the closest supported approximation and - ## shall update this member during ::zetMetricTracerCreateExp. - ] - -############################################################################### -## @brief Decoded metric entry -class zet_metric_entry_exp_t(Structure): - _fields_ = [ - ("value", zet_value_t), ## [out] value of the decodable metric entry or event. Number is - ## meaningful based on the metric type. - ("timeStamp", c_ulonglong), ## [out] timestamp at which the event happened. - ("metricIndex", c_ulong), ## [out] index to the decodable metric handle in the input array - ## (phMetric) in ::zetMetricTracerDecodeExp(). - ("onSubdevice", ze_bool_t), ## [out] True if the event occurred on a sub-device; false means the - ## device on which the metric tracer was opened does not have - ## sub-devices. - ("subdeviceId", c_ulong) ## [out] If onSubdevice is true, this gives the ID of the sub-device. - ] - -############################################################################### -## @brief Metric Export Memory Experimental Extension Name -ZET_METRIC_EXPORT_MEMORY_EXP_NAME = "ZET_experimental_metric_export_memory" - -############################################################################### -## @brief Metric Export Memory Experimental Extension Version(s) -class zet_metric_export_memory_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class zet_metric_export_memory_exp_version_t(c_int): - def __str__(self): - return str(zet_metric_export_memory_exp_version_v(self.value)) - - -############################################################################### -## @brief Metric group type -class zet_metric_group_type_exp_flags_v(IntEnum): - EXPORT_DMA_BUF = ZE_BIT(0) ## Metric group and metrics exports memory using linux dma-buf, which - ## could be imported/mapped to the host process. Properties of the - ## dma_buf could be queried using ::zet_export_dma_buf_exp_properties_t. - USER_CREATED = ZE_BIT(1) ## Metric group created using ::zetDeviceCreateMetricGroupsFromMetricsExp - OTHER = ZE_BIT(2) ## Metric group which has a collection of metrics - MARKER = ZE_BIT(3) ## Metric group is capable of generating Marker metric - -class zet_metric_group_type_exp_flags_t(c_int): - def __str__(self): - return hex(self.value) - - -############################################################################### -## @brief Query the metric group type using `pNext` of -## ::zet_metric_group_properties_t -class zet_metric_group_type_exp_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). - ("type", zet_metric_group_type_exp_flags_t) ## [out] metric group type. - ## returns a combination of ::zet_metric_group_type_exp_flags_t. - ] - -############################################################################### -## @brief Exported dma_buf properties queried using `pNext` of -## ::zet_metric_group_properties_t or ::zet_metric_properties_t -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. - ("size", c_size_t) ## [out] size in bytes of the dma_buf - ] - -############################################################################### -## @brief Marker Support Using MetricGroup Experimental Extension Name -ZET_METRIC_GROUP_MARKER_EXP_NAME = "ZET_experimental_metric_group_marker" - -############################################################################### -## @brief Marker Support Using MetricGroup Experimental Extension Version(s) -class zet_metric_group_marker_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class zet_metric_group_marker_exp_version_t(c_int): - def __str__(self): - return str(zet_metric_group_marker_exp_version_v(self.value)) - - -############################################################################### -## @brief Query the metric source unique identifier using `pNext` of -## ::zet_metric_group_properties_t -class zet_metric_source_id_exp_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). - ("sourceId", c_ulong) ## [out] unique number representing the Metric Source. - ] - -############################################################################### -## @brief Runtime Enabling and Disabling Metrics Extension Name -ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME = "ZET_experimental_metrics_runtime_enable_disable" - -############################################################################### -## @brief Runtime Enabling and Disabling Metrics Extension Version(s) -class zet_metrics_runtime_enable_disable_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class zet_metrics_runtime_enable_disable_exp_version_t(c_int): - def __str__(self): - return str(zet_metrics_runtime_enable_disable_exp_version_v(self.value)) - - ############################################################################### ## @brief Calculating Multiple Metrics Experimental Extension Name ZET_MULTI_METRICS_EXP_NAME = "ZET_experimental_calculate_multiple_metrics" @@ -1023,6 +859,170 @@ class zet_metric_programmable_param_value_exp_t(Structure): ("value", zet_value_t) ## [in] parameter value ] +############################################################################### +## @brief Concurrent Metric Groups Experimental Extension Name +ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME = "ZET_experimental_concurrent_metric_groups" + +############################################################################### +## @brief Concurrent Metric Groups Experimental Extension Version(s) +class zet_concurrent_metric_groups_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zet_concurrent_metric_groups_exp_version_t(c_int): + def __str__(self): + return str(zet_concurrent_metric_groups_exp_version_v(self.value)) + + +############################################################################### +## @brief Metric Tracer Experimental Extension Name +ZET_METRICS_TRACER_EXP_NAME = "ZET_experimental_metric_tracer" + +############################################################################### +## @brief Metric Tracer Experimental Extension Version(s) +class zet_metric_tracer_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zet_metric_tracer_exp_version_t(c_int): + def __str__(self): + return str(zet_metric_tracer_exp_version_v(self.value)) + + +############################################################################### +## @brief Handle of metric tracer's object +class zet_metric_tracer_exp_handle_t(c_void_p): + pass + +############################################################################### +## @brief Handle of metric decoder's object +class zet_metric_decoder_exp_handle_t(c_void_p): + pass + +############################################################################### +## @brief Metric tracer descriptor +class zet_metric_tracer_exp_desc_t(Structure): + _fields_ = [ + ("stype", zet_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). + ("notifyEveryNBytes", c_ulong) ## [in,out] number of collected bytes after which notification event will + ## be signaled. If the requested value is not supported exactly, then the + ## driver may use a value that is the closest supported approximation and + ## shall update this member during ::zetMetricTracerCreateExp. + ] + +############################################################################### +## @brief Decoded metric entry +class zet_metric_entry_exp_t(Structure): + _fields_ = [ + ("value", zet_value_t), ## [out] value of the decodable metric entry or event. Number is + ## meaningful based on the metric type. + ("timeStamp", c_ulonglong), ## [out] timestamp at which the event happened. + ("metricIndex", c_ulong), ## [out] index to the decodable metric handle in the input array + ## (phMetric) in ::zetMetricTracerDecodeExp(). + ("onSubdevice", ze_bool_t), ## [out] True if the event occurred on a sub-device; false means the + ## device on which the metric tracer was opened does not have + ## sub-devices. + ("subdeviceId", c_ulong) ## [out] If onSubdevice is true, this gives the ID of the sub-device. + ] + +############################################################################### +## @brief Metric Export Memory Experimental Extension Name +ZET_METRIC_EXPORT_MEMORY_EXP_NAME = "ZET_experimental_metric_export_memory" + +############################################################################### +## @brief Metric Export Memory Experimental Extension Version(s) +class zet_metric_export_memory_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zet_metric_export_memory_exp_version_t(c_int): + def __str__(self): + return str(zet_metric_export_memory_exp_version_v(self.value)) + + +############################################################################### +## @brief Metric group type +class zet_metric_group_type_exp_flags_v(IntEnum): + EXPORT_DMA_BUF = ZE_BIT(0) ## Metric group and metrics exports memory using linux dma-buf, which + ## could be imported/mapped to the host process. Properties of the + ## dma_buf could be queried using ::zet_export_dma_buf_exp_properties_t. + USER_CREATED = ZE_BIT(1) ## Metric group created using ::zetDeviceCreateMetricGroupsFromMetricsExp + OTHER = ZE_BIT(2) ## Metric group which has a collection of metrics + MARKER = ZE_BIT(3) ## Metric group is capable of generating Marker metric + +class zet_metric_group_type_exp_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Query the metric group type using `pNext` of +## ::zet_metric_group_properties_t +class zet_metric_group_type_exp_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). + ("type", zet_metric_group_type_exp_flags_t) ## [out] metric group type. + ## returns a combination of ::zet_metric_group_type_exp_flags_t. + ] + +############################################################################### +## @brief Exported dma_buf properties queried using `pNext` of +## ::zet_metric_group_properties_t or ::zet_metric_properties_t +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. + ("size", c_size_t) ## [out] size in bytes of the dma_buf + ] + +############################################################################### +## @brief Marker Support Using MetricGroup Experimental Extension Name +ZET_METRIC_GROUP_MARKER_EXP_NAME = "ZET_experimental_metric_group_marker" + +############################################################################### +## @brief Marker Support Using MetricGroup Experimental Extension Version(s) +class zet_metric_group_marker_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zet_metric_group_marker_exp_version_t(c_int): + def __str__(self): + return str(zet_metric_group_marker_exp_version_v(self.value)) + + +############################################################################### +## @brief Query the metric source unique identifier using `pNext` of +## ::zet_metric_group_properties_t +class zet_metric_source_id_exp_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). + ("sourceId", c_ulong) ## [out] unique number representing the Metric Source. + ] + +############################################################################### +## @brief Runtime Enabling and Disabling Metrics Extension Name +ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME = "ZET_experimental_metrics_runtime_enable_disable" + +############################################################################### +## @brief Runtime Enabling and Disabling Metrics Extension Version(s) +class zet_metrics_runtime_enable_disable_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zet_metrics_runtime_enable_disable_exp_version_t(c_int): + def __str__(self): + return str(zet_metrics_runtime_enable_disable_exp_version_v(self.value)) + + ############################################################################### __use_win_types = "Windows" == platform.uname()[0] diff --git a/include/zet_api.h b/include/zet_api.h index 983b7117..717f41b5 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZET_API_H @@ -254,26 +254,6 @@ typedef struct _zet_profile_register_sequence_t zet_profile_register_sequence_t; /// @brief Forward-declare zet_tracer_exp_desc_t typedef struct _zet_tracer_exp_desc_t zet_tracer_exp_desc_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zet_metric_tracer_exp_desc_t -typedef struct _zet_metric_tracer_exp_desc_t zet_metric_tracer_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zet_metric_entry_exp_t -typedef struct _zet_metric_entry_exp_t zet_metric_entry_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zet_metric_group_type_exp_t -typedef struct _zet_metric_group_type_exp_t zet_metric_group_type_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zet_export_dma_buf_exp_properties_t -typedef struct _zet_export_dma_buf_exp_properties_t zet_export_dma_buf_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare zet_metric_source_id_exp_t -typedef struct _zet_metric_source_id_exp_t zet_metric_source_id_exp_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare zet_metric_global_timestamps_resolution_exp_t typedef struct _zet_metric_global_timestamps_resolution_exp_t zet_metric_global_timestamps_resolution_exp_t; @@ -306,6 +286,26 @@ typedef struct _zet_metric_programmable_param_value_info_exp_t zet_metric_progra /// @brief Forward-declare zet_metric_programmable_param_value_exp_t typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmable_param_value_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_tracer_exp_desc_t +typedef struct _zet_metric_tracer_exp_desc_t zet_metric_tracer_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_entry_exp_t +typedef struct _zet_metric_entry_exp_t zet_metric_entry_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_group_type_exp_t +typedef struct _zet_metric_group_type_exp_t zet_metric_group_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_export_dma_buf_exp_properties_t +typedef struct _zet_export_dma_buf_exp_properties_t zet_export_dma_buf_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_source_id_exp_t +typedef struct _zet_metric_source_id_exp_t zet_metric_source_id_exp_t; + #if !defined(__GNUC__) #pragma endregion @@ -2204,32 +2204,39 @@ zetTracerExpSetEnabled( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension to get Concurrent Metric Groups +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Calculating Multiple Metrics #if !defined(__GNUC__) -#pragma region concurrentMetricGroup +#pragma region multiMetricValues #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME -/// @brief Concurrent Metric Groups Experimental Extension Name -#define ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME "ZET_experimental_concurrent_metric_groups" -#endif // ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME +#ifndef ZET_MULTI_METRICS_EXP_NAME +/// @brief Calculating Multiple Metrics Experimental Extension Name +#define ZET_MULTI_METRICS_EXP_NAME "ZET_experimental_calculate_multiple_metrics" +#endif // ZET_MULTI_METRICS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Concurrent Metric Groups Experimental Extension Version(s) -typedef enum _zet_concurrent_metric_groups_exp_version_t +/// @brief Calculating Multiple Metrics Experimental Extension Version(s) +typedef enum _ze_calculate_multiple_metrics_exp_version_t { - ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_* ENUMs + ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 + ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_* ENUMs -} zet_concurrent_metric_groups_exp_version_t; +} ze_calculate_multiple_metrics_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Get sets of metric groups which could be collected concurrently. +/// @brief Calculate one or more sets of metric values from raw data. /// /// @details -/// - Re-arrange the input metric groups to provide sets of concurrent -/// metric groups. +/// - This function is similar to ::zetMetricGroupCalculateMetricValues +/// except it may calculate more than one set of metric values from a +/// single data buffer. There may be one set of metric values for each +/// sub-device, for example. +/// - Each set of metric values may consist of a different number of metric +/// values, returned as the metric value count. +/// - All metric values are calculated into a single buffer; use the metric +/// counts to determine which metric values belong to which set. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2246,97 +2253,91 @@ typedef enum _zet_concurrent_metric_groups_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawData` +/// + `nullptr == pSetCount` +/// + `nullptr == pTotalMetricValueCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup, ///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. +zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics Tracer +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Global Metric Timestamps #if !defined(__GNUC__) -#pragma region metricTracer +#pragma region GlobalTimestamps #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_METRICS_TRACER_EXP_NAME -/// @brief Metric Tracer Experimental Extension Name -#define ZET_METRICS_TRACER_EXP_NAME "ZET_experimental_metric_tracer" -#endif // ZET_METRICS_TRACER_EXP_NAME +#ifndef ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME +/// @brief Global Metric Timestamps Experimental Extension Name +#define ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME "ZET_experimental_global_metric_timestamps" +#endif // ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Tracer Experimental Extension Version(s) -typedef enum _zet_metric_tracer_exp_version_t +/// @brief Global Metric Timestamps Experimental Extension Version(s) +typedef enum _ze_metric_global_timestamps_exp_version_t { - ZET_METRIC_TRACER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_METRIC_TRACER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_METRIC_TRACER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_TRACER_EXP_VERSION_* ENUMs - -} zet_metric_tracer_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of metric tracer's object -typedef struct _zet_metric_tracer_exp_handle_t *zet_metric_tracer_exp_handle_t; + ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of metric decoder's object -typedef struct _zet_metric_decoder_exp_handle_t *zet_metric_decoder_exp_handle_t; +} ze_metric_global_timestamps_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Metric tracer descriptor -typedef struct _zet_metric_tracer_exp_desc_t +/// @brief Metric timestamps resolution +/// +/// @details +/// - This structure may be returned from ::zetMetricGroupGetProperties via +/// the `pNext` member of ::zet_metric_group_properties_t. +/// - Used for mapping metric timestamps to other timers. +typedef struct _zet_metric_global_timestamps_resolution_exp_t { zet_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 notifyEveryNBytes; ///< [in,out] number of collected bytes after which notification event will - ///< be signaled. If the requested value is not supported exactly, then the - ///< driver may use a value that is the closest supported approximation and - ///< shall update this member during ::zetMetricTracerCreateExp. - -} zet_metric_tracer_exp_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Decoded metric entry -typedef struct _zet_metric_entry_exp_t -{ - zet_value_t value; ///< [out] value of the decodable metric entry or event. Number is - ///< meaningful based on the metric type. - uint64_t timeStamp; ///< [out] timestamp at which the event happened. - uint32_t metricIndex; ///< [out] index to the decodable metric handle in the input array - ///< (phMetric) in ::zetMetricTracerDecodeExp(). - ze_bool_t onSubdevice; ///< [out] True if the event occurred on a sub-device; false means the - ///< device on which the metric tracer was opened does not have - ///< sub-devices. - uint32_t subdeviceId; ///< [out] If onSubdevice is true, this gives the ID of the sub-device. + uint64_t timerResolution; ///< [out] Returns the resolution of metrics timer (used for timestamps) in + ///< cycles/sec. + uint64_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. (i.e + ///< can be used to calculate the max value of the hardware timestamp + ///< register or can be use to generate the mask of valid bits in the + ///< timestamp value) -} zet_metric_entry_exp_t; +} zet_metric_global_timestamps_resolution_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Create a metric tracer for a device. +/// @brief Returns metric timestamps synchronized with either host or device +/// timestamps at the time of invoking the function /// /// @details -/// - The notification event must have been created from an event pool that -/// was created using ::ZE_EVENT_POOL_FLAG_HOST_VISIBLE flag. -/// - The duration of the signal event created from an event pool that was -/// created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. -/// However, for consistency and orthogonality the event will report -/// correctly as signaled when used by other event API functionality. -/// - The application must **not** call this function from simultaneous -/// threads with the same device handle. -/// - The metric tracer is created in disabled state -/// - Metric groups must support sampling type -/// ZET_METRIC_SAMPLING_TYPE_EXP_FLAG_TRACER_BASED -/// - All metric groups must be first activated +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2353,100 +2354,77 @@ typedef struct _zet_metric_entry_exp_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phMetricGroups` -/// + `nullptr == desc` -/// + `nullptr == phMetricTracer` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// + `nullptr == globalTimestamp` +/// + `nullptr == metricTimestamp` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer +zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Exporting Metrics Data +#if !defined(__GNUC__) +#pragma region metricExportData +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric tracer. -/// -/// @details -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. -/// -/// @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 == hMetricTracer` -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer - ); +#ifndef ZET_EXPORT_METRICS_DATA_EXP_NAME +/// @brief Exporting Metrics Data Experimental Extension Name +#define ZET_EXPORT_METRICS_DATA_EXP_NAME "ZET_experimental_metric_export_data" +#endif // ZET_EXPORT_METRICS_DATA_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Start events collection -/// -/// @details -/// - Driver implementations must make this API call have as minimal -/// overhead as possible, to allow applications start/stop event -/// collection at any point during execution -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. -/// -/// @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 == hMetricTracer` -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. - ); +/// @brief Exporting Metrics Data Experimental Extension Version(s) +typedef enum _zet_export_metric_data_exp_version_t +{ + ZET_EXPORT_METRIC_DATA_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_EXPORT_METRIC_DATA_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_EXPORT_METRIC_DATA_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_EXPORT_METRIC_DATA_EXP_VERSION_* ENUMs + +} zet_export_metric_data_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Stop events collection +#ifndef ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP +/// @brief Maximum count of characters in export data element name +#define ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP 256 +#endif // ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP +/// @brief Maximum export data element description string size +#define ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP 256 +#endif // ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metrics calculation descriptor +typedef struct _zet_metric_calculate_exp_desc_t +{ + zet_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 rawReportSkipCount; ///< [in] number of reports to skip during calculation + +} zet_metric_calculate_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Export Metrics Data for system independent calculation. /// /// @details -/// - Driver implementations must make this API call have as minimal -/// overhead as possible, to allow applications start/stop event -/// collection at any point during execution -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. +/// - This function exports raw data and necessary information to perform +/// metrics calculation of collected data in a different system than where +/// data was collected, which may or may not have accelerators. +/// - Implementations can choose to describe the data arrangement of the +/// exported data, using any mechanism which allows users to read and +/// process them. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2463,26 +2441,35 @@ zetMetricTracerEnableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawData` +/// + `nullptr == pExportDataSize` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. +zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Read data from the metric tracer +/// @brief Calculate one or more sets of metric values from exported raw data. /// /// @details -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. -/// - Data can be retrieved after tracer is disabled. When buffers are -/// drained ::ZE_RESULT_NOT_READY will be returned +/// - Calculate metrics values using exported data returned by +/// ::zetMetricGroupGetExportDataExp. +/// - This function is similar to +/// ::zetMetricGroupCalculateMultipleMetricValuesExp except it would +/// calculate from exported metric data. +/// - This function could be used to calculate metrics on a system different +/// from where the metric raw data was collected. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2499,90 +2486,256 @@ zetMetricTracerDisableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawDataSize` -/// - ::ZE_RESULT_WARNING_DROPPED_DATA -/// + Metric tracer data may have been dropped. -/// - ::ZE_RESULT_NOT_READY -/// + Metric tracer is disabled and no data is available to read. +/// + `nullptr == pExportData` +/// + `nullptr == pCalculateDescriptor` +/// + `nullptr == pSetCount` +/// + `nullptr == pTotalMetricValueCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format +zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Programmable Metrics +#if !defined(__GNUC__) +#pragma region metricProgrammable +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Create a metric decoder for a given metric tracer. -/// -/// @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 == hMetricTracer` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phMetricDecoder` -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder ///< [out] handle of the metric decoder object - ); +#ifndef ZET_PROGRAMMABLE_METRICS_EXP_NAME +/// @brief Programmable Metrics Experimental Extension Name +#define ZET_PROGRAMMABLE_METRICS_EXP_NAME "ZET_experimental_programmable_metrics" +#endif // ZET_PROGRAMMABLE_METRICS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric decoder. -/// -/// @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 == phMetricDecoder` -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object - ); +/// @brief Programmable Metrics Experimental Extension Version(s) +typedef enum _zet_metric_programmable_exp_version_t +{ + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_PROGRAMMABLE_EXP_VERSION_* ENUMs + +} zet_metric_programmable_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Return the list of the decodable metrics from the decoder. -/// -/// @details -/// - The decodable metrics handles returned by this API are defined by the -/// metric groups in the tracer on which the decoder was created. -/// - The decodable metrics handles returned by this API are only valid to -/// decode metrics raw data with ::zetMetricTracerDecodeExp(). Decodable -/// metric handles are not valid to compare with metrics handles included -/// in metric groups. -/// -/// @returns +#ifndef ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP +/// @brief Maximum count of characters in export data element name +#define ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP 256 +#endif // ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP +/// @brief Maximum export data element description string size +#define ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP 256 +#endif // ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP +/// @brief Maximum count of characters in metric group name prefix +#define ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP 64 +#endif // ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP +/// @brief Maximum metric programmable name string size +#define ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP +/// @brief Maximum metric programmable description string size +#define ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP +/// @brief Maximum metric programmable component string size +#define ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP +/// @brief Maximum metric programmable parameter string size +#define ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP +/// @brief Maximum value for programmable value description +#define ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MAX_METRIC_GROUP_NAME_PREFIX +/// @brief Maximum value metric group name prefix +#define ZE_MAX_METRIC_GROUP_NAME_PREFIX 64 +#endif // ZE_MAX_METRIC_GROUP_NAME_PREFIX + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of metric programmable's object +typedef struct _zet_metric_programmable_exp_handle_t *zet_metric_programmable_exp_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Programmable properties queried using +/// ::zetMetricProgrammableGetPropertiesExp +typedef struct _zet_metric_programmable_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). + char name[ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP]; ///< [out] metric programmable name + char description[ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP]; ///< [out] metric programmable description + char component[ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP]; ///< [out] metric programmable component + uint32_t tierNumber; ///< [out] tier number + uint32_t domain; ///< [out] metric domain number. + uint32_t parameterCount; ///< [out] number of parameters in the programmable + zet_metric_group_sampling_type_flags_t samplingType; ///< [out] metric sampling type. + ///< returns a combination of ::zet_metric_group_sampling_type_flag_t. + uint32_t sourceId; ///< [out] unique metric source identifier(within platform)to identify the + ///< HW block where the metric is collected. + +} zet_metric_programmable_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Programmable Parameter types +typedef enum _zet_metric_programmable_param_type_exp_t +{ + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_DISAGGREGATION = 0, ///< Metric is disaggregated. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_LATENCY = 1, ///< Metric for latency measurement. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_UTILIZATION = 2, ///< Produces normalization in percent using raw_metric * 100 / cycles / HW + ///< instance_count. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_AVERAGE = 3, ///< Produces normalization using raw_metric / HW instance_count. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_RATE = 4, ///< Produces normalization average using raw_metric / timestamp. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_BYTES = 5, ///< Produces normalization average using raw_metric * n bytes. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_GENERIC = 6, ///< Generic Parameter type. Please refer the parameter's description. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_* ENUMs + +} zet_metric_programmable_param_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported value info types +typedef enum _zet_value_info_type_exp_t +{ + ZET_VALUE_INFO_TYPE_EXP_UINT32 = 0, ///< 32-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_UINT64 = 1, ///< 64-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_FLOAT32 = 2, ///< 32-bit floating-point + ZET_VALUE_INFO_TYPE_EXP_FLOAT64 = 3, ///< 64-bit floating-point + ZET_VALUE_INFO_TYPE_EXP_BOOL8 = 4, ///< 8-bit boolean + ZET_VALUE_INFO_TYPE_EXP_UINT8 = 5, ///< 8-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_UINT16 = 6, ///< 16-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_UINT64_RANGE = 7, ///< 64-bit unsigned-integer range (minimum and maximum) + ZET_VALUE_INFO_TYPE_EXP_FLOAT64_RANGE = 8, ///< 64-bit floating point range (minimum and maximum) + ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_VALUE_INFO_TYPE_EXP_* ENUMs + +} zet_value_info_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Value info of type uint64_t range +typedef struct _zet_value_uint64_range_exp_t +{ + uint64_t ui64Min; ///< [out] minimum value of the range + uint64_t ui64Max; ///< [out] maximum value of the range + +} zet_value_uint64_range_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Value info of type float64 range +typedef struct _zet_value_fp64_range_exp_t +{ + double fp64Min; ///< [out] minimum value of the range + double fp64Max; ///< [out] maximum value of the range + +} zet_value_fp64_range_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Union of value information +typedef union _zet_value_info_exp_t +{ + uint32_t ui32; ///< [out] 32-bit unsigned-integer + uint64_t ui64; ///< [out] 64-bit unsigned-integer + float fp32; ///< [out] 32-bit floating-point + double fp64; ///< [out] 64-bit floating-point + ze_bool_t b8; ///< [out] 8-bit boolean + uint8_t ui8; ///< [out] 8-bit unsigned integer + uint16_t ui16; ///< [out] 16-bit unsigned integer + zet_value_uint64_range_exp_t ui64Range; ///< [out] minimum and maximum value of the range + zet_value_fp64_range_exp_t fp64Range; ///< [out] minimum and maximum value of the range + +} zet_value_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Programmable parameter information +typedef struct _zet_metric_programmable_param_info_exp_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). + zet_metric_programmable_param_type_exp_t type; ///< [out] programmable parameter type + char name[ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP]; ///< [out] metric programmable parameter name + zet_value_info_type_exp_t valueInfoType; ///< [out] value info type + zet_value_t defaultValue; ///< [out] default value for the parameter + uint32_t valueInfoCount; ///< [out] count of ::zet_metric_programmable_param_value_info_exp_t + +} zet_metric_programmable_param_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Programmable parameter value information +typedef struct _zet_metric_programmable_param_value_info_exp_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). + zet_value_info_exp_t valueInfo; ///< [out] information about the parameter value + char description[ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP]; ///< [out] description about the value + +} zet_metric_programmable_param_value_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Programmable parameter value +typedef struct _zet_metric_programmable_param_value_exp_t +{ + zet_value_t value; ///< [in] parameter value + +} zet_metric_programmable_param_value_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query and get the available metric programmable handles. +/// +/// @details +/// - Query the available programmable handles using *pCount = 0. +/// - Returns all programmable metric handles available in the device. +/// - The application may call this function from simultaneous threads. +/// +/// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST @@ -2597,28 +2750,28 @@ zetMetricDecoderDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricDecoder` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == pCount` -/// + `nullptr == phMetrics` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. +zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Decode raw events collected from a tracer. +/// @brief Get the properties of the metric programmable. +/// +/// @details +/// - Returns the properties of the metric programmable. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2635,163 +2788,61 @@ zetMetricDecoderGetDecodableMetricsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == phMetricDecoder` +/// + `nullptr == hMetricProgrammable` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawDataSize` -/// + `nullptr == phMetrics` -/// + `nullptr == pSetCount` -/// + `nullptr == pMetricEntriesCount` +/// + `nullptr == pProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder, ///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries +zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics/Metric Groups which export Memory -#if !defined(__GNUC__) -#pragma region metricExportMemory -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_METRIC_EXPORT_MEMORY_EXP_NAME -/// @brief Metric Export Memory Experimental Extension Name -#define ZET_METRIC_EXPORT_MEMORY_EXP_NAME "ZET_experimental_metric_export_memory" -#endif // ZET_METRIC_EXPORT_MEMORY_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Export Memory Experimental Extension Version(s) -typedef enum _zet_metric_export_memory_exp_version_t -{ - ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_* ENUMs - -} zet_metric_export_memory_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metric group type -typedef uint32_t zet_metric_group_type_exp_flags_t; -typedef enum _zet_metric_group_type_exp_flag_t -{ - ZET_METRIC_GROUP_TYPE_EXP_FLAG_EXPORT_DMA_BUF = ZE_BIT(0), ///< Metric group and metrics exports memory using linux dma-buf, which - ///< could be imported/mapped to the host process. Properties of the - ///< dma_buf could be queried using ::zet_export_dma_buf_exp_properties_t. - ZET_METRIC_GROUP_TYPE_EXP_FLAG_USER_CREATED = ZE_BIT(1), ///< Metric group created using ::zetDeviceCreateMetricGroupsFromMetricsExp - ZET_METRIC_GROUP_TYPE_EXP_FLAG_OTHER = ZE_BIT(2), ///< Metric group which has a collection of metrics - ZET_METRIC_GROUP_TYPE_EXP_FLAG_MARKER = ZE_BIT(3), ///< Metric group is capable of generating Marker metric - ZET_METRIC_GROUP_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_GROUP_TYPE_EXP_FLAG_* ENUMs - -} zet_metric_group_type_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Query the metric group type using `pNext` of -/// ::zet_metric_group_properties_t -typedef struct _zet_metric_group_type_exp_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). - zet_metric_group_type_exp_flags_t type; ///< [out] metric group type. - ///< returns a combination of ::zet_metric_group_type_exp_flags_t. - -} 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 -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. - size_t size; ///< [out] size in bytes of the dma_buf - -} zet_export_dma_buf_exp_properties_t; - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension to support Markers using MetricGroup -#if !defined(__GNUC__) -#pragma region metricGroupMarker -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_METRIC_GROUP_MARKER_EXP_NAME -/// @brief Marker Support Using MetricGroup Experimental Extension Name -#define ZET_METRIC_GROUP_MARKER_EXP_NAME "ZET_experimental_metric_group_marker" -#endif // ZET_METRIC_GROUP_MARKER_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Marker Support Using MetricGroup Experimental Extension Version(s) -typedef enum _zet_metric_group_marker_exp_version_t -{ - ZET_METRIC_GROUP_MARKER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_METRIC_GROUP_MARKER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_METRIC_GROUP_MARKER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_GROUP_MARKER_EXP_VERSION_* ENUMs - -} zet_metric_group_marker_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Query the metric source unique identifier using `pNext` of -/// ::zet_metric_group_properties_t -typedef struct _zet_metric_source_id_exp_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). - uint32_t sourceId; ///< [out] unique number representing the Metric Source. - -} zet_metric_source_id_exp_t; +/// @brief Get the information about the parameters of the metric programmable. +/// +/// @details +/// - Returns information about the parameters of the metric programmable +/// handle. +/// +/// @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 == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pParameterCount` +/// + `nullptr == pParameterInfo` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo ///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Append a Marker based on the Metric source of the Metric Group, to a -/// Command List. +/// @brief Get the information about the parameter value of the metric +/// programmable. /// /// @details -/// - This function appends a Marker based on the Metric source of the -/// Metric Group, to Command List. +/// - Returns the value-information about the parameter at the specific +/// ordinal of the metric programmable handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2808,55 +2859,142 @@ typedef struct _zet_metric_source_id_exp_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hMetricGroup` +/// + `nullptr == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pValueInfoCount` +/// + `nullptr == pValueInfo` ZE_APIEXPORT ze_result_t ZE_APICALL -zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value +zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Runtime Enabling and Disabling metrics -#if !defined(__GNUC__) -#pragma region metricRuntimeEnableDisable -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME -/// @brief Runtime Enabling and Disabling Metrics Extension Name -#define ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME "ZET_experimental_metrics_runtime_enable_disable" -#endif // ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME +/// @brief Create metric handles by applying parameter values on the metric +/// programmable handle. +/// +/// @details +/// - Multiple parameter values could be used to prepare a metric. +/// - If parameterCount = 0, the default value of the metric programmable +/// would be used for all parameters. +/// - The implementation can post-fix a C string to the metric name and +/// description, based on the parameter values chosen. +/// - ::zetMetricProgrammableGetParamInfoExp() returns a list of parameters +/// in a defined order. +/// - Therefore, the list of values passed in to the API should respect the +/// same order such that the desired parameter is set with expected value +/// +/// @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 == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pParameterValues` +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == pMetricHandleCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Runtime Enabling and Disabling Metrics Extension Version(s) -typedef enum _zet_metrics_runtime_enable_disable_exp_version_t -{ - ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_* ENUMs - -} zet_metrics_runtime_enable_disable_exp_version_t; +/// @brief Create metric handles by applying parameter values on the metric +/// programmable handle. +/// +/// @details +/// - This API is deprecated. Please use +/// ::zetMetricCreateFromProgrammableExp2() +/// +/// @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 == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pParameterValues` +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == pMetricHandleCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Enable Metrics collection during runtime. +/// @brief Create multiple metric group handles from metric handles. /// /// @details -/// - This API enables metric collection for a device/sub-device if not -/// already enabled. -/// - if ZET_ENABLE_METRICS=1 was already set, then calling this api would -/// be a NOP. -/// - This api should be called after calling zeInit(). -/// - If device is a root-device handle, then its sub-devices are also -/// enabled. -/// - ::zetDeviceDisableMetricsExp need not be called if if this api returns -/// error. -/// - This API can be used as runtime alternative to setting -/// ZET_ENABLE_METRICS=1. +/// - Creates multiple metric groups from metrics which were created using +/// ::zetMetricCreateFromProgrammableExp2(). +/// - Metrics whose Hardware resources do not overlap are added to same +/// metric group. +/// - The metric groups created using this API are managed by the +/// application and cannot be retrieved using ::zetMetricGroupGet(). +/// - The created metric groups are ready for activation and collection. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2864,7 +3002,6 @@ typedef enum _zet_metrics_runtime_enable_disable_exp_version_t /// - ::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 @@ -2874,23 +3011,88 @@ typedef enum _zet_metrics_runtime_enable_disable_exp_version_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + metricGroupCount is lesser than the number of metric group handles that could be created. ZE_APIEXPORT ze_result_t ZE_APICALL -zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. +zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// @brief Create metric group handle. /// /// @details -/// - This API disables metrics collection for a device/sub-device, if it -/// was previously enabled. -/// - If device is a root-device handle, then its sub-devices are also -/// disabled. -/// - The application has to ensure that all metric operations are complete -/// and all metric resources are released before this API is called. -/// - If there are metric operations in progress or metric resources are not -/// released, then ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE is returned. +/// - This API is deprecated. Please use +/// ::zetDeviceCreateMetricGroupsFromMetricsExp +/// +/// @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 == pName` +/// + `nullptr == pDescription` +/// + `nullptr == phMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < samplingType` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType, ///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Add a metric handle to the metric group handle created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. +/// +/// @details +/// - Reasons for failing to add the metric could be queried using +/// pErrorString +/// - Multiple additions of same metric would add the metric only once to +/// the hMetricGroup +/// - Metric handles from multiple domains may be used in a single metric +/// group. +/// - Metric handles from different sourceIds (refer +/// ::zet_metric_programmable_exp_properties_t) are not allowed in a +/// single metric group. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2898,7 +3100,6 @@ zetDeviceEnableMetricsExp( /// - ::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 @@ -2907,48 +3108,31 @@ zetDeviceEnableMetricsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If a Metric handle from a pre-defined metric group is requested to be added. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated. ZE_APIEXPORT ze_result_t ZE_APICALL -zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled +zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Calculating Multiple Metrics -#if !defined(__GNUC__) -#pragma region multiMetricValues -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MULTI_METRICS_EXP_NAME -/// @brief Calculating Multiple Metrics Experimental Extension Name -#define ZET_MULTI_METRICS_EXP_NAME "ZET_experimental_calculate_multiple_metrics" -#endif // ZET_MULTI_METRICS_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Calculating Multiple Metrics Experimental Extension Version(s) -typedef enum _ze_calculate_multiple_metrics_exp_version_t -{ - ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 - ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_* ENUMs - -} ze_calculate_multiple_metrics_exp_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Calculate one or more sets of metric values from raw data. +/// @brief Remove a metric from the metric group handle created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - This function is similar to ::zetMetricGroupCalculateMetricValues -/// except it may calculate more than one set of metric values from a -/// single data buffer. There may be one set of metric values for each -/// sub-device, for example. -/// - Each set of metric values may consist of a different number of metric -/// values, returned as the metric value count. -/// - All metric values are calculated into a single buffer; use the metric -/// counts to determine which metric values belong to which set. -/// - The application may call this function from simultaneous threads. +/// - Remove an already added metric handle from the metric group. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2956,7 +3140,6 @@ typedef enum _ze_calculate_multiple_metrics_exp_version_t /// - ::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 @@ -2966,90 +3149,36 @@ typedef enum _ze_calculate_multiple_metrics_exp_version_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawData` -/// + `nullptr == pSetCount` -/// + `nullptr == pTotalMetricValueCount` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to remove a metric not previously added to the metric group +/// + If the input metric group is a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. +zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Global Metric Timestamps -#if !defined(__GNUC__) -#pragma region GlobalTimestamps -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME -/// @brief Global Metric Timestamps Experimental Extension Name -#define ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME "ZET_experimental_global_metric_timestamps" -#endif // ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Global Metric Timestamps Experimental Extension Version(s) -typedef enum _ze_metric_global_timestamps_exp_version_t -{ - ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_* ENUMs - -} ze_metric_global_timestamps_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metric timestamps resolution -/// -/// @details -/// - This structure may be returned from ::zetMetricGroupGetProperties via -/// the `pNext` member of ::zet_metric_group_properties_t. -/// - Used for mapping metric timestamps to other timers. -typedef struct _zet_metric_global_timestamps_resolution_exp_t -{ - zet_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). - uint64_t timerResolution; ///< [out] Returns the resolution of metrics timer (used for timestamps) in - ///< cycles/sec. - uint64_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. (i.e - ///< can be used to calculate the max value of the hardware timestamp - ///< register or can be use to generate the mask of valid bits in the - ///< timestamp value) - -} zet_metric_global_timestamps_resolution_exp_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns metric timestamps synchronized with either host or device -/// timestamps at the time of invoking the function +/// @brief Closes a created metric group using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp, so that it can be +/// activated. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - Finalizes the ::zetMetricGroupAddMetricExp and +/// ::zetMetricGroupRemoveMetricExp operations on the metric group. +/// - This is a necessary step before activation of the created metric +/// group. +/// - Add / Remove of metrics is possible after ::zetMetricGroupCloseExp. +/// However, a call to ::zetMetricGroupCloseExp is necessary after +/// modifying the metric group. +/// - Implementations could choose to add new metrics to the group during +/// ::zetMetricGroupCloseExp, which are related and might add value to the +/// metrics already added by the application +/// - Applications can query the list of metrics in the metric group using +/// ::zetMetricGet /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3057,7 +3186,6 @@ typedef struct _zet_metric_global_timestamps_resolution_exp_t /// - ::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 @@ -3067,76 +3195,27 @@ typedef struct _zet_metric_global_timestamps_resolution_exp_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == globalTimestamp` -/// + `nullptr == metricTimestamp` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If the input metric group is a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. +zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Exporting Metrics Data -#if !defined(__GNUC__) -#pragma region metricExportData -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_EXPORT_METRICS_DATA_EXP_NAME -/// @brief Exporting Metrics Data Experimental Extension Name -#define ZET_EXPORT_METRICS_DATA_EXP_NAME "ZET_experimental_metric_export_data" -#endif // ZET_EXPORT_METRICS_DATA_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exporting Metrics Data Experimental Extension Version(s) -typedef enum _zet_export_metric_data_exp_version_t -{ - ZET_EXPORT_METRIC_DATA_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_EXPORT_METRIC_DATA_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_EXPORT_METRIC_DATA_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_EXPORT_METRIC_DATA_EXP_VERSION_* ENUMs - -} zet_export_metric_data_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP -/// @brief Maximum count of characters in export data element name -#define ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP 256 -#endif // ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_NAME_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP -/// @brief Maximum export data element description string size -#define ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP 256 -#endif // ZET_MAX_METRIC_EXPORT_DATA_ELEMENT_DESCRIPTION_EXP - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metrics calculation descriptor -typedef struct _zet_metric_calculate_exp_desc_t -{ - zet_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 rawReportSkipCount; ///< [in] number of reports to skip during calculation - -} zet_metric_calculate_exp_desc_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Export Metrics Data for system independent calculation. +/// @brief Destroy a metric group created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - This function exports raw data and necessary information to perform -/// metrics calculation of collected data in a different system than where -/// data was collected, which may or may not have accelerators. -/// - Implementations can choose to describe the data arrangement of the -/// exported data, using any mechanism which allows users to read and -/// process them. -/// - The application may call this function from simultaneous threads. +/// - Metric handles created using ::zetMetricCreateFromProgrammableExp2 and +/// are part of the metricGroup are not destroyed. +/// - It is necessary to call ::zetMetricDestroyExp for each of the metric +/// handles (created from ::zetMetricCreateFromProgrammableExp2) to +/// destroy them. +/// - It is not necessary to remove the metrics in the metricGroup before +/// destroying it. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3144,7 +3223,6 @@ typedef struct _zet_metric_calculate_exp_desc_t /// - ::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 @@ -3154,34 +3232,21 @@ typedef struct _zet_metric_calculate_exp_desc_t /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawData` -/// + `nullptr == pExportDataSize` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to destroy a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If trying to destroy an activated metric group ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. +zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Calculate one or more sets of metric values from exported raw data. +/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp2. /// /// @details -/// - Calculate metrics values using exported data returned by -/// ::zetMetricGroupGetExportDataExp. -/// - This function is similar to -/// ::zetMetricGroupCalculateMultipleMetricValuesExp except it would -/// calculate from exported metric data. -/// - This function could be used to calculate metrics on a system different -/// from where the metric raw data was collected. -/// - The application may call this function from simultaneous threads. +/// - If a metric is added to a metric group, the metric has to be removed +/// using ::zetMetricGroupRemoveMetricExp before it can be destroyed. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3189,7 +3254,6 @@ zetMetricGroupGetExportDataExp( /// - ::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 @@ -3198,254 +3262,152 @@ zetMetricGroupGetExportDataExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pExportData` -/// + `nullptr == pCalculateDescriptor` -/// + `nullptr == pSetCount` -/// + `nullptr == pTotalMetricValueCount` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to destroy a metric from pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If trying to destroy a metric currently added to a metric group ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. +zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Programmable Metrics +// Intel 'oneAPI' Level-Zero Tool Experimental Extension to get Concurrent Metric Groups #if !defined(__GNUC__) -#pragma region metricProgrammable +#pragma region concurrentMetricGroup #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_PROGRAMMABLE_METRICS_EXP_NAME -/// @brief Programmable Metrics Experimental Extension Name -#define ZET_PROGRAMMABLE_METRICS_EXP_NAME "ZET_experimental_programmable_metrics" -#endif // ZET_PROGRAMMABLE_METRICS_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Programmable Metrics Experimental Extension Version(s) -typedef enum _zet_metric_programmable_exp_version_t -{ - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_PROGRAMMABLE_EXP_VERSION_* ENUMs - -} zet_metric_programmable_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP -/// @brief Maximum count of characters in export data element name -#define ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP 256 -#endif // ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_NAME_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP -/// @brief Maximum export data element description string size -#define ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP 256 -#endif // ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP -/// @brief Maximum count of characters in metric group name prefix -#define ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP 64 -#endif // ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP -/// @brief Maximum metric programmable name string size -#define ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP 128 -#endif // ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP -/// @brief Maximum metric programmable description string size -#define ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP 128 -#endif // ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP -/// @brief Maximum metric programmable component string size -#define ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP 128 -#endif // ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP -/// @brief Maximum metric programmable parameter string size -#define ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP 128 -#endif // ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP -/// @brief Maximum value for programmable value description -#define ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP 128 -#endif // ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MAX_METRIC_GROUP_NAME_PREFIX -/// @brief Maximum value metric group name prefix -#define ZE_MAX_METRIC_GROUP_NAME_PREFIX 64 -#endif // ZE_MAX_METRIC_GROUP_NAME_PREFIX - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of metric programmable's object -typedef struct _zet_metric_programmable_exp_handle_t *zet_metric_programmable_exp_handle_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Programmable properties queried using -/// ::zetMetricProgrammableGetPropertiesExp -typedef struct _zet_metric_programmable_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). - char name[ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP]; ///< [out] metric programmable name - char description[ZET_MAX_METRIC_PROGRAMMABLE_DESCRIPTION_EXP]; ///< [out] metric programmable description - char component[ZET_MAX_METRIC_PROGRAMMABLE_COMPONENT_EXP]; ///< [out] metric programmable component - uint32_t tierNumber; ///< [out] tier number - uint32_t domain; ///< [out] metric domain number. - uint32_t parameterCount; ///< [out] number of parameters in the programmable - zet_metric_group_sampling_type_flags_t samplingType; ///< [out] metric sampling type. - ///< returns a combination of ::zet_metric_group_sampling_type_flag_t. - uint32_t sourceId; ///< [out] unique metric source identifier(within platform)to identify the - ///< HW block where the metric is collected. - -} zet_metric_programmable_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Programmable Parameter types -typedef enum _zet_metric_programmable_param_type_exp_t -{ - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_DISAGGREGATION = 0, ///< Metric is disaggregated. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_LATENCY = 1, ///< Metric for latency measurement. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_UTILIZATION = 2, ///< Produces normalization in percent using raw_metric * 100 / cycles / HW - ///< instance_count. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_AVERAGE = 3, ///< Produces normalization using raw_metric / HW instance_count. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_RATE = 4, ///< Produces normalization average using raw_metric / timestamp. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_BYTES = 5, ///< Produces normalization average using raw_metric * n bytes. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_GENERIC = 6, ///< Generic Parameter type. Please refer the parameter's description. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_* ENUMs - -} zet_metric_programmable_param_type_exp_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported value info types -typedef enum _zet_value_info_type_exp_t -{ - ZET_VALUE_INFO_TYPE_EXP_UINT32 = 0, ///< 32-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_UINT64 = 1, ///< 64-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_FLOAT32 = 2, ///< 32-bit floating-point - ZET_VALUE_INFO_TYPE_EXP_FLOAT64 = 3, ///< 64-bit floating-point - ZET_VALUE_INFO_TYPE_EXP_BOOL8 = 4, ///< 8-bit boolean - ZET_VALUE_INFO_TYPE_EXP_UINT8 = 5, ///< 8-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_UINT16 = 6, ///< 16-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_UINT64_RANGE = 7, ///< 64-bit unsigned-integer range (minimum and maximum) - ZET_VALUE_INFO_TYPE_EXP_FLOAT64_RANGE = 8, ///< 64-bit floating point range (minimum and maximum) - ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_VALUE_INFO_TYPE_EXP_* ENUMs - -} zet_value_info_type_exp_t; +#ifndef ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME +/// @brief Concurrent Metric Groups Experimental Extension Name +#define ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME "ZET_experimental_concurrent_metric_groups" +#endif // ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Value info of type uint64_t range -typedef struct _zet_value_uint64_range_exp_t +/// @brief Concurrent Metric Groups Experimental Extension Version(s) +typedef enum _zet_concurrent_metric_groups_exp_version_t { - uint64_t ui64Min; ///< [out] minimum value of the range - uint64_t ui64Max; ///< [out] maximum value of the range + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_* ENUMs -} zet_value_uint64_range_exp_t; +} zet_concurrent_metric_groups_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Value info of type float64 range -typedef struct _zet_value_fp64_range_exp_t -{ - double fp64Min; ///< [out] minimum value of the range - double fp64Max; ///< [out] maximum value of the range +/// @brief Get sets of metric groups which could be collected concurrently. +/// +/// @details +/// - Re-arrange the input metric groups to provide sets of concurrent +/// metric groups. +/// +/// @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_APIEXPORT ze_result_t ZE_APICALL +zetDeviceGetConcurrentMetricGroupsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup, ///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. + ); -} zet_value_fp64_range_exp_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics Tracer +#if !defined(__GNUC__) +#pragma region metricTracer +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRICS_TRACER_EXP_NAME +/// @brief Metric Tracer Experimental Extension Name +#define ZET_METRICS_TRACER_EXP_NAME "ZET_experimental_metric_tracer" +#endif // ZET_METRICS_TRACER_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Union of value information -typedef union _zet_value_info_exp_t +/// @brief Metric Tracer Experimental Extension Version(s) +typedef enum _zet_metric_tracer_exp_version_t { - uint32_t ui32; ///< [out] 32-bit unsigned-integer - uint64_t ui64; ///< [out] 64-bit unsigned-integer - float fp32; ///< [out] 32-bit floating-point - double fp64; ///< [out] 64-bit floating-point - ze_bool_t b8; ///< [out] 8-bit boolean - uint8_t ui8; ///< [out] 8-bit unsigned integer - uint16_t ui16; ///< [out] 16-bit unsigned integer - zet_value_uint64_range_exp_t ui64Range; ///< [out] minimum and maximum value of the range - zet_value_fp64_range_exp_t fp64Range; ///< [out] minimum and maximum value of the range + ZET_METRIC_TRACER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRIC_TRACER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRIC_TRACER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_TRACER_EXP_VERSION_* ENUMs -} zet_value_info_exp_t; +} zet_metric_tracer_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Programmable parameter information -typedef struct _zet_metric_programmable_param_info_exp_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). - zet_metric_programmable_param_type_exp_t type; ///< [out] programmable parameter type - char name[ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP]; ///< [out] metric programmable parameter name - zet_value_info_type_exp_t valueInfoType; ///< [out] value info type - zet_value_t defaultValue; ///< [out] default value for the parameter - uint32_t valueInfoCount; ///< [out] count of ::zet_metric_programmable_param_value_info_exp_t +/// @brief Handle of metric tracer's object +typedef struct _zet_metric_tracer_exp_handle_t *zet_metric_tracer_exp_handle_t; -} zet_metric_programmable_param_info_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of metric decoder's object +typedef struct _zet_metric_decoder_exp_handle_t *zet_metric_decoder_exp_handle_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Programmable parameter value information -typedef struct _zet_metric_programmable_param_value_info_exp_t +/// @brief Metric tracer descriptor +typedef struct _zet_metric_tracer_exp_desc_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 + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - zet_value_info_exp_t valueInfo; ///< [out] information about the parameter value - char description[ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP]; ///< [out] description about the value + uint32_t notifyEveryNBytes; ///< [in,out] number of collected bytes after which notification event will + ///< be signaled. If the requested value is not supported exactly, then the + ///< driver may use a value that is the closest supported approximation and + ///< shall update this member during ::zetMetricTracerCreateExp. -} zet_metric_programmable_param_value_info_exp_t; +} zet_metric_tracer_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Metric Programmable parameter value -typedef struct _zet_metric_programmable_param_value_exp_t +/// @brief Decoded metric entry +typedef struct _zet_metric_entry_exp_t { - zet_value_t value; ///< [in] parameter value + zet_value_t value; ///< [out] value of the decodable metric entry or event. Number is + ///< meaningful based on the metric type. + uint64_t timeStamp; ///< [out] timestamp at which the event happened. + uint32_t metricIndex; ///< [out] index to the decodable metric handle in the input array + ///< (phMetric) in ::zetMetricTracerDecodeExp(). + ze_bool_t onSubdevice; ///< [out] True if the event occurred on a sub-device; false means the + ///< device on which the metric tracer was opened does not have + ///< sub-devices. + uint32_t subdeviceId; ///< [out] If onSubdevice is true, this gives the ID of the sub-device. -} zet_metric_programmable_param_value_exp_t; +} zet_metric_entry_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query and get the available metric programmable handles. +/// @brief Create a metric tracer for a device. /// /// @details -/// - Query the available programmable handles using *pCount = 0. -/// - Returns all programmable metric handles available in the device. -/// - The application may call this function from simultaneous threads. +/// - The notification event must have been created from an event pool that +/// was created using ::ZE_EVENT_POOL_FLAG_HOST_VISIBLE flag. +/// - The duration of the signal event created from an event pool that was +/// created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. +/// However, for consistency and orthogonality the event will report +/// correctly as signaled when used by other event API functionality. +/// - The application must **not** call this function from simultaneous +/// threads with the same device handle. +/// - The metric tracer is created in disabled state +/// - Metric groups must support sampling type +/// ZET_METRIC_SAMPLING_TYPE_EXP_FLAG_TRACER_BASED +/// - All metric groups must be first activated /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3462,28 +3424,33 @@ typedef struct _zet_metric_programmable_param_value_exp_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == phMetricGroups` +/// + `nullptr == desc` +/// + `nullptr == phMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricProgrammableGetExp( +zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the properties of the metric programmable. +/// @brief Destroy a metric tracer. /// /// @details -/// - Returns the properties of the metric programmable. +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3500,21 +3467,21 @@ zetMetricProgrammableGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == hMetricTracer` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable +zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the information about the parameters of the metric programmable. +/// @brief Start events collection /// /// @details -/// - Returns information about the parameters of the metric programmable -/// handle. +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3531,30 +3498,26 @@ zetMetricProgrammableGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterCount` -/// + `nullptr == pParameterInfo` +/// + `nullptr == hMetricTracer` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo ///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. +zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the information about the parameter value of the metric -/// programmable. +/// @brief Stop events collection /// /// @details -/// - Returns the value-information about the parameter at the specific -/// ordinal of the metric programmable handle. +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3571,38 +3534,92 @@ zetMetricProgrammableGetParamInfoExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` +/// + `nullptr == hMetricTracer` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read data from the metric tracer +/// +/// @details +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// - Data can be retrieved after tracer is disabled. When buffers are +/// drained ::ZE_RESULT_NOT_READY will be returned +/// +/// @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 == hMetricTracer` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pValueInfoCount` -/// + `nullptr == pValueInfo` +/// + `nullptr == pRawDataSize` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric tracer data may have been dropped. +/// - ::ZE_RESULT_NOT_READY +/// + Metric tracer is disabled and no data is available to read. +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create a metric decoder for a given metric tracer. +/// +/// @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 == hMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetricDecoder` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. +zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder ///< [out] handle of the metric decoder object ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric handles by applying parameter values on the metric -/// programmable handle. -/// -/// @details -/// - Multiple parameter values could be used to prepare a metric. -/// - If parameterCount = 0, the default value of the metric programmable -/// would be used for all parameters. -/// - The implementation can post-fix a C string to the metric name and -/// description, based on the parameter values chosen. -/// - ::zetMetricProgrammableGetParamInfoExp() returns a list of parameters -/// in a defined order. -/// - Therefore, the list of values passed in to the API should respect the -/// same order such that the desired parameter is set with expected value +/// @brief Destroy a metric decoder. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3619,40 +3636,22 @@ zetMetricProgrammableGetParamValueInfoExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterValues` -/// + `nullptr == pName` -/// + `nullptr == pDescription` -/// + `nullptr == pMetricHandleCount` +/// + `nullptr == phMetricDecoder` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. +zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric handles by applying parameter values on the metric -/// programmable handle. +/// @brief Return the list of the decodable metrics from the decoder. /// /// @details -/// - This API is deprecated. Please use -/// ::zetMetricCreateFromProgrammableExp2() +/// - The decodable metrics handles returned by this API are defined by the +/// metric groups in the tracer on which the decoder was created. +/// - The decodable metrics handles returned by this API are only valid to +/// decode metrics raw data with ::zetMetricTracerDecodeExp(). Decodable +/// metric handles are not valid to compare with metrics handles included +/// in metric groups. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3669,44 +3668,28 @@ zetMetricCreateFromProgrammableExp2( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` +/// + `nullptr == hMetricDecoder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterValues` -/// + `nullptr == pName` -/// + `nullptr == pDescription` -/// + `nullptr == pMetricHandleCount` +/// + `nullptr == pCount` +/// + `nullptr == phMetrics` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. +zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Create multiple metric group handles from metric handles. -/// -/// @details -/// - Creates multiple metric groups from metrics which were created using -/// ::zetMetricCreateFromProgrammableExp2(). -/// - Metrics whose Hardware resources do not overlap are added to same -/// metric group. -/// - The metric groups created using this API are managed by the -/// application and cannot be retrieved using ::zetMetricGroupGet(). -/// - The created metric groups are ready for activation and collection. +/// @brief Decode raw events collected from a tracer. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3714,6 +3697,7 @@ zetMetricCreateFromProgrammableExp( /// - ::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 @@ -3722,129 +3706,163 @@ zetMetricCreateFromProgrammableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + metricGroupCount is lesser than the number of metric group handles that could be created. +/// + `nullptr == phMetricDecoder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawDataSize` +/// + `nullptr == phMetrics` +/// + `nullptr == pSetCount` +/// + `nullptr == pMetricEntriesCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. +zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder, ///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics/Metric Groups which export Memory +#if !defined(__GNUC__) +#pragma region metricExportMemory +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRIC_EXPORT_MEMORY_EXP_NAME +/// @brief Metric Export Memory Experimental Extension Name +#define ZET_METRIC_EXPORT_MEMORY_EXP_NAME "ZET_experimental_metric_export_memory" +#endif // ZET_METRIC_EXPORT_MEMORY_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Export Memory Experimental Extension Version(s) +typedef enum _zet_metric_export_memory_exp_version_t +{ + ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_EXPORT_MEMORY_EXP_VERSION_* ENUMs + +} zet_metric_export_memory_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric group type +typedef uint32_t zet_metric_group_type_exp_flags_t; +typedef enum _zet_metric_group_type_exp_flag_t +{ + ZET_METRIC_GROUP_TYPE_EXP_FLAG_EXPORT_DMA_BUF = ZE_BIT(0), ///< Metric group and metrics exports memory using linux dma-buf, which + ///< could be imported/mapped to the host process. Properties of the + ///< dma_buf could be queried using ::zet_export_dma_buf_exp_properties_t. + ZET_METRIC_GROUP_TYPE_EXP_FLAG_USER_CREATED = ZE_BIT(1), ///< Metric group created using ::zetDeviceCreateMetricGroupsFromMetricsExp + ZET_METRIC_GROUP_TYPE_EXP_FLAG_OTHER = ZE_BIT(2), ///< Metric group which has a collection of metrics + ZET_METRIC_GROUP_TYPE_EXP_FLAG_MARKER = ZE_BIT(3), ///< Metric group is capable of generating Marker metric + ZET_METRIC_GROUP_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_GROUP_TYPE_EXP_FLAG_* ENUMs + +} zet_metric_group_type_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query the metric group type using `pNext` of +/// ::zet_metric_group_properties_t +typedef struct _zet_metric_group_type_exp_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). + zet_metric_group_type_exp_flags_t type; ///< [out] metric group type. + ///< returns a combination of ::zet_metric_group_type_exp_flags_t. + +} 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 +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. + size_t size; ///< [out] size in bytes of the dma_buf + +} zet_export_dma_buf_exp_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension to support Markers using MetricGroup +#if !defined(__GNUC__) +#pragma region metricGroupMarker +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRIC_GROUP_MARKER_EXP_NAME +/// @brief Marker Support Using MetricGroup Experimental Extension Name +#define ZET_METRIC_GROUP_MARKER_EXP_NAME "ZET_experimental_metric_group_marker" +#endif // ZET_METRIC_GROUP_MARKER_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric group handle. -/// -/// @details -/// - This API is deprecated. Please use -/// ::zetDeviceCreateMetricGroupsFromMetricsExp -/// -/// @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 == pName` -/// + `nullptr == pDescription` -/// + `nullptr == phMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < samplingType` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType, ///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle - ); +/// @brief Marker Support Using MetricGroup Experimental Extension Version(s) +typedef enum _zet_metric_group_marker_exp_version_t +{ + ZET_METRIC_GROUP_MARKER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRIC_GROUP_MARKER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRIC_GROUP_MARKER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRIC_GROUP_MARKER_EXP_VERSION_* ENUMs + +} zet_metric_group_marker_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Add a metric handle to the metric group handle created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. -/// -/// @details -/// - Reasons for failing to add the metric could be queried using -/// pErrorString -/// - Multiple additions of same metric would add the metric only once to -/// the hMetricGroup -/// - Metric handles from multiple domains may be used in a single metric -/// group. -/// - Metric handles from different sourceIds (refer -/// ::zet_metric_programmable_exp_properties_t) are not allowed in a -/// single metric group. -/// -/// @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 == hMetricGroup` -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If a Metric handle from a pre-defined metric group is requested to be added. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated. -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. - ); +/// @brief Query the metric source unique identifier using `pNext` of +/// ::zet_metric_group_properties_t +typedef struct _zet_metric_source_id_exp_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). + uint32_t sourceId; ///< [out] unique number representing the Metric Source. + +} zet_metric_source_id_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Remove a metric from the metric group handle created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. +/// @brief Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. /// /// @details -/// - Remove an already added metric handle from the metric group. +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3852,6 +3870,7 @@ zetMetricGroupAddMetricExp( /// - ::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 @@ -3860,74 +3879,55 @@ zetMetricGroupAddMetricExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` /// + `nullptr == hMetricGroup` -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to remove a metric not previously added to the metric group -/// + If the input metric group is a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. +zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Runtime Enabling and Disabling metrics +#if !defined(__GNUC__) +#pragma region metricRuntimeEnableDisable +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes a created metric group using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp, so that it can be -/// activated. -/// -/// @details -/// - Finalizes the ::zetMetricGroupAddMetricExp and -/// ::zetMetricGroupRemoveMetricExp operations on the metric group. -/// - This is a necessary step before activation of the created metric -/// group. -/// - Add / Remove of metrics is possible after ::zetMetricGroupCloseExp. -/// However, a call to ::zetMetricGroupCloseExp is necessary after -/// modifying the metric group. -/// - Implementations could choose to add new metrics to the group during -/// ::zetMetricGroupCloseExp, which are related and might add value to the -/// metrics already added by the application -/// - Applications can query the list of metrics in the metric group using -/// ::zetMetricGet -/// -/// @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 == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If the input metric group is a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated -ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group - ); +#ifndef ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME +/// @brief Runtime Enabling and Disabling Metrics Extension Name +#define ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME "ZET_experimental_metrics_runtime_enable_disable" +#endif // ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric group created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. +/// @brief Runtime Enabling and Disabling Metrics Extension Version(s) +typedef enum _zet_metrics_runtime_enable_disable_exp_version_t +{ + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_* ENUMs + +} zet_metrics_runtime_enable_disable_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Enable Metrics collection during runtime. /// /// @details -/// - Metric handles created using ::zetMetricCreateFromProgrammableExp2 and -/// are part of the metricGroup are not destroyed. -/// - It is necessary to call ::zetMetricDestroyExp for each of the metric -/// handles (created from ::zetMetricCreateFromProgrammableExp2) to -/// destroy them. -/// - It is not necessary to remove the metrics in the metricGroup before -/// destroying it. +/// - This API enables metric collection for a device/sub-device if not +/// already enabled. +/// - if ZET_ENABLE_METRICS=1 was already set, then calling this api would +/// be a NOP. +/// - This api should be called after calling zeInit(). +/// - If device is a root-device handle, then its sub-devices are also +/// enabled. +/// - ::zetDeviceDisableMetricsExp need not be called if if this api returns +/// error. +/// - This API can be used as runtime alternative to setting +/// ZET_ENABLE_METRICS=1. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3935,6 +3935,7 @@ zetMetricGroupCloseExp( /// - ::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 @@ -3943,22 +3944,24 @@ zetMetricGroupCloseExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to destroy a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If trying to destroy an activated metric group +/// + `nullptr == hDevice` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy +zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp2. +/// @brief Disable Metrics collection during runtime, if it was already enabled. /// /// @details -/// - If a metric is added to a metric group, the metric has to be removed -/// using ::zetMetricGroupRemoveMetricExp before it can be destroyed. +/// - This API disables metrics collection for a device/sub-device, if it +/// was previously enabled. +/// - If device is a root-device handle, then its sub-devices are also +/// disabled. +/// - The application has to ensure that all metric operations are complete +/// and all metric resources are released before this API is called. +/// - If there are metric operations in progress or metric resources are not +/// released, then ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE is returned. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3966,6 +3969,7 @@ zetMetricGroupDestroyExp( /// - ::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 @@ -3974,14 +3978,10 @@ zetMetricGroupDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to destroy a metric from pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If trying to destroy a metric currently added to a metric group +/// + `nullptr == hDevice` ZE_APIEXPORT ze_result_t ZE_APICALL -zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy +zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ); #if !defined(__GNUC__) diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 05be52d4..9983d75c 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.23 + * @version v1.17-r1.17.24 * */ #ifndef _ZET_DDI_H diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index d3691b75..35e1a668 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -5147,295 +5147,295 @@ namespace driver } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { 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 pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; - if( nullptr != pfnGetBinaryExp ) + auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + if( nullptr != pfnReserveCacheExt ) { - result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeKernelGetBinaryExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceReserveCacheExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeDeviceSetCacheAdviceExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { 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 pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; - if( nullptr != pfnImportExternalSemaphoreExt ) + auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + if( nullptr != pfnSetCacheAdviceExt ) { - result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); } else { // generic implementation - *phSemaphore = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeDeviceImportExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceSetCacheAdviceExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeEventQueryTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { 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 pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; - if( nullptr != pfnReleaseExternalSemaphoreExt ) + auto pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; + if( nullptr != pfnQueryTimestampsExp ) { - result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDeviceReleaseExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeEventQueryTimestampsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeImageGetMemoryPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { 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 pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr != pfnAppendSignalExternalSemaphoreExt ) + auto pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr != pfnGetMemoryPropertiesExp ) { - result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendSignalExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeImageGetMemoryPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeImageViewCreateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { 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 pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr != pfnAppendWaitExternalSemaphoreExt ) + auto pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; + if( nullptr != pfnViewCreateExt ) { - result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); } else { // generic implementation + *phImageView = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendWaitExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeImageViewCreateExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { 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 pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - if( nullptr != pfnCreateExt ) + auto pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; + if( nullptr != pfnViewCreateExp ) { - result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); } else { // generic implementation - *phBuilder = reinterpret_cast( context.get() ); + *phImageView = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCreateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeKernelSchedulingHintExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { 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 pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr != pfnGetBuildPropertiesExt ) + auto pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; + if( nullptr != pfnSchedulingHintExp ) { - result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnSchedulingHintExp( hKernel, pHint ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderGetBuildPropertiesExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeKernelSchedulingHintExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeDevicePciGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties 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 pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr != pfnRTASFormatCompatibilityCheckExt ) + auto pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; + if( nullptr != pfnPciGetPropertiesExt ) { - result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDriverRTASFormatCompatibilityCheckExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDevicePciGetPropertiesExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - if( nullptr != pfnBuildExt ) + auto pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; + if( nullptr != pfnAppendImageCopyToMemoryExt ) { - result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderBuildExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendImageCopyToMemoryExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -5446,2058 +5446,2058 @@ namespace driver 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 pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr != pfnCommandListAppendCopyExt ) + auto pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; + if( nullptr != pfnAppendImageCopyFromMemoryExt ) { - result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCommandListAppendCopyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendImageCopyFromMemoryExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeImageGetAllocPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { 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 pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) + auto pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; + if( nullptr != pfnGetAllocPropertiesExt ) { - result = pfnDestroyExt( hBuilder ); + result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); } else { // generic implementation - } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderDestroyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeImageGetAllocPropertiesExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt + /// @brief Intercept function for zeModuleInspectLinkageExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { 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 pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - if( nullptr != pfnCreateExt ) + auto pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; + if( nullptr != pfnInspectLinkageExt ) { - result = pfnCreateExt( hDriver, phParallelOperation ); + result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); } else { // generic implementation - *phParallelOperation = reinterpret_cast( context.get() ); + *phLog = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationCreateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeModuleInspectLinkageExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeMemFreeExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { 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 pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr != pfnGetPropertiesExt ) + auto pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; + if( nullptr != pfnFreeExt ) { - result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationGetPropertiesExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeMemFreeExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeFabricVertexGetExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { 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 pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - if( nullptr != pfnJoinExt ) + auto pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; + if( nullptr != pfnGetExp ) { - result = pfnJoinExt( hParallelOperation ); + result = pfnGetExp( hDriver, pCount, phVertices ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phVertices ) && ( i < *pCount ); ++i ) + phVertices[ i ] = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationJoinExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { 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 pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) + auto pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; + if( nullptr != pfnGetSubVerticesExp ) { - result = pfnDestroyExt( hParallelOperation ); + result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phSubvertices ) && ( i < *pCount ); ++i ) + phSubvertices[ i ] = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationDestroyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetSubVerticesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeFabricVertexGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { 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 pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - if( nullptr != pfnGetVectorWidthPropertiesExt ) + auto pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; + if( nullptr != pfnGetPropertiesExp ) { - result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + result = pfnGetPropertiesExp( hVertex, pVertexProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDeviceGetVectorWidthPropertiesExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeFabricVertexGetDeviceExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { 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 pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr != pfnGetAllocationPropertiesExp ) + auto pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; + if( nullptr != pfnGetDeviceExp ) { - result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + result = pfnGetDeviceExp( hVertex, phDevice ); } else { // generic implementation + *phDevice = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeKernelGetAllocationPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetDeviceExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeDeviceGetFabricVertexExp __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to 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 pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; - if( nullptr != pfnGetIpcHandleWithProperties ) + auto pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; + if( nullptr != pfnGetFabricVertexExp ) { - result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + result = pfnGetFabricVertexExp( hDevice, phVertex ); } else { // generic implementation + *phVertex = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeMemGetIpcHandleWithProperties", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceGetFabricVertexExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphCreateExt + /// @brief Intercept function for zeFabricEdgeGetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { 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 pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; - if( nullptr != pfnCreateExt ) + auto pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; + if( nullptr != pfnGetExp ) { - result = pfnCreateExt( hContext, pNext, phGraph ); + result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); } else { // generic implementation - *phGraph = reinterpret_cast( context.get() ); + for( size_t i = 0; ( nullptr != phEdges ) && ( i < *pCount ); ++i ) + phEdges[ i ] = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeGraphCreateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginGraphCaptureExt + /// @brief Intercept function for zeFabricEdgeGetVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { 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 pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; - if( nullptr != pfnBeginGraphCaptureExt ) + auto pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; + if( nullptr != pfnGetVerticesExp ) { - result = pfnBeginGraphCaptureExt( hCommandList, pNext ); + result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); } else { // generic implementation + *phVertexA = reinterpret_cast( context.get() ); + + *phVertexB = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginGraphCaptureExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetVerticesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { 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 pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr != pfnBeginCaptureIntoGraphExt ) + auto pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; + if( nullptr != pfnGetPropertiesExp ) { - result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginCaptureIntoGraphExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + /// @brief Intercept function for zeEventQueryKernelTimestampsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { 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 pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr != pfnIsGraphCaptureEnabledExt ) + auto pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; + if( nullptr != pfnQueryKernelTimestampsExt ) { - result = pfnIsGraphCaptureEnabledExt( hCommandList ); + result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListIsGraphCaptureEnabledExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeEventQueryKernelTimestampsExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListEndGraphCaptureExt + /// @brief Intercept function for zeRTASBuilderCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { 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 pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; - if( nullptr != pfnEndGraphCaptureExt ) + auto pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; + if( nullptr != pfnCreateExp ) { - result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); } else { // generic implementation - *phGraph = reinterpret_cast( context.get() ); + *phBuilder = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeCommandListEndGraphCaptureExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetGraphExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { 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 pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; - if( nullptr != pfnGetGraphExt ) + auto pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; + if( nullptr != pfnGetBuildPropertiesExp ) { - result = pfnGetGraphExt( hCommandList, phGraph ); + result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); } else { // generic implementation - *phGraph = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeCommandListGetGraphExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderGetBuildPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { 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 pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; - if( nullptr != pfnGetPrimaryCommandListExt ) + auto pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; + if( nullptr != pfnRTASFormatCompatibilityCheckExp ) { - result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); } else { // generic implementation - *phCommandList = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeGraphGetPrimaryCommandListExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDriverRTASFormatCompatibilityCheckExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphSetDestructionCallbackExt + /// @brief Intercept function for zeRTASBuilderBuildExp __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { 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 pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; - if( nullptr != pfnSetDestructionCallbackExt ) + auto pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; + if( nullptr != pfnBuildExp ) { - result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeGraphSetDestructionCallbackExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderBuildExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphInstantiateExt + /// @brief Intercept function for zeRTASBuilderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { 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 pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; - if( nullptr != pfnInstantiateExt ) + auto pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + result = pfnDestroyExp( hBuilder ); } else { // generic implementation - *phExecutableGraph = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeGraphInstantiateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendGraphExt + /// @brief Intercept function for zeRTASParallelOperationCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { 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 pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; - if( nullptr != pfnAppendGraphExt ) + auto pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; + if( nullptr != pfnCreateExp ) { - result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnCreateExp( hDriver, phParallelOperation ); } else { // generic implementation + *phParallelOperation = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendGraphExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { 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 pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr != pfnGetSourceGraphExt ) + auto pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; + if( nullptr != pfnGetPropertiesExp ) { - result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + result = pfnGetPropertiesExp( hParallelOperation, pProperties ); } else { // generic implementation - *phSourceGraph = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphGetSourceGraphExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationGetPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphIsEmptyExt + /// @brief Intercept function for zeRTASParallelOperationJoinExp __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { 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 pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; - if( nullptr != pfnIsEmptyExt ) + auto pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; + if( nullptr != pfnJoinExp ) { - result = pfnIsEmptyExt( hGraph ); + result = pfnJoinExp( hParallelOperation ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeGraphIsEmptyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationJoinExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDumpContentsExt + /// @brief Intercept function for zeRTASParallelOperationDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { 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 pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; - if( nullptr != pfnDumpContentsExt ) + auto pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnDumpContentsExt( hGraph, filePath, pNext ); + result = pfnDestroyExp( hParallelOperation ); } else { // generic implementation + } - char *env_str = context.setenv_var_with_driver_id("zeGraphDumpContentsExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphDestroyExt + /// @brief Intercept function for zeMemGetPitchFor2dImage __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { 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 pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) + auto pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; + if( nullptr != pfnGetPitchFor2dImage ) { - result = pfnDestroyExt( hGraph ); + result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); } else { // generic implementation - } - char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphDestroyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeMemGetPitchFor2dImage", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDestroyExt + /// @brief Intercept function for zeImageGetDeviceOffsetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { 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 pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) + auto pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; + if( nullptr != pfnGetDeviceOffsetExp ) { - result = pfnDestroyExt( hGraph ); + result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); } else { // generic implementation - } - char *env_str = context.setenv_var_with_driver_id("zeGraphDestroyExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeImageGetDeviceOffsetExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendHostFunction + /// @brief Intercept function for zeCommandListCreateCloneExp __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { 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 pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; - if( nullptr != pfnAppendHostFunction ) + auto pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; + if( nullptr != pfnCreateCloneExp ) { - result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); } else { // generic implementation + *phClonedCommandList = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendHostFunction", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListCreateCloneExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { 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 pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; - if( nullptr != pfnReserveCacheExt ) + auto pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; + if( nullptr != pfnImmediateAppendCommandListsExp ) { - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDeviceReserveCacheExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateAppendCommandListsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { 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 pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; - if( nullptr != pfnSetCacheAdviceExt ) + auto pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; + if( nullptr != pfnImmediateAppendCommandListsWithParameters ) { - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDeviceSetCacheAdviceExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateAppendCommandListsWithParameters", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListGetNextCommandIdExp __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to 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 pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; - if( nullptr != pfnQueryTimestampsExp ) + auto pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; + if( nullptr != pfnGetNextCommandIdExp ) { - result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeEventQueryTimestampsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListGetNextCommandIdExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to 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 pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr != pfnGetMemoryPropertiesExp ) + auto pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; + if( nullptr != pfnGetNextCommandIdWithKernelsExp ) { - result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeImageGetMemoryPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListGetNextCommandIdWithKernelsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { 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 pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; - if( nullptr != pfnViewCreateExt ) + auto pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; + if( nullptr != pfnUpdateMutableCommandsExp ) { - result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + result = pfnUpdateMutableCommandsExp( hCommandList, desc ); } else { // generic implementation - *phImageView = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListIsMutableExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { 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 pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; - if( nullptr != pfnViewCreateExp ) + auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + if( nullptr != pfnIsMutableExp ) { - result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + result = pfnIsMutableExp( hCommandList, pIsMutable ); } else { // generic implementation - *phImageView = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeImageViewCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListIsMutableExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { 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 pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; - if( nullptr != pfnSchedulingHintExp ) + auto pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; + if( nullptr != pfnUpdateMutableCommandSignalEventExp ) { - result = pfnSchedulingHintExp( hKernel, pHint ); + result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeKernelSchedulingHintExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandSignalEventExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDevicePciGetPropertiesExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; - if( nullptr != pfnPciGetPropertiesExt ) + auto pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + if( nullptr != pfnUpdateMutableCommandWaitEventsExp ) { - result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); + result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDevicePciGetPropertiesExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandWaitEventsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { 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 pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr != pfnAppendImageCopyToMemoryExt ) + auto pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; + if( nullptr != pfnUpdateMutableCommandKernelsExp ) { - result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendImageCopyToMemoryExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandKernelsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { 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 pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr != pfnAppendImageCopyFromMemoryExt ) + auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; + if( nullptr != pfnGetBinaryExp ) { - result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendImageCopyFromMemoryExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeKernelGetBinaryExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetAllocPropertiesExt + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { 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 pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; - if( nullptr != pfnGetAllocPropertiesExt ) + auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; + if( nullptr != pfnImportExternalSemaphoreExt ) { - result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); } else { // generic implementation + *phSemaphore = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeImageGetAllocPropertiesExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceImportExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleInspectLinkageExt + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { 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 pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; - if( nullptr != pfnInspectLinkageExt ) + auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; + if( nullptr != pfnReleaseExternalSemaphoreExt ) { - result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + result = pfnReleaseExternalSemaphoreExt( hSemaphore ); } else { // generic implementation - *phLog = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeModuleInspectLinkageExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceReleaseExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFreeExt + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; - if( nullptr != pfnFreeExt ) + auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr != pfnAppendSignalExternalSemaphoreExt ) { - result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); + result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeMemFreeExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendSignalExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetExp + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; - if( nullptr != pfnGetExp ) + auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr != pfnAppendWaitExternalSemaphoreExt ) { - result = pfnGetExp( hDriver, pCount, phVertices ); + result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phVertices ) && ( i < *pCount ); ++i ) - phVertices[ i ] = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendWaitExternalSemaphoreExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { 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 pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr != pfnGetSubVerticesExp ) + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + if( nullptr != pfnCreateExt ) { - result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phSubvertices ) && ( i < *pCount ); ++i ) - phSubvertices[ i ] = reinterpret_cast( context.get() ); + *phBuilder = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetSubVerticesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCreateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetPropertiesExp + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { 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 pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; - if( nullptr != pfnGetPropertiesExp ) + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr != pfnGetBuildPropertiesExt ) { - result = pfnGetPropertiesExp( hVertex, pVertexProperties ); + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderGetBuildPropertiesExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetDeviceExp + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { 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 pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; - if( nullptr != pfnGetDeviceExp ) + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr != pfnRTASFormatCompatibilityCheckExt ) { - result = pfnGetDeviceExp( hVertex, phDevice ); + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); } else { // generic implementation - *phDevice = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeFabricVertexGetDeviceExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDriverRTASFormatCompatibilityCheckExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetFabricVertexExp + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { 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 pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; - if( nullptr != pfnGetFabricVertexExp ) + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + if( nullptr != pfnBuildExt ) { - result = pfnGetFabricVertexExp( hDevice, phVertex ); + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); } else { // generic implementation - *phVertex = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeDeviceGetFabricVertexExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderBuildExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetExp + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; - if( nullptr != pfnGetExp ) + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr != pfnCommandListAppendCopyExt ) { - result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phEdges ) && ( i < *pCount ); ++i ) - phEdges[ i ] = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCommandListAppendCopyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetVerticesExp + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { 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 pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; - if( nullptr != pfnGetVerticesExp ) + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) { - result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + result = pfnDestroyExt( hBuilder ); } else { // generic implementation - *phVertexA = reinterpret_cast( context.get() ); - - *phVertexB = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetVerticesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderDestroyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { 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 pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr != pfnGetPropertiesExp ) + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + if( nullptr != pfnCreateExt ) { - result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); + result = pfnCreateExt( hDriver, phParallelOperation ); } else { // generic implementation + *phParallelOperation = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeFabricEdgeGetPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationCreateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestampsExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { 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 pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; - if( nullptr != pfnQueryKernelTimestampsExt ) + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr != pfnGetPropertiesExt ) { - result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeEventQueryKernelTimestampsExt", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationGetPropertiesExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExp + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { 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 pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; - if( nullptr != pfnCreateExp ) + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + if( nullptr != pfnJoinExt ) { - result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); + result = pfnJoinExt( hParallelOperation ); } else { // generic implementation - *phBuilder = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationJoinExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { 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 pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr != pfnGetBuildPropertiesExp ) + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) { - result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnDestroyExt( hParallelOperation ); } else { // generic implementation + } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderGetBuildPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationDestroyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { 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 pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr != pfnRTASFormatCompatibilityCheckExp ) + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + if( nullptr != pfnGetVectorWidthPropertiesExt ) { - result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeDriverRTASFormatCompatibilityCheckExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeDeviceGetVectorWidthPropertiesExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { 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 pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; - if( nullptr != pfnBuildExp ) + auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr != pfnGetAllocationPropertiesExp ) { - result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderBuildExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeKernelGetAllocationPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExp + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { 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 pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; + if( nullptr != pfnGetIpcHandleWithProperties ) { - result = pfnDestroyExp( hBuilder ); + result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); } else { // generic implementation - } - char *env_str = context.setenv_var_with_driver_id("zeRTASBuilderDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeMemGetIpcHandleWithProperties", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExp + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { 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 pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; - if( nullptr != pfnCreateExp ) + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; + if( nullptr != pfnCreateExt ) { - result = pfnCreateExp( hDriver, phParallelOperation ); + result = pfnCreateExt( hContext, pNext, phGraph ); } else { // generic implementation - *phParallelOperation = reinterpret_cast( context.get() ); + *phGraph = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphCreateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr != pfnGetPropertiesExp ) + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; + if( nullptr != pfnBeginGraphCaptureExt ) { - result = pfnGetPropertiesExp( hParallelOperation, pProperties ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationGetPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginGraphCaptureExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; - if( nullptr != pfnJoinExp ) + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr != pfnBeginCaptureIntoGraphExt ) { - result = pfnJoinExp( hParallelOperation ); + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationJoinExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListBeginCaptureIntoGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { 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 pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr != pfnIsGraphCaptureEnabledExt ) { - result = pfnDestroyExp( hParallelOperation ); + result = pfnIsGraphCaptureEnabledExt( hCommandList ); } else { // generic implementation - } - char *env_str = context.setenv_var_with_driver_id("zeRTASParallelOperationDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListIsGraphCaptureEnabledExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetPitchFor2dImage + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { 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 pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; - if( nullptr != pfnGetPitchFor2dImage ) + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; + if( nullptr != pfnEndGraphCaptureExt ) { - result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); } else { // generic implementation + *phGraph = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeMemGetPitchFor2dImage", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListEndGraphCaptureExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetDeviceOffsetExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { 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 pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; - if( nullptr != pfnGetDeviceOffsetExp ) + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; + if( nullptr != pfnGetGraphExt ) { - result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + result = pfnGetGraphExt( hCommandList, phGraph ); } else { // generic implementation + *phGraph = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeImageGetDeviceOffsetExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListGetGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateCloneExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { 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 pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; - if( nullptr != pfnCreateCloneExp ) + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; + if( nullptr != pfnGetPrimaryCommandListExt ) { - result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); } else { // generic implementation - *phClonedCommandList = reinterpret_cast( context.get() ); + *phCommandList = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zeCommandListCreateCloneExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphGetPrimaryCommandListExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr != pfnImmediateAppendCommandListsExp ) + auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; + if( nullptr != pfnSetDestructionCallbackExt ) { - result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateAppendCommandListsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphSetDestructionCallbackExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { 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 pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr != pfnImmediateAppendCommandListsWithParameters ) + auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; + if( nullptr != pfnInstantiateExt ) { - result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); } else { // generic implementation + *phExecutableGraph = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListImmediateAppendCommandListsWithParameters", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphInstantiateExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdExp + /// @brief Intercept function for zeCommandListAppendGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; - if( nullptr != pfnGetNextCommandIdExp ) + auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; + if( nullptr != pfnAppendGraphExt ) { - result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListGetNextCommandIdExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { 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 pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr != pfnGetNextCommandIdWithKernelsExp ) + auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr != pfnGetSourceGraphExt ) { - result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); } else { // generic implementation + *phSourceGraph = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListGetNextCommandIdWithKernelsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphGetSourceGraphExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { 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 pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr != pfnUpdateMutableCommandsExp ) + auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; + if( nullptr != pfnIsEmptyExt ) { - result = pfnUpdateMutableCommandsExp( hCommandList, desc ); + result = pfnIsEmptyExt( hGraph ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphIsEmptyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsMutableExp + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { 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 pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; - if( nullptr != pfnIsMutableExp ) + auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; + if( nullptr != pfnDumpContentsExt ) { - result = pfnIsMutableExp( hCommandList, pIsMutable ); + result = pfnDumpContentsExt( hGraph, filePath, pNext ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListIsMutableExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphDumpContentsExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { 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 pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr != pfnUpdateMutableCommandSignalEventExp ) + auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) { - result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); + result = pfnDestroyExt( hGraph ); } else { // generic implementation + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandSignalEventExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeExecutableGraphDestroyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { 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 pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr != pfnUpdateMutableCommandWaitEventsExp ) + auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) { - result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + result = pfnDestroyExt( hGraph ); } else { // generic implementation + } - char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandWaitEventsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeGraphDestroyExt", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandKernelsExp( + zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { 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 pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr != pfnUpdateMutableCommandKernelsExp ) + auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; + if( nullptr != pfnAppendHostFunction ) { - result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zeCommandListUpdateMutableCommandKernelsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendHostFunction", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; @@ -7546,92 +7546,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnGetSourceGraphExt = driver::zeExecutableGraphGetSourceGraphExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDestroyExt = driver::zeExecutableGraphDestroyExt; - } - - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnCreateExt = driver::zeGraphCreateExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnGetPrimaryCommandListExt = driver::zeGraphGetPrimaryCommandListExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnSetDestructionCallbackExt = driver::zeGraphSetDestructionCallbackExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnInstantiateExt = driver::zeGraphInstantiateExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnIsEmptyExt = driver::zeGraphIsEmptyExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDumpContentsExt = driver::zeGraphDumpContentsExt; - } - - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDestroyExt = driver::zeGraphDestroyExt; - } - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -9305,6 +9219,92 @@ zeGetFabricVertexExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetSourceGraphExt = driver::zeExecutableGraphGetSourceGraphExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = driver::zeExecutableGraphDestroyExt; + } + + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnCreateExt = driver::zeGraphCreateExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPrimaryCommandListExt = driver::zeGraphGetPrimaryCommandListExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnSetDestructionCallbackExt = driver::zeGraphSetDestructionCallbackExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnInstantiateExt = driver::zeGraphInstantiateExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsEmptyExt = driver::zeGraphIsEmptyExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDumpContentsExt = driver::zeGraphDumpContentsExt; + } + + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = driver::zeGraphDestroyExt; + } + + return result; +} + #if defined(__cplusplus) }; #endif diff --git a/source/drivers/null/zes_nullddi.cpp b/source/drivers/null/zes_nullddi.cpp index 19a9b038..9b765ec4 100644 --- a/source/drivers/null/zes_nullddi.cpp +++ b/source/drivers/null/zes_nullddi.cpp @@ -3927,35 +3927,6 @@ namespace driver return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt - __zedlllocal ze_result_t ZE_APICALL - zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - 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 pfnPciLinkSpeedUpdateExt = context.zesDdiTable.Device.pfnPciLinkSpeedUpdateExt; - if( nullptr != pfnPciLinkSpeedUpdateExt ) - { - result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - } - else - { - // generic implementation - } - - char *env_str = context.setenv_var_with_driver_id("zesDevicePciLinkSpeedUpdateExt", ZEL_NULL_DRIVER_ID); - context.env_vars.push_back(env_str); - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesPowerGetLimitsExt __zedlllocal ze_result_t ZE_APICALL @@ -4790,6 +4761,35 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + 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 pfnPciLinkSpeedUpdateExt = context.zesDdiTable.Device.pfnPciLinkSpeedUpdateExt; + if( nullptr != pfnPciLinkSpeedUpdateExt ) + { + result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesDevicePciLinkSpeedUpdateExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + } // namespace driver #if defined(__cplusplus) diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index c42b5a16..ac2183cd 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -1198,1045 +1198,1045 @@ namespace driver } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp + /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { 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 pfnGetConcurrentMetricGroupsExp = context.zetDdiTable.DeviceExp.pfnGetConcurrentMetricGroupsExp; - if( nullptr != pfnGetConcurrentMetricGroupsExp ) + auto pfnCalculateMultipleMetricValuesExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + if( nullptr != pfnCalculateMultipleMetricValuesExp ) { - result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetDeviceGetConcurrentMetricGroupsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCalculateMultipleMetricValuesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerCreateExp + /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { 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 pfnCreateExp = context.zetDdiTable.MetricTracerExp.pfnCreateExp; - if( nullptr != pfnCreateExp ) + auto pfnGetGlobalTimestampsExp = context.zetDdiTable.MetricGroupExp.pfnGetGlobalTimestampsExp; + if( nullptr != pfnGetGlobalTimestampsExp ) { - result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); } else { // generic implementation - *phMetricTracer = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupGetGlobalTimestampsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDestroyExp + /// @brief Intercept function for zetMetricGroupGetExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { 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 pfnDestroyExp = context.zetDdiTable.MetricTracerExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnGetExportDataExp = context.zetDdiTable.MetricGroupExp.pfnGetExportDataExp; + if( nullptr != pfnGetExportDataExp ) { - result = pfnDestroyExp( hMetricTracer ); + result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupGetExportDataExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerEnableExp + /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { 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 pfnEnableExp = context.zetDdiTable.MetricTracerExp.pfnEnableExp; - if( nullptr != pfnEnableExp ) + auto pfnCalculateMetricExportDataExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMetricExportDataExp; + if( nullptr != pfnCalculateMetricExportDataExp ) { - result = pfnEnableExp( hMetricTracer, synchronous ); + result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerEnableExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCalculateMetricExportDataExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDisableExp + /// @brief Intercept function for zetMetricProgrammableGetExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. + zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { 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 pfnDisableExp = context.zetDdiTable.MetricTracerExp.pfnDisableExp; - if( nullptr != pfnDisableExp ) + auto pfnGetExp = context.zetDdiTable.MetricProgrammableExp.pfnGetExp; + if( nullptr != pfnGetExp ) { - result = pfnDisableExp( hMetricTracer, synchronous ); + result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phMetricProgrammables ) && ( i < *pCount ); ++i ) + phMetricProgrammables[ i ] = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDisableExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerReadDataExp + /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { 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 pfnReadDataExp = context.zetDdiTable.MetricTracerExp.pfnReadDataExp; - if( nullptr != pfnReadDataExp ) + auto pfnGetPropertiesExp = context.zetDdiTable.MetricProgrammableExp.pfnGetPropertiesExp; + if( nullptr != pfnGetPropertiesExp ) { - result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerReadDataExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetPropertiesExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderCreateExp + /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { 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 pfnCreateExp = context.zetDdiTable.MetricDecoderExp.pfnCreateExp; - if( nullptr != pfnCreateExp ) + auto pfnGetParamInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamInfoExp; + if( nullptr != pfnGetParamInfoExp ) { - result = pfnCreateExp( hMetricTracer, phMetricDecoder ); + result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); } else { // generic implementation - *phMetricDecoder = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetParamInfoExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderDestroyExp + /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { 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 pfnDestroyExp = context.zetDdiTable.MetricDecoderExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnGetParamValueInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamValueInfoExp; + if( nullptr != pfnGetParamValueInfoExp ) { - result = pfnDestroyExp( phMetricDecoder ); + result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetParamValueInfoExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { 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 pfnGetDecodableMetricsExp = context.zetDdiTable.MetricDecoderExp.pfnGetDecodableMetricsExp; - if( nullptr != pfnGetDecodableMetricsExp ) + auto pfnCreateFromProgrammableExp2 = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp2; + if( nullptr != pfnCreateFromProgrammableExp2 ) { - result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phMetrics ) && ( i < *pCount ); ++i ) - phMetrics[ i ] = reinterpret_cast( context.get() ); + for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) + phMetricHandles[ i ] = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderGetDecodableMetricsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricCreateFromProgrammableExp2", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDecodeExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { 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 pfnDecodeExp = context.zetDdiTable.MetricTracerExp.pfnDecodeExp; - if( nullptr != pfnDecodeExp ) + auto pfnCreateFromProgrammableExp = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp; + if( nullptr != pfnCreateFromProgrammableExp ) { - result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) + phMetricHandles[ i ] = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDecodeExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricCreateFromProgrammableExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp + /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { 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 pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; - if( nullptr != pfnAppendMarkerExp ) + auto pfnCreateMetricGroupsFromMetricsExp = context.zetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; + if( nullptr != pfnCreateMetricGroupsFromMetricsExp ) { - result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phMetricGroup ) && ( i < *pMetricGroupCount ); ++i ) + phMetricGroup[ i ] = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetCommandListAppendMarkerExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetDeviceCreateMetricGroupsFromMetricsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp + /// @brief Intercept function for zetMetricGroupCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { 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 pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; - if( nullptr != pfnEnableMetricsExp ) + auto pfnCreateExp = context.zetDdiTable.MetricGroupExp.pfnCreateExp; + if( nullptr != pfnCreateExp ) { - result = pfnEnableMetricsExp( hDevice ); + result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); } else { // generic implementation + *phMetricGroup = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetDeviceEnableMetricsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceDisableMetricsExp + /// @brief Intercept function for zetMetricGroupAddMetricExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { 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 pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; - if( nullptr != pfnDisableMetricsExp ) + auto pfnAddMetricExp = context.zetDdiTable.MetricGroupExp.pfnAddMetricExp; + if( nullptr != pfnAddMetricExp ) { - result = pfnDisableMetricsExp( hDevice ); + result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetDeviceDisableMetricsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupAddMetricExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp + /// @brief Intercept function for zetMetricGroupRemoveMetricExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { 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 pfnCalculateMultipleMetricValuesExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; - if( nullptr != pfnCalculateMultipleMetricValuesExp ) + auto pfnRemoveMetricExp = context.zetDdiTable.MetricGroupExp.pfnRemoveMetricExp; + if( nullptr != pfnRemoveMetricExp ) { - result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnRemoveMetricExp( hMetricGroup, hMetric ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCalculateMultipleMetricValuesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupRemoveMetricExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp + /// @brief Intercept function for zetMetricGroupCloseExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { 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 pfnGetGlobalTimestampsExp = context.zetDdiTable.MetricGroupExp.pfnGetGlobalTimestampsExp; - if( nullptr != pfnGetGlobalTimestampsExp ) + auto pfnCloseExp = context.zetDdiTable.MetricGroupExp.pfnCloseExp; + if( nullptr != pfnCloseExp ) { - result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + result = pfnCloseExp( hMetricGroup ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupGetGlobalTimestampsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCloseExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetExportDataExp + /// @brief Intercept function for zetMetricGroupDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { 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 pfnGetExportDataExp = context.zetDdiTable.MetricGroupExp.pfnGetExportDataExp; - if( nullptr != pfnGetExportDataExp ) + auto pfnDestroyExp = context.zetDdiTable.MetricGroupExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + result = pfnDestroyExp( hMetricGroup ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupGetExportDataExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricGroupDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp + /// @brief Intercept function for zetMetricDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { 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 pfnCalculateMetricExportDataExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMetricExportDataExp; - if( nullptr != pfnCalculateMetricExportDataExp ) + auto pfnDestroyExp = context.zetDdiTable.MetricExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnDestroyExp( hMetric ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCalculateMetricExportDataExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetExp + /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetExp( + zetDeviceGetConcurrentMetricGroupsExp( zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { 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 pfnGetExp = context.zetDdiTable.MetricProgrammableExp.pfnGetExp; - if( nullptr != pfnGetExp ) + auto pfnGetConcurrentMetricGroupsExp = context.zetDdiTable.DeviceExp.pfnGetConcurrentMetricGroupsExp; + if( nullptr != pfnGetConcurrentMetricGroupsExp ) { - result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phMetricProgrammables ) && ( i < *pCount ); ++i ) - phMetricProgrammables[ i ] = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetDeviceGetConcurrentMetricGroupsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp + /// @brief Intercept function for zetMetricTracerCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { 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 pfnGetPropertiesExp = context.zetDdiTable.MetricProgrammableExp.pfnGetPropertiesExp; - if( nullptr != pfnGetPropertiesExp ) + auto pfnCreateExp = context.zetDdiTable.MetricTracerExp.pfnCreateExp; + if( nullptr != pfnCreateExp ) { - result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); } else { // generic implementation + *phMetricTracer = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetPropertiesExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp + /// @brief Intercept function for zetMetricTracerDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { 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 pfnGetParamInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamInfoExp; - if( nullptr != pfnGetParamInfoExp ) + auto pfnDestroyExp = context.zetDdiTable.MetricTracerExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + result = pfnDestroyExp( hMetricTracer ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetParamInfoExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp + /// @brief Intercept function for zetMetricTracerEnableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { 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 pfnGetParamValueInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamValueInfoExp; - if( nullptr != pfnGetParamValueInfoExp ) + auto pfnEnableExp = context.zetDdiTable.MetricTracerExp.pfnEnableExp; + if( nullptr != pfnEnableExp ) { - result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + result = pfnEnableExp( hMetricTracer, synchronous ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricProgrammableGetParamValueInfoExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerEnableExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 + /// @brief Intercept function for zetMetricTracerDisableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { 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 pfnCreateFromProgrammableExp2 = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp2; - if( nullptr != pfnCreateFromProgrammableExp2 ) + auto pfnDisableExp = context.zetDdiTable.MetricTracerExp.pfnDisableExp; + if( nullptr != pfnDisableExp ) { - result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + result = pfnDisableExp( hMetricTracer, synchronous ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) - phMetricHandles[ i ] = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricCreateFromProgrammableExp2", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDisableExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp + /// @brief Intercept function for zetMetricTracerReadDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { 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 pfnCreateFromProgrammableExp = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp; - if( nullptr != pfnCreateFromProgrammableExp ) + auto pfnReadDataExp = context.zetDdiTable.MetricTracerExp.pfnReadDataExp; + if( nullptr != pfnReadDataExp ) { - result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) - phMetricHandles[ i ] = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricCreateFromProgrammableExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerReadDataExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp + /// @brief Intercept function for zetMetricDecoderCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { 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 pfnCreateMetricGroupsFromMetricsExp = context.zetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; - if( nullptr != pfnCreateMetricGroupsFromMetricsExp ) + auto pfnCreateExp = context.zetDdiTable.MetricDecoderExp.pfnCreateExp; + if( nullptr != pfnCreateExp ) { - result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + result = pfnCreateExp( hMetricTracer, phMetricDecoder ); } else { // generic implementation - for( size_t i = 0; ( nullptr != phMetricGroup ) && ( i < *pMetricGroupCount ); ++i ) - phMetricGroup[ i ] = reinterpret_cast( context.get() ); + *phMetricDecoder = reinterpret_cast( context.get() ); } - char *env_str = context.setenv_var_with_driver_id("zetDeviceCreateMetricGroupsFromMetricsExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderCreateExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCreateExp + /// @brief Intercept function for zetMetricDecoderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { 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 pfnCreateExp = context.zetDdiTable.MetricGroupExp.pfnCreateExp; - if( nullptr != pfnCreateExp ) + auto pfnDestroyExp = context.zetDdiTable.MetricDecoderExp.pfnDestroyExp; + if( nullptr != pfnDestroyExp ) { - result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + result = pfnDestroyExp( phMetricDecoder ); } else { // generic implementation - *phMetricGroup = reinterpret_cast( context.get() ); - } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCreateExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderDestroyExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupAddMetricExp + /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { 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 pfnAddMetricExp = context.zetDdiTable.MetricGroupExp.pfnAddMetricExp; - if( nullptr != pfnAddMetricExp ) + auto pfnGetDecodableMetricsExp = context.zetDdiTable.MetricDecoderExp.pfnGetDecodableMetricsExp; + if( nullptr != pfnGetDecodableMetricsExp ) { - result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); } else { // generic implementation + for( size_t i = 0; ( nullptr != phMetrics ) && ( i < *pCount ); ++i ) + phMetrics[ i ] = reinterpret_cast( context.get() ); + } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupAddMetricExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricDecoderGetDecodableMetricsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupRemoveMetricExp + /// @brief Intercept function for zetMetricTracerDecodeExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { 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 pfnRemoveMetricExp = context.zetDdiTable.MetricGroupExp.pfnRemoveMetricExp; - if( nullptr != pfnRemoveMetricExp ) + auto pfnDecodeExp = context.zetDdiTable.MetricTracerExp.pfnDecodeExp; + if( nullptr != pfnDecodeExp ) { - result = pfnRemoveMetricExp( hMetricGroup, hMetric ); + result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupRemoveMetricExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetMetricTracerDecodeExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCloseExp + /// @brief Intercept function for zetCommandListAppendMarkerExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { 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 pfnCloseExp = context.zetDdiTable.MetricGroupExp.pfnCloseExp; - if( nullptr != pfnCloseExp ) + auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; + if( nullptr != pfnAppendMarkerExp ) { - result = pfnCloseExp( hMetricGroup ); + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupCloseExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetCommandListAppendMarkerExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupDestroyExp + /// @brief Intercept function for zetDeviceEnableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { 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 pfnDestroyExp = context.zetDdiTable.MetricGroupExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + if( nullptr != pfnEnableMetricsExp ) { - result = pfnDestroyExp( hMetricGroup ); + result = pfnEnableMetricsExp( hDevice ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricGroupDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetDeviceEnableMetricsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDestroyExp + /// @brief Intercept function for zetDeviceDisableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { 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 pfnDestroyExp = context.zetDdiTable.MetricExp.pfnDestroyExp; - if( nullptr != pfnDestroyExp ) + auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; + if( nullptr != pfnDisableMetricsExp ) { - result = pfnDestroyExp( hMetric ); + result = pfnDisableMetricsExp( hDevice ); } else { // generic implementation } - char *env_str = context.setenv_var_with_driver_id("zetMetricDestroyExp", ZEL_NULL_DRIVER_ID); + char *env_str = context.setenv_var_with_driver_id("zetDeviceDisableMetricsExp", ZEL_NULL_DRIVER_ID); context.env_vars.push_back(env_str); return result; diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index 85ea3f4c..d5331aac 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -26,27 +26,6 @@ typedef struct _zel_ze_global_callbacks_t ze_pfnInitDriversCb_t pfnInitDriversCb; } zel_ze_global_callbacks_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of ExecutableGraph callback functions pointers -typedef struct _zel_ze_executable_graph_callbacks_t -{ - ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb; - ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb; -} zel_ze_executable_graph_callbacks_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of Graph callback functions pointers -typedef struct _zel_ze_graph_callbacks_t -{ - ze_pfnGraphCreateExtCb_t pfnCreateExtCb; - ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb; - ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb; - ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb; - ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb; - ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb; - ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb; -} zel_ze_graph_callbacks_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Table of RTASBuilder callback functions pointers typedef struct _zel_ze_rtas_builder_callbacks_t @@ -200,6 +179,7 @@ typedef struct _zel_ze_command_list_callbacks_t ze_pfnCommandListImmediateGetFlagsCb_t pfnImmediateGetFlagsCb; ze_pfnCommandListImmediateGetModeCb_t pfnImmediateGetModeCb; ze_pfnCommandListImmediateGetPriorityCb_t pfnImmediateGetPriorityCb; + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb; ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb; ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb; ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb; @@ -207,7 +187,6 @@ typedef struct _zel_ze_command_list_callbacks_t ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb; ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb; ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb; - ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb; ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb; ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb; ze_pfnCommandListHostSynchronizeCb_t pfnHostSynchronizeCb; @@ -404,13 +383,32 @@ typedef struct _zel_ze_fabric_vertex_callbacks_t ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb; } zel_ze_fabric_vertex_callbacks_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of ExecutableGraph callback functions pointers +typedef struct _zel_ze_executable_graph_callbacks_t +{ + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb; + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb; +} zel_ze_executable_graph_callbacks_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of Graph callback functions pointers +typedef struct _zel_ze_graph_callbacks_t +{ + ze_pfnGraphCreateExtCb_t pfnCreateExtCb; + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb; + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb; + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb; + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb; + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb; + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb; +} zel_ze_graph_callbacks_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Container for all callbacks typedef struct _zel_ze_all_callbacks_t { zel_ze_global_callbacks_t Global; - zel_ze_executable_graph_callbacks_t ExecutableGraph; - zel_ze_graph_callbacks_t Graph; zel_ze_rtas_builder_callbacks_t RTASBuilder; zel_ze_rtas_parallel_operation_callbacks_t RTASParallelOperation; zel_ze_driver_callbacks_t Driver; @@ -431,6 +429,8 @@ typedef struct _zel_ze_all_callbacks_t zel_ze_virtual_mem_callbacks_t VirtualMem; zel_ze_fabric_edge_callbacks_t FabricEdge; zel_ze_fabric_vertex_callbacks_t FabricVertex; + zel_ze_executable_graph_callbacks_t ExecutableGraph; + zel_ze_graph_callbacks_t Graph; } zel_ze_all_callbacks_t; diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index 80c4c402..9ac38900 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -2756,1232 +2756,1232 @@ zelTracerKernelSetGlobalOffsetExpRegisterCallback( ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetBinaryExpRegisterCallback( +zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb + ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Kernel.pfnGetBinaryExpCb = pfnGetBinaryExpCb; + cbs.Device.pfnReserveCacheExtCb = pfnReserveCacheExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( +zelTracerDeviceSetCacheAdviceExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb + ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnImportExternalSemaphoreExtCb = pfnImportExternalSemaphoreExtCb; + cbs.Device.pfnSetCacheAdviceExtCb = pfnSetCacheAdviceExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( +zelTracerEventQueryTimestampsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb + ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnReleaseExternalSemaphoreExtCb = pfnReleaseExternalSemaphoreExtCb; + cbs.Event.pfnQueryTimestampsExpCb = pfnQueryTimestampsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( +zelTracerImageGetMemoryPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb + ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendSignalExternalSemaphoreExtCb = pfnAppendSignalExternalSemaphoreExtCb; + cbs.Image.pfnGetMemoryPropertiesExpCb = pfnGetMemoryPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( +zelTracerImageViewCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb + ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendWaitExternalSemaphoreExtCb = pfnAppendWaitExternalSemaphoreExtCb; + cbs.Image.pfnViewCreateExtCb = pfnViewCreateExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( +zelTracerImageViewCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnCreateExtCb = pfnCreateExtCb; + cbs.Image.pfnViewCreateExpCb = pfnViewCreateExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( +zelTracerKernelSchedulingHintExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnGetBuildPropertiesExtCb = pfnGetBuildPropertiesExtCb; + cbs.Kernel.pfnSchedulingHintExpCb = pfnSchedulingHintExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( +zelTracerDevicePciGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Driver.pfnRTASFormatCompatibilityCheckExtCb = pfnRTASFormatCompatibilityCheckExtCb; + cbs.Device.pfnPciGetPropertiesExtCb = pfnPciGetPropertiesExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( +zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnBuildExtCb = pfnBuildExtCb; + cbs.CommandList.pfnAppendImageCopyToMemoryExtCb = pfnAppendImageCopyToMemoryExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( +zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnCommandListAppendCopyExtCb = pfnCommandListAppendCopyExtCb; + cbs.CommandList.pfnAppendImageCopyFromMemoryExtCb = pfnAppendImageCopyFromMemoryExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( +zelTracerImageGetAllocPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnDestroyExtCb = pfnDestroyExtCb; + cbs.Image.pfnGetAllocPropertiesExtCb = pfnGetAllocPropertiesExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( +zelTracerModuleInspectLinkageExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnCreateExtCb = pfnCreateExtCb; + cbs.Module.pfnInspectLinkageExtCb = pfnInspectLinkageExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( +zelTracerMemFreeExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ze_pfnMemFreeExtCb_t pfnFreeExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnGetPropertiesExtCb = pfnGetPropertiesExtCb; + cbs.Mem.pfnFreeExtCb = pfnFreeExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( +zelTracerFabricVertexGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ze_pfnFabricVertexGetExpCb_t pfnGetExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnJoinExtCb = pfnJoinExtCb; + cbs.FabricVertex.pfnGetExpCb = pfnGetExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( +zelTracerFabricVertexGetSubVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnDestroyExtCb = pfnDestroyExtCb; + cbs.FabricVertex.pfnGetSubVerticesExpCb = pfnGetSubVerticesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( +zelTracerFabricVertexGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnGetVectorWidthPropertiesExtCb = pfnGetVectorWidthPropertiesExtCb; + cbs.FabricVertex.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetAllocationPropertiesExpRegisterCallback( +zelTracerFabricVertexGetDeviceExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb + ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Kernel.pfnGetAllocationPropertiesExpCb = pfnGetAllocationPropertiesExpCb; + cbs.FabricVertex.pfnGetDeviceExpCb = pfnGetDeviceExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( +zelTracerDeviceGetFabricVertexExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb + ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Mem.pfnGetIpcHandleWithPropertiesCb = pfnGetIpcHandleWithPropertiesCb; + cbs.Device.pfnGetFabricVertexExpCb = pfnGetFabricVertexExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphCreateExtRegisterCallback( +zelTracerFabricEdgeGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnCreateExtCb = pfnCreateExtCb; + cbs.FabricEdge.pfnGetExpCb = pfnGetExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginGraphCaptureExtRegisterCallback( +zelTracerFabricEdgeGetVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnBeginGraphCaptureExtCb = pfnBeginGraphCaptureExtCb; + cbs.FabricEdge.pfnGetVerticesExpCb = pfnGetVerticesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( +zelTracerFabricEdgeGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnBeginCaptureIntoGraphExtCb = pfnBeginCaptureIntoGraphExtCb; + cbs.FabricEdge.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( +zelTracerEventQueryKernelTimestampsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnIsGraphCaptureEnabledExtCb = pfnIsGraphCaptureEnabledExtCb; + cbs.Event.pfnQueryKernelTimestampsExtCb = pfnQueryKernelTimestampsExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListEndGraphCaptureExtRegisterCallback( +zelTracerRTASBuilderCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnEndGraphCaptureExtCb = pfnEndGraphCaptureExtCb; + cbs.RTASBuilder.pfnCreateExpCb = pfnCreateExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetGraphExtRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnGetGraphExtCb = pfnGetGraphExtCb; + cbs.RTASBuilder.pfnGetBuildPropertiesExpCb = pfnGetBuildPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphGetPrimaryCommandListExtRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnGetPrimaryCommandListExtCb = pfnGetPrimaryCommandListExtCb; + cbs.Driver.pfnRTASFormatCompatibilityCheckExpCb = pfnRTASFormatCompatibilityCheckExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphSetDestructionCallbackExtRegisterCallback( +zelTracerRTASBuilderBuildExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnSetDestructionCallbackExtCb = pfnSetDestructionCallbackExtCb; + cbs.RTASBuilder.pfnBuildExpCb = pfnBuildExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphInstantiateExtRegisterCallback( +zelTracerRTASBuilderDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnInstantiateExtCb = pfnInstantiateExtCb; + cbs.RTASBuilder.pfnDestroyExpCb = pfnDestroyExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendGraphExtRegisterCallback( +zelTracerRTASParallelOperationCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendGraphExtCb = pfnAppendGraphExtCb; + cbs.RTASParallelOperation.pfnCreateExpCb = pfnCreateExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.ExecutableGraph.pfnGetSourceGraphExtCb = pfnGetSourceGraphExtCb; + cbs.RTASParallelOperation.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphIsEmptyExtRegisterCallback( +zelTracerRTASParallelOperationJoinExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnIsEmptyExtCb = pfnIsEmptyExtCb; + cbs.RTASParallelOperation.pfnJoinExpCb = pfnJoinExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphDumpContentsExtRegisterCallback( +zelTracerRTASParallelOperationDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnDumpContentsExtCb = pfnDumpContentsExtCb; + cbs.RTASParallelOperation.pfnDestroyExpCb = pfnDestroyExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphDestroyExtRegisterCallback( +zelTracerMemGetPitchFor2dImageRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.ExecutableGraph.pfnDestroyExtCb = pfnDestroyExtCb; + cbs.Mem.pfnGetPitchFor2dImageCb = pfnGetPitchFor2dImageCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerGraphDestroyExtRegisterCallback( +zelTracerImageGetDeviceOffsetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Graph.pfnDestroyExtCb = pfnDestroyExtCb; + cbs.Image.pfnGetDeviceOffsetExpCb = pfnGetDeviceOffsetExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendHostFunctionRegisterCallback( +zelTracerCommandListCreateCloneExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendHostFunctionCb = pfnAppendHostFunctionCb; + cbs.CommandList.pfnCreateCloneExpCb = pfnCreateCloneExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReserveCacheExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnReserveCacheExtCb = pfnReserveCacheExtCb; + cbs.CommandList.pfnImmediateAppendCommandListsExpCb = pfnImmediateAppendCommandListsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceSetCacheAdviceExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnSetCacheAdviceExtCb = pfnSetCacheAdviceExtCb; + cbs.CommandList.pfnImmediateAppendCommandListsWithParametersCb = pfnImmediateAppendCommandListsWithParametersCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryTimestampsExpRegisterCallback( +zelTracerCommandListGetNextCommandIdExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Event.pfnQueryTimestampsExpCb = pfnQueryTimestampsExpCb; + cbs.CommandList.pfnGetNextCommandIdExpCb = pfnGetNextCommandIdExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerImageGetMemoryPropertiesExpRegisterCallback( +zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Image.pfnGetMemoryPropertiesExpCb = pfnGetMemoryPropertiesExpCb; + cbs.CommandList.pfnGetNextCommandIdWithKernelsExpCb = pfnGetNextCommandIdWithKernelsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Image.pfnViewCreateExtCb = pfnViewCreateExtCb; + cbs.CommandList.pfnUpdateMutableCommandsExpCb = pfnUpdateMutableCommandsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExpRegisterCallback( +zelTracerCommandListIsMutableExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Image.pfnViewCreateExpCb = pfnViewCreateExpCb; + cbs.CommandList.pfnIsMutableExpCb = pfnIsMutableExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerKernelSchedulingHintExpRegisterCallback( +zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Kernel.pfnSchedulingHintExpCb = pfnSchedulingHintExpCb; + cbs.CommandList.pfnUpdateMutableCommandSignalEventExpCb = pfnUpdateMutableCommandSignalEventExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDevicePciGetPropertiesExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnPciGetPropertiesExtCb = pfnPciGetPropertiesExtCb; + cbs.CommandList.pfnUpdateMutableCommandWaitEventsExpCb = pfnUpdateMutableCommandWaitEventsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendImageCopyToMemoryExtCb = pfnAppendImageCopyToMemoryExtCb; + cbs.CommandList.pfnUpdateMutableCommandKernelsExpCb = pfnUpdateMutableCommandKernelsExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( +zelTracerKernelGetBinaryExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnAppendImageCopyFromMemoryExtCb = pfnAppendImageCopyFromMemoryExtCb; + cbs.Kernel.pfnGetBinaryExpCb = pfnGetBinaryExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerImageGetAllocPropertiesExtRegisterCallback( +zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Image.pfnGetAllocPropertiesExtCb = pfnGetAllocPropertiesExtCb; + cbs.Device.pfnImportExternalSemaphoreExtCb = pfnImportExternalSemaphoreExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerModuleInspectLinkageExtRegisterCallback( +zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Module.pfnInspectLinkageExtCb = pfnInspectLinkageExtCb; + cbs.Device.pfnReleaseExternalSemaphoreExtCb = pfnReleaseExternalSemaphoreExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerMemFreeExtRegisterCallback( +zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Mem.pfnFreeExtCb = pfnFreeExtCb; + cbs.CommandList.pfnAppendSignalExternalSemaphoreExtCb = pfnAppendSignalExternalSemaphoreExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetExpRegisterCallback( +zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricVertex.pfnGetExpCb = pfnGetExpCb; + cbs.CommandList.pfnAppendWaitExternalSemaphoreExtCb = pfnAppendWaitExternalSemaphoreExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetSubVerticesExpRegisterCallback( +zelTracerRTASBuilderCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricVertex.pfnGetSubVerticesExpCb = pfnGetSubVerticesExpCb; + cbs.RTASBuilder.pfnCreateExtCb = pfnCreateExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetPropertiesExpRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricVertex.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; + cbs.RTASBuilder.pfnGetBuildPropertiesExtCb = pfnGetBuildPropertiesExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetDeviceExpRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricVertex.pfnGetDeviceExpCb = pfnGetDeviceExpCb; + cbs.Driver.pfnRTASFormatCompatibilityCheckExtCb = pfnRTASFormatCompatibilityCheckExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetFabricVertexExpRegisterCallback( +zelTracerRTASBuilderBuildExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnGetFabricVertexExpCb = pfnGetFabricVertexExpCb; + cbs.RTASBuilder.pfnBuildExtCb = pfnBuildExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetExpRegisterCallback( +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricEdge.pfnGetExpCb = pfnGetExpCb; + cbs.RTASBuilder.pfnCommandListAppendCopyExtCb = pfnCommandListAppendCopyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetVerticesExpRegisterCallback( +zelTracerRTASBuilderDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricEdge.pfnGetVerticesExpCb = pfnGetVerticesExpCb; + cbs.RTASBuilder.pfnDestroyExtCb = pfnDestroyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.FabricEdge.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; + cbs.RTASParallelOperation.pfnCreateExtCb = pfnCreateExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryKernelTimestampsExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Event.pfnQueryKernelTimestampsExtCb = pfnQueryKernelTimestampsExtCb; + cbs.RTASParallelOperation.pfnGetPropertiesExtCb = pfnGetPropertiesExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExpRegisterCallback( +zelTracerRTASParallelOperationJoinExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnCreateExpCb = pfnCreateExpCb; + cbs.RTASParallelOperation.pfnJoinExtCb = pfnJoinExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnGetBuildPropertiesExpCb = pfnGetBuildPropertiesExpCb; + cbs.RTASParallelOperation.pfnDestroyExtCb = pfnDestroyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Driver.pfnRTASFormatCompatibilityCheckExpCb = pfnRTASFormatCompatibilityCheckExpCb; + cbs.Device.pfnGetVectorWidthPropertiesExtCb = pfnGetVectorWidthPropertiesExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExpRegisterCallback( +zelTracerKernelGetAllocationPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb + ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnBuildExpCb = pfnBuildExpCb; + cbs.Kernel.pfnGetAllocationPropertiesExpCb = pfnGetAllocationPropertiesExpCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExpRegisterCallback( +zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb + ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnDestroyExpCb = pfnDestroyExpCb; + cbs.Mem.pfnGetIpcHandleWithPropertiesCb = pfnGetIpcHandleWithPropertiesCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExpRegisterCallback( +zelTracerGraphCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnCreateExpCb = pfnCreateExpCb; + cbs.Graph.pfnCreateExtCb = pfnCreateExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnGetPropertiesExpCb = pfnGetPropertiesExpCb; + cbs.CommandList.pfnBeginGraphCaptureExtCb = pfnBeginGraphCaptureExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExpRegisterCallback( +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnJoinExpCb = pfnJoinExpCb; + cbs.CommandList.pfnBeginCaptureIntoGraphExtCb = pfnBeginCaptureIntoGraphExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExpRegisterCallback( +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnDestroyExpCb = pfnDestroyExpCb; + cbs.CommandList.pfnIsGraphCaptureEnabledExtCb = pfnIsGraphCaptureEnabledExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerMemGetPitchFor2dImageRegisterCallback( +zelTracerCommandListEndGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Mem.pfnGetPitchFor2dImageCb = pfnGetPitchFor2dImageCb; + cbs.CommandList.pfnEndGraphCaptureExtCb = pfnEndGraphCaptureExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerImageGetDeviceOffsetExpRegisterCallback( +zelTracerCommandListGetGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.Image.pfnGetDeviceOffsetExpCb = pfnGetDeviceOffsetExpCb; + cbs.CommandList.pfnGetGraphExtCb = pfnGetGraphExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListCreateCloneExpRegisterCallback( +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnCreateCloneExpCb = pfnCreateCloneExpCb; + cbs.Graph.pfnGetPrimaryCommandListExtCb = pfnGetPrimaryCommandListExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( +zelTracerGraphSetDestructionCallbackExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnImmediateAppendCommandListsExpCb = pfnImmediateAppendCommandListsExpCb; + cbs.Graph.pfnSetDestructionCallbackExtCb = pfnSetDestructionCallbackExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( +zelTracerGraphInstantiateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnImmediateAppendCommandListsWithParametersCb = pfnImmediateAppendCommandListsWithParametersCb; + cbs.Graph.pfnInstantiateExtCb = pfnInstantiateExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdExpRegisterCallback( +zelTracerCommandListAppendGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnGetNextCommandIdExpCb = pfnGetNextCommandIdExpCb; + cbs.CommandList.pfnAppendGraphExtCb = pfnAppendGraphExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnGetNextCommandIdWithKernelsExpCb = pfnGetNextCommandIdWithKernelsExpCb; + cbs.ExecutableGraph.pfnGetSourceGraphExtCb = pfnGetSourceGraphExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( +zelTracerGraphIsEmptyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnUpdateMutableCommandsExpCb = pfnUpdateMutableCommandsExpCb; + cbs.Graph.pfnIsEmptyExtCb = pfnIsEmptyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsMutableExpRegisterCallback( +zelTracerGraphDumpContentsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnIsMutableExpCb = pfnIsMutableExpCb; + cbs.Graph.pfnDumpContentsExtCb = pfnDumpContentsExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( +zelTracerExecutableGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnUpdateMutableCommandSignalEventExpCb = pfnUpdateMutableCommandSignalEventExpCb; + cbs.ExecutableGraph.pfnDestroyExtCb = pfnDestroyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( +zelTracerGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnUpdateMutableCommandWaitEventsExpCb = pfnUpdateMutableCommandWaitEventsExpCb; + cbs.Graph.pfnDestroyExtCb = pfnDestroyExtCb; return result; } ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( +zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb ) { ze_result_t result; auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); if (result == ZE_RESULT_SUCCESS) - cbs.CommandList.pfnUpdateMutableCommandKernelsExpCb = pfnUpdateMutableCommandKernelsExpCb; + cbs.CommandList.pfnAppendHostFunctionCb = pfnAppendHostFunctionCb; return result; } diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index e145e560..cdaa5e2b 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -6821,407 +6821,399 @@ namespace tracing_layer } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { - auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; + auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; - if( nullptr == pfnGetBinaryExp) + if( nullptr == pfnReserveCacheExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnGetBinaryExp, hKernel, pSize, pKernelBinary); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReserveCacheExt, hDevice, cacheLevel, cacheReservationSize); // capture parameters - ze_kernel_get_binary_exp_params_t tracerParams = { - &hKernel, - &pSize, - &pKernelBinary + ze_device_reserve_cache_ext_params_t tracerParams = { + &hDevice, + &cacheLevel, + &cacheReservationSize }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelGetBinaryExpCb_t, Kernel, pfnGetBinaryExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReserveCacheExtCb_t, Device, pfnReserveCacheExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnGetBinaryExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReserveCacheExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phKernel, - *tracerParams.ppSize, - *tracerParams.ppKernelBinary); + *tracerParams.phDevice, + *tracerParams.pcacheLevel, + *tracerParams.pcacheReservationSize); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeDeviceSetCacheAdviceExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { - auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; + auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; - if( nullptr == pfnImportExternalSemaphoreExt) + if( nullptr == pfnSetCacheAdviceExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnImportExternalSemaphoreExt, hDevice, desc, phSemaphore); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnSetCacheAdviceExt, hDevice, ptr, regionSize, cacheRegion); // capture parameters - ze_device_import_external_semaphore_ext_params_t tracerParams = { + ze_device_set_cache_advice_ext_params_t tracerParams = { &hDevice, - &desc, - &phSemaphore + &ptr, + ®ionSize, + &cacheRegion }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceImportExternalSemaphoreExtCb_t, Device, pfnImportExternalSemaphoreExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceSetCacheAdviceExtCb_t, Device, pfnSetCacheAdviceExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnImportExternalSemaphoreExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnSetCacheAdviceExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phDevice, - *tracerParams.pdesc, - *tracerParams.pphSemaphore); + *tracerParams.pptr, + *tracerParams.pregionSize, + *tracerParams.pcacheRegion); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeEventQueryTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { - auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; + auto pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnReleaseExternalSemaphoreExt) + if( nullptr == pfnQueryTimestampsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt, hSemaphore); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.EventExp.pfnQueryTimestampsExp, hEvent, hDevice, pCount, pTimestamps); // capture parameters - ze_device_release_external_semaphore_ext_params_t tracerParams = { - &hSemaphore + ze_event_query_timestamps_exp_params_t tracerParams = { + &hEvent, + &hDevice, + &pCount, + &pTimestamps }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReleaseExternalSemaphoreExtCb_t, Device, pfnReleaseExternalSemaphoreExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnEventQueryTimestampsExpCb_t, Event, pfnQueryTimestampsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.EventExp.pfnQueryTimestampsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phSemaphore); + *tracerParams.phEvent, + *tracerParams.phDevice, + *tracerParams.ppCount, + *tracerParams.ppTimestamps); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeImageGetMemoryPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { - auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; + auto pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnAppendSignalExternalSemaphoreExt) + if( nullptr == pfnGetMemoryPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp, hImage, pMemoryProperties); // capture parameters - ze_command_list_append_signal_external_semaphore_ext_params_t tracerParams = { - &hCommandList, - &numSemaphores, - &phSemaphores, - &signalParams, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + ze_image_get_memory_properties_exp_params_t tracerParams = { + &hImage, + &pMemoryProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t, CommandList, pfnAppendSignalExternalSemaphoreExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetMemoryPropertiesExpCb_t, Image, pfnGetMemoryPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pnumSemaphores, - *tracerParams.pphSemaphores, - *tracerParams.psignalParams, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phImage, + *tracerParams.ppMemoryProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeImageViewCreateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; + auto pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt) + if( nullptr == pfnViewCreateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Image.pfnViewCreateExt, hContext, hDevice, desc, hImage, phImageView); // capture parameters - ze_command_list_append_wait_external_semaphore_ext_params_t tracerParams = { - &hCommandList, - &numSemaphores, - &phSemaphores, - &waitParams, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + ze_image_view_create_ext_params_t tracerParams = { + &hContext, + &hDevice, + &desc, + &hImage, + &phImageView }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t, CommandList, pfnAppendWaitExternalSemaphoreExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageViewCreateExtCb_t, Image, pfnViewCreateExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Image.pfnViewCreateExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pnumSemaphores, - *tracerParams.pphSemaphores, - *tracerParams.pwaitParams, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phContext, + *tracerParams.phDevice, + *tracerParams.pdesc, + *tracerParams.phImage, + *tracerParams.pphImageView); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeImageViewCreateExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + auto pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; - if( nullptr == pfnCreateExt) + if( nullptr == pfnViewCreateExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCreateExt, hDriver, pDescriptor, phBuilder); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnViewCreateExp, hContext, hDevice, desc, hImage, phImageView); // capture parameters - ze_rtas_builder_create_ext_params_t tracerParams = { - &hDriver, - &pDescriptor, - &phBuilder + ze_image_view_create_exp_params_t tracerParams = { + &hContext, + &hDevice, + &desc, + &hImage, + &phImageView }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExtCb_t, RTASBuilder, pfnCreateExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageViewCreateExpCb_t, Image, pfnViewCreateExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCreateExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnViewCreateExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.ppDescriptor, - *tracerParams.pphBuilder); + *tracerParams.phContext, + *tracerParams.phDevice, + *tracerParams.pdesc, + *tracerParams.phImage, + *tracerParams.pphImageView); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeKernelSchedulingHintExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { - auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + auto pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; - if( nullptr == pfnGetBuildPropertiesExt) + if( nullptr == pfnSchedulingHintExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, hBuilder, pBuildOpDescriptor, pProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnSchedulingHintExp, hKernel, pHint); // capture parameters - ze_rtas_builder_get_build_properties_ext_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pProperties + ze_kernel_scheduling_hint_exp_params_t tracerParams = { + &hKernel, + &pHint }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExtCb_t, RTASBuilder, pfnGetBuildPropertiesExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelSchedulingHintExpCb_t, Kernel, pfnSchedulingHintExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnSchedulingHintExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder, - *tracerParams.ppBuildOpDescriptor, - *tracerParams.ppProperties); + *tracerParams.phKernel, + *tracerParams.ppHint); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeDevicePciGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { - auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + auto pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt) + if( nullptr == pfnPciGetPropertiesExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, hDriver, rtasFormatA, rtasFormatB); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnPciGetPropertiesExt, hDevice, pPciProperties); // capture parameters - ze_driver_rtas_format_compatibility_check_ext_params_t tracerParams = { - &hDriver, - &rtasFormatA, - &rtasFormatB + ze_device_pci_get_properties_ext_params_t tracerParams = { + &hDevice, + &pPciProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t, Driver, pfnRTASFormatCompatibilityCheckExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDevicePciGetPropertiesExtCb_t, Device, pfnPciGetPropertiesExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnPciGetPropertiesExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.prtasFormatA, - *tracerParams.prtasFormatB); + *tracerParams.phDevice, + *tracerParams.ppPciProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + auto pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnBuildExt) + if( nullptr == pfnAppendImageCopyToMemoryExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnBuildExt, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_rtas_builder_build_ext_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pScratchBuffer, - &scratchBufferSizeBytes, - &pRtasBuffer, - &rtasBufferSizeBytes, - &hParallelOperation, - &pBuildUserPtr, - &pBounds, - &pRtasBufferSizeBytes + ze_command_list_append_image_copy_to_memory_ext_params_t tracerParams = { + &hCommandList, + &dstptr, + &hSrcImage, + &pSrcRegion, + &destRowPitch, + &destSlicePitch, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExtCb_t, RTASBuilder, pfnBuildExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendImageCopyToMemoryExtCb_t, CommandList, pfnAppendImageCopyToMemoryExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnBuildExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder, - *tracerParams.ppBuildOpDescriptor, - *tracerParams.ppScratchBuffer, - *tracerParams.pscratchBufferSizeBytes, - *tracerParams.ppRtasBuffer, - *tracerParams.prtasBufferSizeBytes, - *tracerParams.phParallelOperation, - *tracerParams.ppBuildUserPtr, - *tracerParams.ppBounds, - *tracerParams.ppRtasBufferSizeBytes); + *tracerParams.phCommandList, + *tracerParams.pdstptr, + *tracerParams.phSrcImage, + *tracerParams.ppSrcRegion, + *tracerParams.pdestRowPitch, + *tracerParams.pdestSlicePitch, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -7229,2727 +7221,2735 @@ namespace tracing_layer ///< on before launching ) { - auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + auto pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnCommandListAppendCopyExt) + if( nullptr == pfnAppendImageCopyFromMemoryExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_rtas_builder_command_list_append_copy_ext_params_t tracerParams = { + ze_command_list_append_image_copy_from_memory_ext_params_t tracerParams = { &hCommandList, - &dstptr, + &hDstImage, &srcptr, - &size, + &pDstRegion, + &srcRowPitch, + &srcSlicePitch, &hSignalEvent, &numWaitEvents, &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCommandListAppendCopyExtCb_t, RTASBuilder, pfnCommandListAppendCopyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t, CommandList, pfnAppendImageCopyFromMemoryExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phCommandList, - *tracerParams.pdstptr, + *tracerParams.phDstImage, *tracerParams.psrcptr, - *tracerParams.psize, + *tracerParams.ppDstRegion, + *tracerParams.psrcRowPitch, + *tracerParams.psrcSlicePitch, *tracerParams.phSignalEvent, *tracerParams.pnumWaitEvents, *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeImageGetAllocPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { - auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + auto pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; - if( nullptr == pfnDestroyExt) + if( nullptr == pfnGetAllocPropertiesExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnDestroyExt, hBuilder); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Image.pfnGetAllocPropertiesExt, hContext, hImage, pImageAllocProperties); // capture parameters - ze_rtas_builder_destroy_ext_params_t tracerParams = { - &hBuilder + ze_image_get_alloc_properties_ext_params_t tracerParams = { + &hContext, + &hImage, + &pImageAllocProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExtCb_t, RTASBuilder, pfnDestroyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetAllocPropertiesExtCb_t, Image, pfnGetAllocPropertiesExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnDestroyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Image.pfnGetAllocPropertiesExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder); + *tracerParams.phContext, + *tracerParams.phImage, + *tracerParams.ppImageAllocProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt + /// @brief Intercept function for zeModuleInspectLinkageExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { - auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + auto pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; - if( nullptr == pfnCreateExt) + if( nullptr == pfnInspectLinkageExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, hDriver, phParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Module.pfnInspectLinkageExt, pInspectDesc, numModules, phModules, phLog); // capture parameters - ze_rtas_parallel_operation_create_ext_params_t tracerParams = { - &hDriver, - &phParallelOperation + ze_module_inspect_linkage_ext_params_t tracerParams = { + &pInspectDesc, + &numModules, + &phModules, + &phLog }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationCreateExtCb_t, RTASParallelOperation, pfnCreateExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnModuleInspectLinkageExtCb_t, Module, pfnInspectLinkageExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Module.pfnInspectLinkageExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.pphParallelOperation); + *tracerParams.ppInspectDesc, + *tracerParams.pnumModules, + *tracerParams.pphModules, + *tracerParams.pphLog); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeMemFreeExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { - auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + auto pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; - if( nullptr == pfnGetPropertiesExt) + if( nullptr == pfnFreeExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, hParallelOperation, pProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnFreeExt, hContext, pMemFreeDesc, ptr); // capture parameters - ze_rtas_parallel_operation_get_properties_ext_params_t tracerParams = { - &hParallelOperation, - &pProperties + ze_mem_free_ext_params_t tracerParams = { + &hContext, + &pMemFreeDesc, + &ptr }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExtCb_t, RTASParallelOperation, pfnGetPropertiesExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemFreeExtCb_t, Mem, pfnFreeExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnFreeExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation, - *tracerParams.ppProperties); + *tracerParams.phContext, + *tracerParams.ppMemFreeDesc, + *tracerParams.pptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeFabricVertexGetExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { - auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + auto pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; - if( nullptr == pfnJoinExt) + if( nullptr == pfnGetExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, hParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetExp, hDriver, pCount, phVertices); // capture parameters - ze_rtas_parallel_operation_join_ext_params_t tracerParams = { - &hParallelOperation + ze_fabric_vertex_get_exp_params_t tracerParams = { + &hDriver, + &pCount, + &phVertices }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExtCb_t, RTASParallelOperation, pfnJoinExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetExpCb_t, FabricVertex, pfnGetExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); + *tracerParams.phDriver, + *tracerParams.ppCount, + *tracerParams.pphVertices); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { - auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + auto pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr == pfnDestroyExt) + if( nullptr == pfnGetSubVerticesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, hParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp, hVertex, pCount, phSubvertices); // capture parameters - ze_rtas_parallel_operation_destroy_ext_params_t tracerParams = { - &hParallelOperation + ze_fabric_vertex_get_sub_vertices_exp_params_t tracerParams = { + &hVertex, + &pCount, + &phSubvertices }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExtCb_t, RTASParallelOperation, pfnDestroyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetSubVerticesExpCb_t, FabricVertex, pfnGetSubVerticesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); + *tracerParams.phVertex, + *tracerParams.ppCount, + *tracerParams.pphSubvertices); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeFabricVertexGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { - auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + auto pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; - if( nullptr == pfnGetVectorWidthPropertiesExt) + if( nullptr == pfnGetPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, hDevice, pCount, pVectorWidthProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp, hVertex, pVertexProperties); // capture parameters - ze_device_get_vector_width_properties_ext_params_t tracerParams = { - &hDevice, - &pCount, - &pVectorWidthProperties + ze_fabric_vertex_get_properties_exp_params_t tracerParams = { + &hVertex, + &pVertexProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetVectorWidthPropertiesExtCb_t, Device, pfnGetVectorWidthPropertiesExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetPropertiesExpCb_t, FabricVertex, pfnGetPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.ppCount, - *tracerParams.ppVectorWidthProperties); + *tracerParams.phVertex, + *tracerParams.ppVertexProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeFabricVertexGetDeviceExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { - auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; + auto pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; - if( nullptr == pfnGetAllocationPropertiesExp) + if( nullptr == pfnGetDeviceExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp, hKernel, pCount, pAllocationProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp, hVertex, phDevice); // capture parameters - ze_kernel_get_allocation_properties_exp_params_t tracerParams = { - &hKernel, - &pCount, - &pAllocationProperties + ze_fabric_vertex_get_device_exp_params_t tracerParams = { + &hVertex, + &phDevice }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelGetAllocationPropertiesExpCb_t, Kernel, pfnGetAllocationPropertiesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetDeviceExpCb_t, FabricVertex, pfnGetDeviceExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phKernel, - *tracerParams.ppCount, - *tracerParams.ppAllocationProperties); + *tracerParams.phVertex, + *tracerParams.pphDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeDeviceGetFabricVertexExp __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { - auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; + auto pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; - if( nullptr == pfnGetIpcHandleWithProperties) + if( nullptr == pfnGetFabricVertexExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties, hContext, ptr, pNext, pIpcHandle); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp, hDevice, phVertex); // capture parameters - ze_mem_get_ipc_handle_with_properties_params_t tracerParams = { - &hContext, - &ptr, - &pNext, - &pIpcHandle + ze_device_get_fabric_vertex_exp_params_t tracerParams = { + &hDevice, + &phVertex }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemGetIpcHandleWithPropertiesCb_t, Mem, pfnGetIpcHandleWithPropertiesCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetFabricVertexExpCb_t, Device, pfnGetFabricVertexExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.pptr, - *tracerParams.ppNext, - *tracerParams.ppIpcHandle); + *tracerParams.phDevice, + *tracerParams.pphVertex); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphCreateExt + /// @brief Intercept function for zeFabricEdgeGetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { - auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; + auto pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; - if( nullptr == pfnCreateExt) + if( nullptr == pfnGetExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnCreateExt, hContext, pNext, phGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetExp, hVertexA, hVertexB, pCount, phEdges); // capture parameters - ze_graph_create_ext_params_t tracerParams = { - &hContext, - &pNext, - &phGraph + ze_fabric_edge_get_exp_params_t tracerParams = { + &hVertexA, + &hVertexB, + &pCount, + &phEdges }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphCreateExtCb_t, Graph, pfnCreateExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetExpCb_t, FabricEdge, pfnGetExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnCreateExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.ppNext, - *tracerParams.pphGraph); + *tracerParams.phVertexA, + *tracerParams.phVertexB, + *tracerParams.ppCount, + *tracerParams.pphEdges); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginGraphCaptureExt + /// @brief Intercept function for zeFabricEdgeGetVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { - auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; + auto pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; - if( nullptr == pfnBeginGraphCaptureExt) + if( nullptr == pfnGetVerticesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, hCommandList, pNext); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp, hEdge, phVertexA, phVertexB); // capture parameters - ze_command_list_begin_graph_capture_ext_params_t tracerParams = { - &hCommandList, - &pNext + ze_fabric_edge_get_vertices_exp_params_t tracerParams = { + &hEdge, + &phVertexA, + &phVertexB }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginGraphCaptureExtCb_t, CommandList, pfnBeginGraphCaptureExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetVerticesExpCb_t, FabricEdge, pfnGetVerticesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.ppNext); + *tracerParams.phEdge, + *tracerParams.pphVertexA, + *tracerParams.pphVertexB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { - auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; + auto pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr == pfnBeginCaptureIntoGraphExt) + if( nullptr == pfnGetPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, hCommandList, hGraph, pNext); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp, hEdge, pEdgeProperties); // capture parameters - ze_command_list_begin_capture_into_graph_ext_params_t tracerParams = { - &hCommandList, - &hGraph, - &pNext + ze_fabric_edge_get_properties_exp_params_t tracerParams = { + &hEdge, + &pEdgeProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginCaptureIntoGraphExtCb_t, CommandList, pfnBeginCaptureIntoGraphExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetPropertiesExpCb_t, FabricEdge, pfnGetPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.phGraph, - *tracerParams.ppNext); + *tracerParams.phEdge, + *tracerParams.ppEdgeProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + /// @brief Intercept function for zeEventQueryKernelTimestampsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { - auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; + auto pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; - if( nullptr == pfnIsGraphCaptureEnabledExt) + if( nullptr == pfnQueryKernelTimestampsExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, hCommandList); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Event.pfnQueryKernelTimestampsExt, hEvent, hDevice, pCount, pResults); // capture parameters - ze_command_list_is_graph_capture_enabled_ext_params_t tracerParams = { - &hCommandList + ze_event_query_kernel_timestamps_ext_params_t tracerParams = { + &hEvent, + &hDevice, + &pCount, + &pResults }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsGraphCaptureEnabledExtCb_t, CommandList, pfnIsGraphCaptureEnabledExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnEventQueryKernelTimestampsExtCb_t, Event, pfnQueryKernelTimestampsExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Event.pfnQueryKernelTimestampsExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList); + *tracerParams.phEvent, + *tracerParams.phDevice, + *tracerParams.ppCount, + *tracerParams.ppResults); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListEndGraphCaptureExt + /// @brief Intercept function for zeRTASBuilderCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { - auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; + auto pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; - if( nullptr == pfnEndGraphCaptureExt) + if( nullptr == pfnCreateExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, hCommandList, pNext, phGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnCreateExp, hDriver, pDescriptor, phBuilder); // capture parameters - ze_command_list_end_graph_capture_ext_params_t tracerParams = { - &hCommandList, - &pNext, - &phGraph + ze_rtas_builder_create_exp_params_t tracerParams = { + &hDriver, + &pDescriptor, + &phBuilder }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListEndGraphCaptureExtCb_t, CommandList, pfnEndGraphCaptureExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExpCb_t, RTASBuilder, pfnCreateExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnCreateExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.ppNext, - *tracerParams.pphGraph); + *tracerParams.phDriver, + *tracerParams.ppDescriptor, + *tracerParams.pphBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetGraphExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { - auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; + auto pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr == pfnGetGraphExt) + if( nullptr == pfnGetBuildPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnGetGraphExt, hCommandList, phGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp, hBuilder, pBuildOpDescriptor, pProperties); // capture parameters - ze_command_list_get_graph_ext_params_t tracerParams = { - &hCommandList, - &phGraph + ze_rtas_builder_get_build_properties_exp_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetGraphExtCb_t, CommandList, pfnGetGraphExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExpCb_t, RTASBuilder, pfnGetBuildPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnGetGraphExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pphGraph); + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { - auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; + auto pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnGetPrimaryCommandListExt) + if( nullptr == pfnRTASFormatCompatibilityCheckExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, hGraph, phCommandList); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp, hDriver, rtasFormatA, rtasFormatB); // capture parameters - ze_graph_get_primary_command_list_ext_params_t tracerParams = { - &hGraph, - &phCommandList + ze_driver_rtas_format_compatibility_check_exp_params_t tracerParams = { + &hDriver, + &rtasFormatA, + &rtasFormatB }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphGetPrimaryCommandListExtCb_t, Graph, pfnGetPrimaryCommandListExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t, Driver, pfnRTASFormatCompatibilityCheckExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph, - *tracerParams.pphCommandList); + *tracerParams.phDriver, + *tracerParams.prtasFormatA, + *tracerParams.prtasFormatB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphSetDestructionCallbackExt + /// @brief Intercept function for zeRTASBuilderBuildExp __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ) - { - auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; - - if( nullptr == pfnSetDestructionCallbackExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, hGraph, pfnCallback, pUserData, pNext); + zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes + ) + { + auto pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; + + if( nullptr == pfnBuildExp) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnBuildExp, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); // capture parameters - ze_graph_set_destruction_callback_ext_params_t tracerParams = { - &hGraph, - &pfnCallback, - &pUserData, - &pNext + ze_rtas_builder_build_exp_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pScratchBuffer, + &scratchBufferSizeBytes, + &pRtasBuffer, + &rtasBufferSizeBytes, + &hParallelOperation, + &pBuildUserPtr, + &pBounds, + &pRtasBufferSizeBytes }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphSetDestructionCallbackExtCb_t, Graph, pfnSetDestructionCallbackExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExpCb_t, RTASBuilder, pfnBuildExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnBuildExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph, - *tracerParams.ppfnCallback, - *tracerParams.ppUserData, - *tracerParams.ppNext); + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppScratchBuffer, + *tracerParams.pscratchBufferSizeBytes, + *tracerParams.ppRtasBuffer, + *tracerParams.prtasBufferSizeBytes, + *tracerParams.phParallelOperation, + *tracerParams.ppBuildUserPtr, + *tracerParams.ppBounds, + *tracerParams.ppRtasBufferSizeBytes); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphInstantiateExt + /// @brief Intercept function for zeRTASBuilderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; + auto pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; - if( nullptr == pfnInstantiateExt) + if( nullptr == pfnDestroyExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnInstantiateExt, hGraph, pNext, phExecutableGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnDestroyExp, hBuilder); // capture parameters - ze_graph_instantiate_ext_params_t tracerParams = { - &hGraph, - &pNext, - &phExecutableGraph + ze_rtas_builder_destroy_exp_params_t tracerParams = { + &hBuilder }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphInstantiateExtCb_t, Graph, pfnInstantiateExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExpCb_t, RTASBuilder, pfnDestroyExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnInstantiateExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnDestroyExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph, - *tracerParams.ppNext, - *tracerParams.pphExecutableGraph); + *tracerParams.phBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendGraphExt + /// @brief Intercept function for zeRTASParallelOperationCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; + auto pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; - if( nullptr == pfnAppendGraphExt) + if( nullptr == pfnCreateExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendGraphExt, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp, hDriver, phParallelOperation); // capture parameters - ze_command_list_append_graph_ext_params_t tracerParams = { - &hCommandList, - &hGraph, - &pNext, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + ze_rtas_parallel_operation_create_exp_params_t tracerParams = { + &hDriver, + &phParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendGraphExtCb_t, CommandList, pfnAppendGraphExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationCreateExpCb_t, RTASParallelOperation, pfnCreateExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendGraphExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.phGraph, - *tracerParams.ppNext, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phDriver, + *tracerParams.pphParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; + auto pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr == pfnGetSourceGraphExt) + if( nullptr == pfnGetPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, hGraph, phSourceGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp, hParallelOperation, pProperties); // capture parameters - ze_executable_graph_get_source_graph_ext_params_t tracerParams = { - &hGraph, - &phSourceGraph + ze_rtas_parallel_operation_get_properties_exp_params_t tracerParams = { + &hParallelOperation, + &pProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphGetSourceGraphExtCb_t, ExecutableGraph, pfnGetSourceGraphExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExpCb_t, RTASParallelOperation, pfnGetPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph, - *tracerParams.pphSourceGraph); + *tracerParams.phParallelOperation, + *tracerParams.ppProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphIsEmptyExt + /// @brief Intercept function for zeRTASParallelOperationJoinExp __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; + auto pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; - if( nullptr == pfnIsEmptyExt) + if( nullptr == pfnJoinExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnIsEmptyExt, hGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp, hParallelOperation); // capture parameters - ze_graph_is_empty_ext_params_t tracerParams = { - &hGraph + ze_rtas_parallel_operation_join_exp_params_t tracerParams = { + &hParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphIsEmptyExtCb_t, Graph, pfnIsEmptyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExpCb_t, RTASParallelOperation, pfnJoinExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnIsEmptyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph); + *tracerParams.phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDumpContentsExt + /// @brief Intercept function for zeRTASParallelOperationDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; + auto pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; - if( nullptr == pfnDumpContentsExt) + if( nullptr == pfnDestroyExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDumpContentsExt, hGraph, filePath, pNext); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp, hParallelOperation); // capture parameters - ze_graph_dump_contents_ext_params_t tracerParams = { - &hGraph, - &filePath, - &pNext + ze_rtas_parallel_operation_destroy_exp_params_t tracerParams = { + &hParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDumpContentsExtCb_t, Graph, pfnDumpContentsExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExpCb_t, RTASParallelOperation, pfnDestroyExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDumpContentsExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph, - *tracerParams.pfilePath, - *tracerParams.ppNext); + *tracerParams.phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphDestroyExt + /// @brief Intercept function for zeMemGetPitchFor2dImage __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { - auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; + auto pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; - if( nullptr == pfnDestroyExt) + if( nullptr == pfnGetPitchFor2dImage) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, hGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnGetPitchFor2dImage, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); // capture parameters - ze_executable_graph_destroy_ext_params_t tracerParams = { - &hGraph + ze_mem_get_pitch_for2d_image_params_t tracerParams = { + &hContext, + &hDevice, + &imageWidth, + &imageHeight, + &elementSizeInBytes, + &rowPitch }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphDestroyExtCb_t, ExecutableGraph, pfnDestroyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemGetPitchFor2dImageCb_t, Mem, pfnGetPitchFor2dImageCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnGetPitchFor2dImage, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDestroyExt + *tracerParams.phContext, + *tracerParams.phDevice, + *tracerParams.pimageWidth, + *tracerParams.pimageHeight, + *tracerParams.pelementSizeInBytes, + *tracerParams.prowPitch); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetDeviceOffsetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { - auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; + auto pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; - if( nullptr == pfnDestroyExt) + if( nullptr == pfnGetDeviceOffsetExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDestroyExt, hGraph); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp, hImage, pDeviceOffset); // capture parameters - ze_graph_destroy_ext_params_t tracerParams = { - &hGraph + ze_image_get_device_offset_exp_params_t tracerParams = { + &hImage, + &pDeviceOffset }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDestroyExtCb_t, Graph, pfnDestroyExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetDeviceOffsetExpCb_t, Image, pfnGetDeviceOffsetExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDestroyExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phGraph); + *tracerParams.phImage, + *tracerParams.ppDeviceOffset); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendHostFunction + /// @brief Intercept function for zeCommandListCreateCloneExp __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { - auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; + auto pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; - if( nullptr == pfnAppendHostFunction) + if( nullptr == pfnCreateCloneExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendHostFunction, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnCreateCloneExp, hCommandList, phClonedCommandList); // capture parameters - ze_command_list_append_host_function_params_t tracerParams = { + ze_command_list_create_clone_exp_params_t tracerParams = { &hCommandList, - &pfnHostFunction, - &pUserData, - &pNext, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + &phClonedCommandList }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendHostFunctionCb_t, CommandList, pfnAppendHostFunctionCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListCreateCloneExpCb_t, CommandList, pfnCreateCloneExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendHostFunction, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnCreateCloneExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phCommandList, - *tracerParams.ppfnHostFunction, - *tracerParams.ppUserData, - *tracerParams.ppNext, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.pphClonedCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + auto pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr == pfnReserveCacheExt) + if( nullptr == pfnImmediateAppendCommandListsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReserveCacheExt, hDevice, cacheLevel, cacheReservationSize); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_device_reserve_cache_ext_params_t tracerParams = { - &hDevice, - &cacheLevel, - &cacheReservationSize + ze_command_list_immediate_append_command_lists_exp_params_t tracerParams = { + &hCommandListImmediate, + &numCommandLists, + &phCommandLists, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReserveCacheExtCb_t, Device, pfnReserveCacheExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateAppendCommandListsExpCb_t, CommandList, pfnImmediateAppendCommandListsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReserveCacheExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.pcacheLevel, - *tracerParams.pcacheReservationSize); + *tracerParams.phCommandListImmediate, + *tracerParams.pnumCommandLists, + *tracerParams.pphCommandLists, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + auto pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnSetCacheAdviceExt) + if( nullptr == pfnImmediateAppendCommandListsWithParameters) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnSetCacheAdviceExt, hDevice, ptr, regionSize, cacheRegion); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_device_set_cache_advice_ext_params_t tracerParams = { - &hDevice, - &ptr, - ®ionSize, - &cacheRegion + ze_command_list_immediate_append_command_lists_with_parameters_params_t tracerParams = { + &hCommandListImmediate, + &numCommandLists, + &phCommandLists, + &pNext, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceSetCacheAdviceExtCb_t, Device, pfnSetCacheAdviceExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t, CommandList, pfnImmediateAppendCommandListsWithParametersCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnSetCacheAdviceExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.pptr, - *tracerParams.pregionSize, - *tracerParams.pcacheRegion); + *tracerParams.phCommandListImmediate, + *tracerParams.pnumCommandLists, + *tracerParams.pphCommandLists, + *tracerParams.ppNext, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListGetNextCommandIdExp __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - auto pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; + auto pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; - if( nullptr == pfnQueryTimestampsExp) + if( nullptr == pfnGetNextCommandIdExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.EventExp.pfnQueryTimestampsExp, hEvent, hDevice, pCount, pTimestamps); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp, hCommandList, desc, pCommandId); // capture parameters - ze_event_query_timestamps_exp_params_t tracerParams = { - &hEvent, - &hDevice, - &pCount, - &pTimestamps + ze_command_list_get_next_command_id_exp_params_t tracerParams = { + &hCommandList, + &desc, + &pCommandId }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnEventQueryTimestampsExpCb_t, Event, pfnQueryTimestampsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetNextCommandIdExpCb_t, CommandList, pfnGetNextCommandIdExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.EventExp.pfnQueryTimestampsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phEvent, - *tracerParams.phDevice, - *tracerParams.ppCount, - *tracerParams.ppTimestamps); + *tracerParams.phCommandList, + *tracerParams.pdesc, + *tracerParams.ppCommandId); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - auto pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; + auto pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetMemoryPropertiesExp) + if( nullptr == pfnGetNextCommandIdWithKernelsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp, hImage, pMemoryProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp, hCommandList, desc, numKernels, phKernels, pCommandId); // capture parameters - ze_image_get_memory_properties_exp_params_t tracerParams = { - &hImage, - &pMemoryProperties + ze_command_list_get_next_command_id_with_kernels_exp_params_t tracerParams = { + &hCommandList, + &desc, + &numKernels, + &phKernels, + &pCommandId }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetMemoryPropertiesExpCb_t, Image, pfnGetMemoryPropertiesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t, CommandList, pfnGetNextCommandIdWithKernelsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phImage, - *tracerParams.ppMemoryProperties); + *tracerParams.phCommandList, + *tracerParams.pdesc, + *tracerParams.pnumKernels, + *tracerParams.pphKernels, + *tracerParams.ppCommandId); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { - auto pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; + auto pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr == pfnViewCreateExt) + if( nullptr == pfnUpdateMutableCommandsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Image.pfnViewCreateExt, hContext, hDevice, desc, hImage, phImageView); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp, hCommandList, desc); // capture parameters - ze_image_view_create_ext_params_t tracerParams = { - &hContext, - &hDevice, - &desc, - &hImage, - &phImageView + ze_command_list_update_mutable_commands_exp_params_t tracerParams = { + &hCommandList, + &desc }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageViewCreateExtCb_t, Image, pfnViewCreateExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandsExpCb_t, CommandList, pfnUpdateMutableCommandsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Image.pfnViewCreateExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.phDevice, - *tracerParams.pdesc, - *tracerParams.phImage, - *tracerParams.pphImageView); + *tracerParams.phCommandList, + *tracerParams.pdesc); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListIsMutableExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { - auto pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; + auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; - if( nullptr == pfnViewCreateExp) + if( nullptr == pfnIsMutableExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnViewCreateExp, hContext, hDevice, desc, hImage, phImageView); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnIsMutableExp, hCommandList, pIsMutable); // capture parameters - ze_image_view_create_exp_params_t tracerParams = { - &hContext, - &hDevice, - &desc, - &hImage, - &phImageView + ze_command_list_is_mutable_exp_params_t tracerParams = { + &hCommandList, + &pIsMutable }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageViewCreateExpCb_t, Image, pfnViewCreateExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsMutableExpCb_t, CommandList, pfnIsMutableExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnViewCreateExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnIsMutableExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.phDevice, - *tracerParams.pdesc, - *tracerParams.phImage, - *tracerParams.pphImageView); + *tracerParams.phCommandList, + *tracerParams.ppIsMutable); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { - auto pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; + auto pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnSchedulingHintExp) + if( nullptr == pfnUpdateMutableCommandSignalEventExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnSchedulingHintExp, hKernel, pHint); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp, hCommandList, commandId, hSignalEvent); // capture parameters - ze_kernel_scheduling_hint_exp_params_t tracerParams = { - &hKernel, - &pHint + ze_command_list_update_mutable_command_signal_event_exp_params_t tracerParams = { + &hCommandList, + &commandId, + &hSignalEvent }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelSchedulingHintExpCb_t, Kernel, pfnSchedulingHintExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t, CommandList, pfnUpdateMutableCommandSignalEventExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnSchedulingHintExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phKernel, - *tracerParams.ppHint); + *tracerParams.phCommandList, + *tracerParams.pcommandId, + *tracerParams.phSignalEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDevicePciGetPropertiesExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; + auto pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnPciGetPropertiesExt) + if( nullptr == pfnUpdateMutableCommandWaitEventsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnPciGetPropertiesExt, hDevice, pPciProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp, hCommandList, commandId, numWaitEvents, phWaitEvents); // capture parameters - ze_device_pci_get_properties_ext_params_t tracerParams = { - &hDevice, - &pPciProperties + ze_command_list_update_mutable_command_wait_events_exp_params_t tracerParams = { + &hCommandList, + &commandId, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDevicePciGetPropertiesExtCb_t, Device, pfnPciGetPropertiesExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t, CommandList, pfnUpdateMutableCommandWaitEventsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnPciGetPropertiesExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.ppPciProperties); + *tracerParams.phCommandList, + *tracerParams.pcommandId, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { - auto pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; + auto pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnAppendImageCopyToMemoryExt) + if( nullptr == pfnUpdateMutableCommandKernelsExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp, hCommandList, numKernels, pCommandId, phKernels); // capture parameters - ze_command_list_append_image_copy_to_memory_ext_params_t tracerParams = { + ze_command_list_update_mutable_command_kernels_exp_params_t tracerParams = { &hCommandList, - &dstptr, - &hSrcImage, - &pSrcRegion, - &destRowPitch, - &destSlicePitch, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + &numKernels, + &pCommandId, + &phKernels }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendImageCopyToMemoryExtCb_t, CommandList, pfnAppendImageCopyToMemoryExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t, CommandList, pfnUpdateMutableCommandKernelsExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phCommandList, - *tracerParams.pdstptr, - *tracerParams.phSrcImage, - *tracerParams.ppSrcRegion, - *tracerParams.pdestRowPitch, - *tracerParams.pdestSlicePitch, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.pnumKernels, + *tracerParams.ppCommandId, + *tracerParams.pphKernels); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { - auto pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; + auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; - if( nullptr == pfnAppendImageCopyFromMemoryExt) + if( nullptr == pfnGetBinaryExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnGetBinaryExp, hKernel, pSize, pKernelBinary); // capture parameters - ze_command_list_append_image_copy_from_memory_ext_params_t tracerParams = { - &hCommandList, - &hDstImage, - &srcptr, - &pDstRegion, - &srcRowPitch, - &srcSlicePitch, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + ze_kernel_get_binary_exp_params_t tracerParams = { + &hKernel, + &pSize, + &pKernelBinary }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t, CommandList, pfnAppendImageCopyFromMemoryExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelGetBinaryExpCb_t, Kernel, pfnGetBinaryExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnGetBinaryExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.phDstImage, - *tracerParams.psrcptr, - *tracerParams.ppDstRegion, - *tracerParams.psrcRowPitch, - *tracerParams.psrcSlicePitch, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phKernel, + *tracerParams.ppSize, + *tracerParams.ppKernelBinary); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetAllocPropertiesExt + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { - auto pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; + auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnGetAllocPropertiesExt) + if( nullptr == pfnImportExternalSemaphoreExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Image.pfnGetAllocPropertiesExt, hContext, hImage, pImageAllocProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnImportExternalSemaphoreExt, hDevice, desc, phSemaphore); // capture parameters - ze_image_get_alloc_properties_ext_params_t tracerParams = { - &hContext, - &hImage, - &pImageAllocProperties + ze_device_import_external_semaphore_ext_params_t tracerParams = { + &hDevice, + &desc, + &phSemaphore }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetAllocPropertiesExtCb_t, Image, pfnGetAllocPropertiesExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceImportExternalSemaphoreExtCb_t, Device, pfnImportExternalSemaphoreExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Image.pfnGetAllocPropertiesExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnImportExternalSemaphoreExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.phImage, - *tracerParams.ppImageAllocProperties); + *tracerParams.phDevice, + *tracerParams.pdesc, + *tracerParams.pphSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleInspectLinkageExt + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { - auto pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; + auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnInspectLinkageExt) + if( nullptr == pfnReleaseExternalSemaphoreExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Module.pfnInspectLinkageExt, pInspectDesc, numModules, phModules, phLog); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt, hSemaphore); // capture parameters - ze_module_inspect_linkage_ext_params_t tracerParams = { - &pInspectDesc, - &numModules, - &phModules, - &phLog + ze_device_release_external_semaphore_ext_params_t tracerParams = { + &hSemaphore }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnModuleInspectLinkageExtCb_t, Module, pfnInspectLinkageExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceReleaseExternalSemaphoreExtCb_t, Device, pfnReleaseExternalSemaphoreExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Module.pfnInspectLinkageExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.ppInspectDesc, - *tracerParams.pnumModules, - *tracerParams.pphModules, - *tracerParams.pphLog); + *tracerParams.phSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFreeExt + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; + auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnFreeExt) + if( nullptr == pfnAppendSignalExternalSemaphoreExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnFreeExt, hContext, pMemFreeDesc, ptr); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_mem_free_ext_params_t tracerParams = { - &hContext, - &pMemFreeDesc, - &ptr + ze_command_list_append_signal_external_semaphore_ext_params_t tracerParams = { + &hCommandList, + &numSemaphores, + &phSemaphores, + &signalParams, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemFreeExtCb_t, Mem, pfnFreeExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t, CommandList, pfnAppendSignalExternalSemaphoreExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnFreeExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.ppMemFreeDesc, - *tracerParams.pptr); + *tracerParams.phCommandList, + *tracerParams.pnumSemaphores, + *tracerParams.pphSemaphores, + *tracerParams.psignalParams, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetExp + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; + auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnGetExp) + if( nullptr == pfnAppendWaitExternalSemaphoreExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetExp, hDriver, pCount, phVertices); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_fabric_vertex_get_exp_params_t tracerParams = { - &hDriver, - &pCount, - &phVertices + ze_command_list_append_wait_external_semaphore_ext_params_t tracerParams = { + &hCommandList, + &numSemaphores, + &phSemaphores, + &waitParams, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetExpCb_t, FabricVertex, pfnGetExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t, CommandList, pfnAppendWaitExternalSemaphoreExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.ppCount, - *tracerParams.pphVertices); + *tracerParams.phCommandList, + *tracerParams.pnumSemaphores, + *tracerParams.pphSemaphores, + *tracerParams.pwaitParams, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { - auto pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - if( nullptr == pfnGetSubVerticesExp) + if( nullptr == pfnCreateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp, hVertex, pCount, phSubvertices); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCreateExt, hDriver, pDescriptor, phBuilder); // capture parameters - ze_fabric_vertex_get_sub_vertices_exp_params_t tracerParams = { - &hVertex, - &pCount, - &phSubvertices + ze_rtas_builder_create_ext_params_t tracerParams = { + &hDriver, + &pDescriptor, + &phBuilder }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetSubVerticesExpCb_t, FabricVertex, pfnGetSubVerticesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExtCb_t, RTASBuilder, pfnCreateExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCreateExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phVertex, - *tracerParams.ppCount, - *tracerParams.pphSubvertices); - } - + *tracerParams.phDriver, + *tracerParams.ppDescriptor, + *tracerParams.pphBuilder); + } + /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetPropertiesExp + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { - auto pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetPropertiesExp) + if( nullptr == pfnGetBuildPropertiesExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp, hVertex, pVertexProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, hBuilder, pBuildOpDescriptor, pProperties); // capture parameters - ze_fabric_vertex_get_properties_exp_params_t tracerParams = { - &hVertex, - &pVertexProperties + ze_rtas_builder_get_build_properties_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetPropertiesExpCb_t, FabricVertex, pfnGetPropertiesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExtCb_t, RTASBuilder, pfnGetBuildPropertiesExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phVertex, - *tracerParams.ppVertexProperties); + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetDeviceExp + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { - auto pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnGetDeviceExp) + if( nullptr == pfnRTASFormatCompatibilityCheckExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp, hVertex, phDevice); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, hDriver, rtasFormatA, rtasFormatB); // capture parameters - ze_fabric_vertex_get_device_exp_params_t tracerParams = { - &hVertex, - &phDevice + ze_driver_rtas_format_compatibility_check_ext_params_t tracerParams = { + &hDriver, + &rtasFormatA, + &rtasFormatB }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricVertexGetDeviceExpCb_t, FabricVertex, pfnGetDeviceExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t, Driver, pfnRTASFormatCompatibilityCheckExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phVertex, - *tracerParams.pphDevice); + *tracerParams.phDriver, + *tracerParams.prtasFormatA, + *tracerParams.prtasFormatB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetFabricVertexExp + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - auto pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - if( nullptr == pfnGetFabricVertexExp) + if( nullptr == pfnBuildExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp, hDevice, phVertex); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnBuildExt, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); // capture parameters - ze_device_get_fabric_vertex_exp_params_t tracerParams = { - &hDevice, - &phVertex + ze_rtas_builder_build_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pScratchBuffer, + &scratchBufferSizeBytes, + &pRtasBuffer, + &rtasBufferSizeBytes, + &hParallelOperation, + &pBuildUserPtr, + &pBounds, + &pRtasBufferSizeBytes }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetFabricVertexExpCb_t, Device, pfnGetFabricVertexExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExtCb_t, RTASBuilder, pfnBuildExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnBuildExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.pphVertex); + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppScratchBuffer, + *tracerParams.pscratchBufferSizeBytes, + *tracerParams.ppRtasBuffer, + *tracerParams.prtasBufferSizeBytes, + *tracerParams.phParallelOperation, + *tracerParams.ppBuildUserPtr, + *tracerParams.ppBounds, + *tracerParams.ppRtasBufferSizeBytes); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetExp + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnGetExp) + if( nullptr == pfnCommandListAppendCopyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetExp, hVertexA, hVertexB, pCount, phEdges); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_fabric_edge_get_exp_params_t tracerParams = { - &hVertexA, - &hVertexB, - &pCount, - &phEdges + ze_rtas_builder_command_list_append_copy_ext_params_t tracerParams = { + &hCommandList, + &dstptr, + &srcptr, + &size, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetExpCb_t, FabricEdge, pfnGetExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCommandListAppendCopyExtCb_t, RTASBuilder, pfnCommandListAppendCopyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phVertexA, - *tracerParams.phVertexB, - *tracerParams.ppCount, - *tracerParams.pphEdges); + *tracerParams.phCommandList, + *tracerParams.pdstptr, + *tracerParams.psrcptr, + *tracerParams.psize, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetVerticesExp + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - auto pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - if( nullptr == pfnGetVerticesExp) + if( nullptr == pfnDestroyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp, hEdge, phVertexA, phVertexB); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnDestroyExt, hBuilder); // capture parameters - ze_fabric_edge_get_vertices_exp_params_t tracerParams = { - &hEdge, - &phVertexA, - &phVertexB + ze_rtas_builder_destroy_ext_params_t tracerParams = { + &hBuilder }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetVerticesExpCb_t, FabricEdge, pfnGetVerticesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExtCb_t, RTASBuilder, pfnDestroyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnDestroyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phEdge, - *tracerParams.pphVertexA, - *tracerParams.pphVertexB); + *tracerParams.phBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - auto pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnGetPropertiesExp) + if( nullptr == pfnCreateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp, hEdge, pEdgeProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, hDriver, phParallelOperation); // capture parameters - ze_fabric_edge_get_properties_exp_params_t tracerParams = { - &hEdge, - &pEdgeProperties + ze_rtas_parallel_operation_create_ext_params_t tracerParams = { + &hDriver, + &phParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnFabricEdgeGetPropertiesExpCb_t, FabricEdge, pfnGetPropertiesExpCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phEdge, - *tracerParams.ppEdgeProperties); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestampsExt - __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationCreateExtCb_t, RTASParallelOperation, pfnCreateExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDriver, + *tracerParams.pphParallelOperation); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - auto pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnQueryKernelTimestampsExt) + if( nullptr == pfnGetPropertiesExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Event.pfnQueryKernelTimestampsExt, hEvent, hDevice, pCount, pResults); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, hParallelOperation, pProperties); // capture parameters - ze_event_query_kernel_timestamps_ext_params_t tracerParams = { - &hEvent, - &hDevice, - &pCount, - &pResults + ze_rtas_parallel_operation_get_properties_ext_params_t tracerParams = { + &hParallelOperation, + &pProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnEventQueryKernelTimestampsExtCb_t, Event, pfnQueryKernelTimestampsExtCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExtCb_t, RTASParallelOperation, pfnGetPropertiesExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Event.pfnQueryKernelTimestampsExt, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phEvent, - *tracerParams.phDevice, - *tracerParams.ppCount, - *tracerParams.ppResults); + *tracerParams.phParallelOperation, + *tracerParams.ppProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExp + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - auto pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnCreateExp) + if( nullptr == pfnJoinExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnCreateExp, hDriver, pDescriptor, phBuilder); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, hParallelOperation); // capture parameters - ze_rtas_builder_create_exp_params_t tracerParams = { - &hDriver, - &pDescriptor, - &phBuilder + ze_rtas_parallel_operation_join_ext_params_t tracerParams = { + &hParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExpCb_t, RTASBuilder, pfnCreateExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExtCb_t, RTASParallelOperation, pfnJoinExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnCreateExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.ppDescriptor, - *tracerParams.pphBuilder); + *tracerParams.phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - auto pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnGetBuildPropertiesExp) + if( nullptr == pfnDestroyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp, hBuilder, pBuildOpDescriptor, pProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, hParallelOperation); // capture parameters - ze_rtas_builder_get_build_properties_exp_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pProperties + ze_rtas_parallel_operation_destroy_ext_params_t tracerParams = { + &hParallelOperation }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExpCb_t, RTASBuilder, pfnGetBuildPropertiesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExtCb_t, RTASParallelOperation, pfnDestroyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder, - *tracerParams.ppBuildOpDescriptor, - *tracerParams.ppProperties); + *tracerParams.phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { - auto pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExp) + if( nullptr == pfnGetVectorWidthPropertiesExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp, hDriver, rtasFormatA, rtasFormatB); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, hDevice, pCount, pVectorWidthProperties); // capture parameters - ze_driver_rtas_format_compatibility_check_exp_params_t tracerParams = { - &hDriver, - &rtasFormatA, - &rtasFormatB + ze_device_get_vector_width_properties_ext_params_t tracerParams = { + &hDevice, + &pCount, + &pVectorWidthProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t, Driver, pfnRTASFormatCompatibilityCheckExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetVectorWidthPropertiesExtCb_t, Device, pfnGetVectorWidthPropertiesExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.prtasFormatA, - *tracerParams.prtasFormatB); + *tracerParams.phDevice, + *tracerParams.ppCount, + *tracerParams.ppVectorWidthProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { - auto pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; + auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnBuildExp) + if( nullptr == pfnGetAllocationPropertiesExp) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnBuildExp, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp, hKernel, pCount, pAllocationProperties); // capture parameters - ze_rtas_builder_build_exp_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pScratchBuffer, - &scratchBufferSizeBytes, - &pRtasBuffer, - &rtasBufferSizeBytes, - &hParallelOperation, - &pBuildUserPtr, - &pBounds, - &pRtasBufferSizeBytes + ze_kernel_get_allocation_properties_exp_params_t tracerParams = { + &hKernel, + &pCount, + &pAllocationProperties }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExpCb_t, RTASBuilder, pfnBuildExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelGetAllocationPropertiesExpCb_t, Kernel, pfnGetAllocationPropertiesExpCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnBuildExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder, - *tracerParams.ppBuildOpDescriptor, - *tracerParams.ppScratchBuffer, - *tracerParams.pscratchBufferSizeBytes, - *tracerParams.ppRtasBuffer, - *tracerParams.prtasBufferSizeBytes, - *tracerParams.phParallelOperation, - *tracerParams.ppBuildUserPtr, - *tracerParams.ppBounds, - *tracerParams.ppRtasBufferSizeBytes); + *tracerParams.phKernel, + *tracerParams.ppCount, + *tracerParams.ppAllocationProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExp + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - auto pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; + auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnDestroyExp) + if( nullptr == pfnGetIpcHandleWithProperties) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilderExp.pfnDestroyExp, hBuilder); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties, hContext, ptr, pNext, pIpcHandle); // capture parameters - ze_rtas_builder_destroy_exp_params_t tracerParams = { - &hBuilder + ze_mem_get_ipc_handle_with_properties_params_t tracerParams = { + &hContext, + &ptr, + &pNext, + &pIpcHandle }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExpCb_t, RTASBuilder, pfnDestroyExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemGetIpcHandleWithPropertiesCb_t, Mem, pfnGetIpcHandleWithPropertiesCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilderExp.pfnDestroyExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder); + *tracerParams.phContext, + *tracerParams.pptr, + *tracerParams.ppNext, + *tracerParams.ppIpcHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExp + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - auto pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; - if( nullptr == pfnCreateExp) + if( nullptr == pfnCreateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp, hDriver, phParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnCreateExt, hContext, pNext, phGraph); // capture parameters - ze_rtas_parallel_operation_create_exp_params_t tracerParams = { - &hDriver, - &phParallelOperation + ze_graph_create_ext_params_t tracerParams = { + &hContext, + &pNext, + &phGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationCreateExpCb_t, RTASParallelOperation, pfnCreateExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphCreateExtCb_t, Graph, pfnCreateExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnCreateExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.pphParallelOperation); + *tracerParams.phContext, + *tracerParams.ppNext, + *tracerParams.pphGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - auto pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnGetPropertiesExp) + if( nullptr == pfnBeginGraphCaptureExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp, hParallelOperation, pProperties); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, hCommandList, pNext); // capture parameters - ze_rtas_parallel_operation_get_properties_exp_params_t tracerParams = { - &hParallelOperation, - &pProperties + ze_command_list_begin_graph_capture_ext_params_t tracerParams = { + &hCommandList, + &pNext }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExpCb_t, RTASParallelOperation, pfnGetPropertiesExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginGraphCaptureExtCb_t, CommandList, pfnBeginGraphCaptureExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation, - *tracerParams.ppProperties); + *tracerParams.phCommandList, + *tracerParams.ppNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - auto pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnJoinExp) + if( nullptr == pfnBeginCaptureIntoGraphExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp, hParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, hCommandList, hGraph, pNext); // capture parameters - ze_rtas_parallel_operation_join_exp_params_t tracerParams = { - &hParallelOperation + ze_command_list_begin_capture_into_graph_ext_params_t tracerParams = { + &hCommandList, + &hGraph, + &pNext }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExpCb_t, RTASParallelOperation, pfnJoinExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListBeginCaptureIntoGraphExtCb_t, CommandList, pfnBeginCaptureIntoGraphExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); + *tracerParams.phCommandList, + *tracerParams.phGraph, + *tracerParams.ppNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - auto pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnDestroyExp) + if( nullptr == pfnIsGraphCaptureEnabledExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp, hParallelOperation); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, hCommandList); // capture parameters - ze_rtas_parallel_operation_destroy_exp_params_t tracerParams = { - &hParallelOperation + ze_command_list_is_graph_capture_enabled_ext_params_t tracerParams = { + &hCommandList }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExpCb_t, RTASParallelOperation, pfnDestroyExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsGraphCaptureEnabledExtCb_t, CommandList, pfnIsGraphCaptureEnabledExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); + *tracerParams.phCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetPitchFor2dImage + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { - auto pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnGetPitchFor2dImage) + if( nullptr == pfnEndGraphCaptureExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Mem.pfnGetPitchFor2dImage, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, hCommandList, pNext, phGraph); // capture parameters - ze_mem_get_pitch_for2d_image_params_t tracerParams = { - &hContext, - &hDevice, - &imageWidth, - &imageHeight, - &elementSizeInBytes, - &rowPitch + ze_command_list_end_graph_capture_ext_params_t tracerParams = { + &hCommandList, + &pNext, + &phGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnMemGetPitchFor2dImageCb_t, Mem, pfnGetPitchFor2dImageCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListEndGraphCaptureExtCb_t, CommandList, pfnEndGraphCaptureExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Mem.pfnGetPitchFor2dImage, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnEndGraphCaptureExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phContext, - *tracerParams.phDevice, - *tracerParams.pimageWidth, - *tracerParams.pimageHeight, - *tracerParams.pelementSizeInBytes, - *tracerParams.prowPitch); + *tracerParams.phCommandList, + *tracerParams.ppNext, + *tracerParams.pphGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetDeviceOffsetExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { - auto pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; - if( nullptr == pfnGetDeviceOffsetExp) + if( nullptr == pfnGetGraphExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp, hImage, pDeviceOffset); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnGetGraphExt, hCommandList, phGraph); // capture parameters - ze_image_get_device_offset_exp_params_t tracerParams = { - &hImage, - &pDeviceOffset + ze_command_list_get_graph_ext_params_t tracerParams = { + &hCommandList, + &phGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnImageGetDeviceOffsetExpCb_t, Image, pfnGetDeviceOffsetExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetGraphExtCb_t, CommandList, pfnGetGraphExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnGetGraphExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phImage, - *tracerParams.ppDeviceOffset); + *tracerParams.phCommandList, + *tracerParams.pphGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateCloneExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { - auto pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnCreateCloneExp) + if( nullptr == pfnGetPrimaryCommandListExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnCreateCloneExp, hCommandList, phClonedCommandList); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, hGraph, phCommandList); // capture parameters - ze_command_list_create_clone_exp_params_t tracerParams = { - &hCommandList, - &phClonedCommandList + ze_graph_get_primary_command_list_ext_params_t tracerParams = { + &hGraph, + &phCommandList }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListCreateCloneExpCb_t, CommandList, pfnCreateCloneExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphGetPrimaryCommandListExtCb_t, Graph, pfnGetPrimaryCommandListExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnCreateCloneExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pphClonedCommandList); + *tracerParams.phGraph, + *tracerParams.pphCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - auto pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; + auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnImmediateAppendCommandListsExp) + if( nullptr == pfnSetDestructionCallbackExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, hGraph, pfnCallback, pUserData, pNext); // capture parameters - ze_command_list_immediate_append_command_lists_exp_params_t tracerParams = { - &hCommandListImmediate, - &numCommandLists, - &phCommandLists, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + ze_graph_set_destruction_callback_ext_params_t tracerParams = { + &hGraph, + &pfnCallback, + &pUserData, + &pNext }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateAppendCommandListsExpCb_t, CommandList, pfnImmediateAppendCommandListsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphSetDestructionCallbackExtCb_t, Graph, pfnSetDestructionCallbackExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnSetDestructionCallbackExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandListImmediate, - *tracerParams.pnumCommandLists, - *tracerParams.pphCommandLists, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phGraph, + *tracerParams.ppfnCallback, + *tracerParams.ppUserData, + *tracerParams.ppNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { - auto pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; + auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; - if( nullptr == pfnImmediateAppendCommandListsWithParameters) + if( nullptr == pfnInstantiateExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnInstantiateExt, hGraph, pNext, phExecutableGraph); // capture parameters - ze_command_list_immediate_append_command_lists_with_parameters_params_t tracerParams = { - &hCommandListImmediate, - &numCommandLists, - &phCommandLists, + ze_graph_instantiate_ext_params_t tracerParams = { + &hGraph, &pNext, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents + &phExecutableGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t, CommandList, pfnImmediateAppendCommandListsWithParametersCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphInstantiateExtCb_t, Graph, pfnInstantiateExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnInstantiateExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandListImmediate, - *tracerParams.pnumCommandLists, - *tracerParams.pphCommandLists, + *tracerParams.phGraph, *tracerParams.ppNext, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.pphExecutableGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdExp + /// @brief Intercept function for zeCommandListAppendGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; + auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; - if( nullptr == pfnGetNextCommandIdExp) + if( nullptr == pfnAppendGraphExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp, hCommandList, desc, pCommandId); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendGraphExt, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_command_list_get_next_command_id_exp_params_t tracerParams = { + ze_command_list_append_graph_ext_params_t tracerParams = { &hCommandList, - &desc, - &pCommandId + &hGraph, + &pNext, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetNextCommandIdExpCb_t, CommandList, pfnGetNextCommandIdExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendGraphExtCb_t, CommandList, pfnAppendGraphExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendGraphExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phCommandList, - *tracerParams.pdesc, - *tracerParams.ppCommandId); + *tracerParams.phGraph, + *tracerParams.ppNext, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { - auto pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; + auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetNextCommandIdWithKernelsExp) + if( nullptr == pfnGetSourceGraphExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp, hCommandList, desc, numKernels, phKernels, pCommandId); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, hGraph, phSourceGraph); // capture parameters - ze_command_list_get_next_command_id_with_kernels_exp_params_t tracerParams = { - &hCommandList, - &desc, - &numKernels, - &phKernels, - &pCommandId + ze_executable_graph_get_source_graph_ext_params_t tracerParams = { + &hGraph, + &phSourceGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t, CommandList, pfnGetNextCommandIdWithKernelsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphGetSourceGraphExtCb_t, ExecutableGraph, pfnGetSourceGraphExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pdesc, - *tracerParams.pnumKernels, - *tracerParams.pphKernels, - *tracerParams.ppCommandId); + *tracerParams.phGraph, + *tracerParams.pphSourceGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { - auto pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; + auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; - if( nullptr == pfnUpdateMutableCommandsExp) + if( nullptr == pfnIsEmptyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp, hCommandList, desc); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnIsEmptyExt, hGraph); // capture parameters - ze_command_list_update_mutable_commands_exp_params_t tracerParams = { - &hCommandList, - &desc + ze_graph_is_empty_ext_params_t tracerParams = { + &hGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandsExpCb_t, CommandList, pfnUpdateMutableCommandsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphIsEmptyExtCb_t, Graph, pfnIsEmptyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnIsEmptyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pdesc); + *tracerParams.phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsMutableExp + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; - if( nullptr == pfnIsMutableExp) + if( nullptr == pfnDumpContentsExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnIsMutableExp, hCommandList, pIsMutable); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDumpContentsExt, hGraph, filePath, pNext); // capture parameters - ze_command_list_is_mutable_exp_params_t tracerParams = { - &hCommandList, - &pIsMutable + ze_graph_dump_contents_ext_params_t tracerParams = { + &hGraph, + &filePath, + &pNext }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListIsMutableExpCb_t, CommandList, pfnIsMutableExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDumpContentsExtCb_t, Graph, pfnDumpContentsExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnIsMutableExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDumpContentsExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.ppIsMutable); + *tracerParams.phGraph, + *tracerParams.pfilePath, + *tracerParams.ppNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { - auto pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; + auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnUpdateMutableCommandSignalEventExp) + if( nullptr == pfnDestroyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp, hCommandList, commandId, hSignalEvent); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, hGraph); // capture parameters - ze_command_list_update_mutable_command_signal_event_exp_params_t tracerParams = { - &hCommandList, - &commandId, - &hSignalEvent + ze_executable_graph_destroy_ext_params_t tracerParams = { + &hGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t, CommandList, pfnUpdateMutableCommandSignalEventExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnExecutableGraphDestroyExtCb_t, ExecutableGraph, pfnDestroyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.ExecutableGraph.pfnDestroyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pcommandId, - *tracerParams.phSignalEvent); + *tracerParams.phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { - auto pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp) + if( nullptr == pfnDestroyExt) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp, hCommandList, commandId, numWaitEvents, phWaitEvents); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnDestroyExt, hGraph); // capture parameters - ze_command_list_update_mutable_command_wait_events_exp_params_t tracerParams = { - &hCommandList, - &commandId, - &numWaitEvents, - &phWaitEvents + ze_graph_destroy_ext_params_t tracerParams = { + &hGraph }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t, CommandList, pfnUpdateMutableCommandWaitEventsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphDestroyExtCb_t, Graph, pfnDestroyExtCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnDestroyExt, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pcommandId, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); + *tracerParams.phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandKernelsExp( + zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - auto pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; + auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; - if( nullptr == pfnUpdateMutableCommandKernelsExp) + if( nullptr == pfnAppendHostFunction) return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp, hCommandList, numKernels, pCommandId, phKernels); + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendHostFunction, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); // capture parameters - ze_command_list_update_mutable_command_kernels_exp_params_t tracerParams = { + ze_command_list_append_host_function_params_t tracerParams = { &hCommandList, - &numKernels, - &pCommandId, - &phKernels + &pfnHostFunction, + &pUserData, + &pNext, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents }; - tracing_layer::APITracerCallbackDataImp apiCallbackData; + tracing_layer::APITracerCallbackDataImp apiCallbackData; - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t, CommandList, pfnUpdateMutableCommandKernelsExpCb); + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendHostFunctionCb_t, CommandList, pfnAppendHostFunctionCb); - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp, + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendHostFunction, &tracerParams, apiCallbackData.apiOrdinal, apiCallbackData.prologCallbacks, apiCallbackData.epilogCallbacks, *tracerParams.phCommandList, - *tracerParams.pnumKernels, - *tracerParams.ppCommandId, - *tracerParams.pphKernels); + *tracerParams.ppfnHostFunction, + *tracerParams.ppUserData, + *tracerParams.ppNext, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); } } // namespace tracing_layer @@ -9993,96 +9993,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = tracing_layer::context.zeDdiTable.ExecutableGraph; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (tracing_layer::context.version < version) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; - pDdiTable->pfnGetSourceGraphExt = tracing_layer::zeExecutableGraphGetSourceGraphExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = tracing_layer::zeExecutableGraphDestroyExt; - } - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = tracing_layer::context.zeDdiTable.Graph; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (tracing_layer::context.version < version) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = tracing_layer::zeGraphCreateExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; - pDdiTable->pfnGetPrimaryCommandListExt = tracing_layer::zeGraphGetPrimaryCommandListExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; - pDdiTable->pfnSetDestructionCallbackExt = tracing_layer::zeGraphSetDestructionCallbackExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; - pDdiTable->pfnInstantiateExt = tracing_layer::zeGraphInstantiateExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; - pDdiTable->pfnIsEmptyExt = tracing_layer::zeGraphIsEmptyExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; - pDdiTable->pfnDumpContentsExt = tracing_layer::zeGraphDumpContentsExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = tracing_layer::zeGraphDestroyExt; - } - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -11814,6 +11724,96 @@ zeGetFabricVertexExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.ExecutableGraph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (tracing_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; + pDdiTable->pfnGetSourceGraphExt = tracing_layer::zeExecutableGraphGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeExecutableGraphDestroyExt; + } + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.Graph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (tracing_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeGraphCreateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; + pDdiTable->pfnGetPrimaryCommandListExt = tracing_layer::zeGraphGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; + pDdiTable->pfnSetDestructionCallbackExt = tracing_layer::zeGraphSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; + pDdiTable->pfnInstantiateExt = tracing_layer::zeGraphInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; + pDdiTable->pfnIsEmptyExt = tracing_layer::zeGraphIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; + pDdiTable->pfnDumpContentsExt = tracing_layer::zeGraphDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeGraphDestroyExt; + } + return result; +} + #if defined(__cplusplus) }; #endif diff --git a/source/layers/validation/checkers/certification/generated/ze_certification.h b/source/layers/validation/checkers/certification/generated/ze_certification.h index dfb4e197..2d1f04b5 100644 --- a/source/layers/validation/checkers/certification/generated/ze_certification.h +++ b/source/layers/validation/checkers/certification/generated/ze_certification.h @@ -1041,464 +1041,464 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_11) { + virtual ze_result_t zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { + virtual ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { + virtual ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { + virtual ze_result_t zeImageGetMemoryPropertiesExpPrologue( ze_image_handle_t hImage, ze_image_memory_properties_exp_t* pMemoryProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { + virtual ze_result_t zeImageViewCreateExtPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_handle_t hImage, ze_image_handle_t* phImageView ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_5) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeImageViewCreateExpPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_handle_t hImage, ze_image_handle_t* phImageView ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeKernelSchedulingHintExpPrologue( ze_kernel_handle_t hKernel, ze_scheduling_hint_exp_desc_t* pHint ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeDevicePciGetPropertiesExtPrologue( ze_device_handle_t hDevice, ze_pci_ext_properties_t* pPciProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeCommandListAppendImageCopyToMemoryExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, ze_image_handle_t hSrcImage, const ze_image_region_t* pSrcRegion, uint32_t destRowPitch, uint32_t destSlicePitch, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeCommandListAppendImageCopyFromMemoryExtPrologue( ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, const void* srcptr, const ze_image_region_t* pDstRegion, uint32_t srcRowPitch, uint32_t srcSlicePitch, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeImageGetAllocPropertiesExtPrologue( ze_context_handle_t hContext, ze_image_handle_t hImage, ze_image_allocation_ext_properties_t* pImageAllocProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeModuleInspectLinkageExtPrologue( ze_linkage_inspection_ext_desc_t* pInspectDesc, uint32_t numModules, ze_module_handle_t* phModules, ze_module_build_log_handle_t* phLog ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeMemFreeExtPrologue( ze_context_handle_t hContext, const ze_memory_free_ext_desc_t* pMemFreeDesc, void* ptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeFabricVertexGetExpPrologue( ze_driver_handle_t hDriver, uint32_t* pCount, ze_fabric_vertex_handle_t* phVertices ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeFabricVertexGetSubVerticesExpPrologue( ze_fabric_vertex_handle_t hVertex, uint32_t* pCount, ze_fabric_vertex_handle_t* phSubvertices ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zeFabricVertexGetPropertiesExpPrologue( ze_fabric_vertex_handle_t hVertex, ze_fabric_vertex_exp_properties_t* pVertexProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_14) { + virtual ze_result_t zeFabricVertexGetDeviceExpPrologue( ze_fabric_vertex_handle_t hVertex, ze_device_handle_t* phDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_15) { + virtual ze_result_t zeDeviceGetFabricVertexExpPrologue( ze_device_handle_t hDevice, ze_fabric_vertex_handle_t* phVertex ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeFabricEdgeGetExpPrologue( ze_fabric_vertex_handle_t hVertexA, ze_fabric_vertex_handle_t hVertexB, uint32_t* pCount, ze_fabric_edge_handle_t* phEdges ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeFabricEdgeGetVerticesExpPrologue( ze_fabric_edge_handle_t hEdge, ze_fabric_vertex_handle_t* phVertexA, ze_fabric_vertex_handle_t* phVertexB ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeFabricEdgeGetPropertiesExpPrologue( ze_fabric_edge_handle_t hEdge, ze_fabric_edge_exp_properties_t* pEdgeProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeEventQueryKernelTimestampsExtPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASBuilderCreateExpPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_exp_desc_t* pDescriptor, ze_rtas_builder_exp_handle_t* phBuilder ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASBuilderGetBuildPropertiesExpPrologue( ze_rtas_builder_exp_handle_t hBuilder, const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ze_rtas_builder_exp_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExpPrologue( ze_driver_handle_t hDriver, ze_rtas_format_exp_t rtasFormatA, ze_rtas_format_exp_t rtasFormatB ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASBuilderBuildExpPrologue( ze_rtas_builder_exp_handle_t hBuilder, const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_exp_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_exp_t* pBounds, size_t* pRtasBufferSizeBytes ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASBuilderDestroyExpPrologue( ze_rtas_builder_exp_handle_t hBuilder ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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) { + virtual ze_result_t zeRTASParallelOperationCreateExpPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASParallelOperationGetPropertiesExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ze_rtas_parallel_operation_exp_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASParallelOperationJoinExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeRTASParallelOperationDestroyExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeMemGetPitchFor2dImagePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, size_t imageWidth, size_t imageHeight, unsigned int elementSizeInBytes, size_t * rowPitch ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { + virtual ze_result_t zeImageGetDeviceOffsetExpPrologue( ze_image_handle_t hImage, uint64_t* pDeviceOffset ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { 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) { + virtual ze_result_t zeCommandListCreateCloneExpPrologue( ze_command_list_handle_t hCommandList, ze_command_list_handle_t* phClonedCommandList ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListImmediateAppendCommandListsExpPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t numCommandLists, ze_command_list_handle_t* phCommandLists, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListImmediateAppendCommandListsWithParametersPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t numCommandLists, ze_command_list_handle_t* phCommandLists, 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_16) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListGetNextCommandIdExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint64_t* pCommandId ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeImageGetMemoryPropertiesExpPrologue( ze_image_handle_t hImage, ze_image_memory_properties_exp_t* pMemoryProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListGetNextCommandIdWithKernelsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint32_t numKernels, ze_kernel_handle_t* phKernels, uint64_t* pCommandId ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeImageViewCreateExtPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_handle_t hImage, ze_image_handle_t* phImageView ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_5) { + virtual ze_result_t zeCommandListUpdateMutableCommandsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeImageViewCreateExpPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_handle_t hImage, ze_image_handle_t* phImageView ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) 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 zeKernelSchedulingHintExpPrologue( ze_kernel_handle_t hKernel, ze_scheduling_hint_exp_desc_t* pHint ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDevicePciGetPropertiesExtPrologue( ze_device_handle_t hDevice, ze_pci_ext_properties_t* pPciProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListAppendImageCopyToMemoryExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, ze_image_handle_t hSrcImage, const ze_image_region_t* pSrcRegion, uint32_t destRowPitch, uint32_t destSlicePitch, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeCommandListAppendImageCopyFromMemoryExtPrologue( ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, const void* srcptr, const ze_image_region_t* pDstRegion, uint32_t srcRowPitch, uint32_t srcSlicePitch, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_11) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeImageGetAllocPropertiesExtPrologue( ze_context_handle_t hContext, ze_image_handle_t hImage, ze_image_allocation_ext_properties_t* pImageAllocProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeModuleInspectLinkageExtPrologue( ze_linkage_inspection_ext_desc_t* pInspectDesc, uint32_t numModules, ze_module_handle_t* phModules, ze_module_build_log_handle_t* phLog ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeMemFreeExtPrologue( ze_context_handle_t hContext, const ze_memory_free_ext_desc_t* pMemFreeDesc, void* ptr ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_3) { + virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricVertexGetExpPrologue( ze_driver_handle_t hDriver, uint32_t* pCount, ze_fabric_vertex_handle_t* phVertices ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricVertexGetSubVerticesExpPrologue( ze_fabric_vertex_handle_t hVertex, uint32_t* pCount, ze_fabric_vertex_handle_t* phSubvertices ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricVertexGetPropertiesExpPrologue( ze_fabric_vertex_handle_t hVertex, ze_fabric_vertex_exp_properties_t* pVertexProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricVertexGetDeviceExpPrologue( ze_fabric_vertex_handle_t hVertex, ze_device_handle_t* phDevice ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDeviceGetFabricVertexExpPrologue( ze_device_handle_t hDevice, ze_fabric_vertex_handle_t* phVertex ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricEdgeGetExpPrologue( ze_fabric_vertex_handle_t hVertexA, ze_fabric_vertex_handle_t hVertexB, uint32_t* pCount, ze_fabric_edge_handle_t* phEdges ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricEdgeGetVerticesExpPrologue( ze_fabric_edge_handle_t hEdge, ze_fabric_vertex_handle_t* phVertexA, ze_fabric_vertex_handle_t* phVertexB ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeFabricEdgeGetPropertiesExpPrologue( ze_fabric_edge_handle_t hEdge, ze_fabric_edge_exp_properties_t* pEdgeProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_4) { + virtual ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeEventQueryKernelTimestampsExtPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { + virtual ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderCreateExpPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_exp_desc_t* pDescriptor, ze_rtas_builder_exp_handle_t* phBuilder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderGetBuildPropertiesExpPrologue( ze_rtas_builder_exp_handle_t hBuilder, const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ze_rtas_builder_exp_properties_t* pProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExpPrologue( ze_driver_handle_t hDriver, ze_rtas_format_exp_t rtasFormatA, ze_rtas_format_exp_t rtasFormatB ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderBuildExpPrologue( ze_rtas_builder_exp_handle_t hBuilder, const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_exp_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_exp_t* pBounds, size_t* pRtasBufferSizeBytes ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_14) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASBuilderDestroyExpPrologue( ze_rtas_builder_exp_handle_t hBuilder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_15) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zeRTASParallelOperationCreateExpPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) 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 zeRTASParallelOperationGetPropertiesExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ze_rtas_parallel_operation_exp_properties_t* pProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) 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 zeRTASParallelOperationJoinExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) 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 zeRTASParallelOperationDestroyExpPrologue( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_7) { + virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) 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 zeMemGetPitchFor2dImagePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, size_t imageWidth, size_t imageHeight, unsigned int elementSizeInBytes, size_t * rowPitch ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) 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 zeImageGetDeviceOffsetExpPrologue( ze_image_handle_t hImage, uint64_t* pDeviceOffset ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) 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 zeCommandListCreateCloneExpPrologue( ze_command_list_handle_t hCommandList, ze_command_list_handle_t* phClonedCommandList ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) 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 zeCommandListImmediateAppendCommandListsExpPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t numCommandLists, ze_command_list_handle_t* phCommandLists, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) 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 zeCommandListImmediateAppendCommandListsWithParametersPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t numCommandLists, ze_command_list_handle_t* phCommandLists, 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_16) { + virtual ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) 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 zeCommandListGetNextCommandIdExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint64_t* pCommandId ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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 zeCommandListGetNextCommandIdWithKernelsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_command_id_exp_desc_t* desc, uint32_t numKernels, ze_kernel_handle_t* phKernels, uint64_t* pCommandId ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) 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 zeCommandListUpdateMutableCommandsExpPrologue( ze_command_list_handle_t hCommandList, const ze_mutable_commands_exp_desc_t* desc ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) 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 zeCommandListIsMutableExpPrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsMutable ) override { + virtual ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) 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 zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) 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 zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) 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 zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + 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; diff --git a/source/layers/validation/checkers/certification/generated/zes_certification.h b/source/layers/validation/checkers/certification/generated/zes_certification.h index b74199b7..e5bc2130 100644 --- a/source/layers/validation/checkers/certification/generated/zes_certification.h +++ b/source/layers/validation/checkers/certification/generated/zes_certification.h @@ -795,12 +795,6 @@ class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_15) { - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - } - return ZE_RESULT_SUCCESS; - } virtual ze_result_t zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -957,5 +951,11 @@ class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_15) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } }; } // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/generated/zet_certification.h b/source/layers/validation/checkers/certification/generated/zet_certification.h index 80ed2f73..2c233670 100644 --- a/source/layers/validation/checkers/certification/generated/zet_certification.h +++ b/source/layers/validation/checkers/certification/generated/zet_certification.h @@ -249,182 +249,182 @@ class ZETcertificationCheckerGenerated : public ZETValidationEntryPoints { } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ze_bool_t synchronizedWithHost, uint64_t* globalTimestamp, uint64_t* metricTimestamp ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_5) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricGroupGetExportDataExpPrologue( zet_metric_group_handle_t hMetricGroup, const uint8_t* pRawData, size_t rawDataSize, size_t* pExportDataSize, uint8_t * pExportData ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricGroupCalculateMetricExportDataExpPrologue( ze_driver_handle_t hDriver, zet_metric_group_calculation_type_t type, size_t exportDataSize, const uint8_t* pExportData, zet_metric_calculate_exp_desc_t* pCalculateDescriptor, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricProgrammableGetExpPrologue( zet_device_handle_t hDevice, uint32_t* pCount, zet_metric_programmable_exp_handle_t* phMetricProgrammables ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricProgrammableGetPropertiesExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_exp_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricProgrammableGetParamInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t* pParameterCount, zet_metric_programmable_param_info_exp_t* pParameterInfo ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricProgrammableGetParamValueInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterOrdinal, uint32_t* pValueInfoCount, zet_metric_programmable_param_value_info_exp_t* pValueInfo ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricCreateFromProgrammableExp2Prologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterCount, zet_metric_programmable_param_value_exp_t* pParameterValues, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_11) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { + virtual ze_result_t zetMetricCreateFromProgrammableExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zetMetricGroupCreateExpPrologue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { + virtual ze_result_t zetMetricGroupAddMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric, size_t * pErrorStringSize, char* pErrorString ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_2) { + virtual ze_result_t zetMetricGroupRemoveMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ze_bool_t synchronizedWithHost, uint64_t* globalTimestamp, uint64_t* metricTimestamp ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_5) { + virtual ze_result_t zetMetricGroupCloseExpPrologue( zet_metric_group_handle_t hMetricGroup ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupGetExportDataExpPrologue( zet_metric_group_handle_t hMetricGroup, const uint8_t* pRawData, size_t rawDataSize, size_t* pExportDataSize, uint8_t * pExportData ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { + virtual ze_result_t zetMetricGroupDestroyExpPrologue( zet_metric_group_handle_t hMetricGroup ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupCalculateMetricExportDataExpPrologue( ze_driver_handle_t hDriver, zet_metric_group_calculation_type_t type, size_t exportDataSize, const uint8_t* pExportData, zet_metric_calculate_exp_desc_t* pCalculateDescriptor, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_6) { + virtual ze_result_t zetMetricDestroyExpPrologue( zet_metric_handle_t hMetric ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricProgrammableGetExpPrologue( zet_device_handle_t hDevice, uint32_t* pCount, zet_metric_programmable_exp_handle_t* phMetricProgrammables ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricProgrammableGetPropertiesExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_exp_properties_t* pProperties ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricProgrammableGetParamInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t* pParameterCount, zet_metric_programmable_param_info_exp_t* pParameterInfo ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricProgrammableGetParamValueInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterOrdinal, uint32_t* pValueInfoCount, zet_metric_programmable_param_value_info_exp_t* pValueInfo ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricCreateFromProgrammableExp2Prologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterCount, zet_metric_programmable_param_value_exp_t* pParameterValues, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_11) { + virtual ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricCreateFromProgrammableExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override { + virtual ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupCreateExpPrologue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupAddMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric, size_t * pErrorStringSize, char* pErrorString ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupRemoveMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupCloseExpPrologue( zet_metric_group_handle_t hMetricGroup ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricGroupDestroyExpPrologue( zet_metric_group_handle_t hMetricGroup ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetMetricDestroyExpPrologue( zet_metric_handle_t hMetric ) override { - if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_9) { + virtual ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; 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 0f03e9ec..9257d917 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -3548,261 +3548,199 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeKernelGetBinaryExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ZEParameterValidation::zeDeviceReserveCacheExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { - if( nullptr == hKernel ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pSize ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pKernelBinary ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeDeviceImportExternalSemaphoreExtPrologue( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + ZEParameterValidation::zeDeviceSetCacheAdviceExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phSemaphore ) + if( nullptr == ptr ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x1ff < desc->flags ) + if( ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ParameterValidation::validateExtensions(desc); - } - - - ze_result_t - ZEParameterValidation::zeDeviceReleaseExternalSemaphoreExtPrologue( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. - ) - { - if( nullptr == hSemaphore ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListAppendSignalExternalSemaphoreExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEParameterValidation::zeEventQueryTimestampsExpPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { - if( nullptr == hCommandList ) + if( nullptr == hEvent ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phSemaphores ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == signalParams ) + if( nullptr == pCount ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - - if( (nullptr == phSemaphores) && (0 < numSemaphores) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - - if( (nullptr == signalParams) && (0 < numSemaphores) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListAppendWaitExternalSemaphoreExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEParameterValidation::zeImageGetMemoryPropertiesExpPrologue( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { - if( nullptr == hCommandList ) + if( nullptr == hImage ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phSemaphores ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == waitParams ) + if( nullptr == pMemoryProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - - if( (nullptr == phSemaphores) && (0 < numSemaphores) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - - if( (nullptr == waitParams) && (0 < numSemaphores) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pMemoryProperties); } ze_result_t - ZEParameterValidation::zeRTASBuilderCreateExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ZEParameterValidation::zeImageViewCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - if( nullptr == hDriver ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pDescriptor ) + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hImage ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == phBuilder ) + if( nullptr == phImageView ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion ) + if( 0x3 < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ParameterValidation::validateExtensions(pDescriptor); + if( ZE_IMAGE_TYPE_BUFFER < desc->type ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZEParameterValidation::zeRTASBuilderGetBuildPropertiesExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ZEParameterValidation::zeImageViewCreateExpPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - if( nullptr == hBuilder ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pBuildOpDescriptor ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pProperties ) + if( nullptr == hImage ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; + if( nullptr == phImageView ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality ) + if( 0x3 < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( 0x3 < pBuildOpDescriptor->buildFlags ) + if( ZE_IMAGE_TYPE_BUFFER < desc->type ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - auto retVal = ZE_RESULT_SUCCESS; - retVal = ParameterValidation::validateExtensions(pBuildOpDescriptor); - if(retVal) - return retVal; - retVal = ParameterValidation::validateExtensions(pProperties); - return retVal; + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZEParameterValidation::zeDriverRTASFormatCompatibilityCheckExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ZEParameterValidation::zeKernelSchedulingHintExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { - if( nullptr == hDriver ) + if( nullptr == hKernel ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; + if( nullptr == pHint ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB ) + if( 0x7 < pHint->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pHint); } ze_result_t - ZEParameterValidation::zeRTASBuilderBuildExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ZEParameterValidation::zeDevicePciGetPropertiesExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { - if( nullptr == hBuilder ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pBuildOpDescriptor ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pScratchBuffer ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pRtasBuffer ) + if( nullptr == pPciProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - if( 0x3 < pBuildOpDescriptor->buildFlags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(pBuildOpDescriptor); + return ParameterValidation::validateExtensions(pPciProperties); } ze_result_t - ZEParameterValidation::zeRTASBuilderCommandListAppendCopyExtPrologue( + ZEParameterValidation::zeCommandListAppendImageCopyToMemoryExtPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -3813,10 +3751,10 @@ namespace validation_layer if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == dstptr ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == hSrcImage ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == srcptr ) + if( nullptr == dstptr ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) @@ -3827,88 +3765,122 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASBuilderDestroyExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ZEParameterValidation::zeCommandListAppendImageCopyFromMemoryExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if( nullptr == hBuilder ) + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hDstImage ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == srcptr ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeRTASParallelOperationCreateExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + ZEParameterValidation::zeImageGetAllocPropertiesExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { - if( nullptr == hDriver ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phParallelOperation ) + if( nullptr == hImage ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pImageAllocProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pImageAllocProperties); } ze_result_t - ZEParameterValidation::zeRTASParallelOperationGetPropertiesExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + ZEParameterValidation::zeModuleInspectLinkageExtPrologue( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { - if( nullptr == hParallelOperation ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pInspectDesc ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pProperties ) + if( nullptr == phModules ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ParameterValidation::validateExtensions(pProperties); + if( nullptr == phLog ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( 0x7 < pInspectDesc->flags ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(pInspectDesc); } ze_result_t - ZEParameterValidation::zeRTASParallelOperationJoinExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ZEParameterValidation::zeMemFreeExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { - if( nullptr == hParallelOperation ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ZE_RESULT_SUCCESS; - } + if( nullptr == pMemFreeDesc ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == ptr ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - ze_result_t - ZEParameterValidation::zeRTASParallelOperationDestroyExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy - ) - { - if( nullptr == hParallelOperation ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( 0x3 < pMemFreeDesc->freePolicy ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pMemFreeDesc); } ze_result_t - ZEParameterValidation::zeDeviceGetVectorWidthPropertiesExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ZEParameterValidation::zeFabricVertexGetExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { - if( nullptr == hDevice ) + if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; if( nullptr == pCount ) @@ -3919,63 +3891,55 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeKernelGetAllocationPropertiesExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ZEParameterValidation::zeFabricVertexGetSubVerticesExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { - if( nullptr == hKernel ) + if( nullptr == hVertex ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; if( nullptr == pCount ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ParameterValidation::validateExtensions(pAllocationProperties); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeMemGetIpcHandleWithPropertiesPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + ZEParameterValidation::zeFabricVertexGetPropertiesExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { - if( nullptr == hContext ) + if( nullptr == hVertex ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == ptr ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pIpcHandle ) + if( nullptr == pVertexProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pVertexProperties); } ze_result_t - ZEParameterValidation::zeGraphCreateExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ZEParameterValidation::zeFabricVertexGetDeviceExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { - if( nullptr == hContext ) + if( nullptr == hVertex ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phGraph ) + if( nullptr == phDevice ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -3983,61 +3947,63 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListBeginGraphCaptureExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEParameterValidation::zeDeviceGetFabricVertexExpPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { - if( nullptr == hCommandList ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == phVertex ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEParameterValidation::zeFabricEdgeGetExpPrologue( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { - if( nullptr == hCommandList ) + if( nullptr == hVertexA ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hGraph ) + if( nullptr == hVertexB ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZEParameterValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list - ) - { - if( nullptr == hCommandList ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListEndGraphCaptureExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ZEParameterValidation::zeFabricEdgeGetVerticesExpPrologue( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { - if( nullptr == hCommandList ) + if( nullptr == hEdge ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phGraph ) + if( nullptr == phVertexA ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phVertexB ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4045,201 +4011,180 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListGetGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ZEParameterValidation::zeFabricEdgeGetPropertiesExpPrologue( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { - if( nullptr == hCommandList ) + if( nullptr == hEdge ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phGraph ) + if( nullptr == pEdgeProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pEdgeProperties); } ze_result_t - ZEParameterValidation::zeGraphGetPrimaryCommandListExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph - ) - { - if( nullptr == hGraph ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == phCommandList ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZEParameterValidation::zeGraphSetDestructionCallbackExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEParameterValidation::zeEventQueryKernelTimestampsExtPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { - if( nullptr == hGraph ) + if( nullptr == hEvent ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZEParameterValidation::zeGraphInstantiateExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph - ) - { - if( nullptr == hGraph ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phExecutableGraph ) + if( nullptr == pCount ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pResults); } ze_result_t - ZEParameterValidation::zeCommandListAppendGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEParameterValidation::zeRTASBuilderCreateExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { - if( nullptr == hCommandList ) + if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hGraph ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + if( nullptr == phBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(pDescriptor); } ze_result_t - ZEParameterValidation::zeExecutableGraphGetSourceGraphExtPrologue( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ZEParameterValidation::zeRTASBuilderGetBuildPropertiesExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { - if( nullptr == hGraph ) + if( nullptr == hBuilder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phSourceGraph ) + if( nullptr == pBuildOpDescriptor ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; - } + if( nullptr == pProperties ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - ze_result_t - ZEParameterValidation::zeGraphIsEmptyExtPrologue( - ze_graph_handle_t hGraph ///< [in] handle of the graph - ) - { - if( nullptr == hGraph ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ZE_RESULT_SUCCESS; + if( 0x3 < pBuildOpDescriptor->buildFlags ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + auto retVal = ZE_RESULT_SUCCESS; + retVal = ParameterValidation::validateExtensions(pBuildOpDescriptor); + if(retVal) + return retVal; + retVal = ParameterValidation::validateExtensions(pProperties); + return retVal; } ze_result_t - ZEParameterValidation::zeGraphDumpContentsExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEParameterValidation::zeDriverRTASFormatCompatibilityCheckExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { - if( nullptr == hGraph ) + if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == filePath ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeExecutableGraphDestroyExtPrologue( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ZEParameterValidation::zeRTASBuilderBuildExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - if( nullptr == hGraph ) + if( nullptr == hBuilder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ZE_RESULT_SUCCESS; - } - + if( nullptr == pBuildOpDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - ze_result_t - ZEParameterValidation::zeGraphDestroyExtPrologue( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy - ) - { - if( nullptr == hGraph ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pScratchBuffer ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; - } + if( nullptr == pRtasBuffer ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - ze_result_t - ZEParameterValidation::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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ) - { - if( nullptr == hCommandList ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) - return ZE_RESULT_ERROR_INVALID_SIZE; + if( 0x3 < pBuildOpDescriptor->buildFlags ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pBuildOpDescriptor); } ze_result_t - ZEParameterValidation::zeDeviceReserveCacheExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + ZEParameterValidation::zeRTASBuilderDestroyExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - if( nullptr == hDevice ) + if( nullptr == hBuilder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -4247,110 +4192,69 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeDeviceSetCacheAdviceExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ZEParameterValidation::zeRTASParallelOperationCreateExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - if( nullptr == hDevice ) + if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == ptr ) + if( nullptr == phParallelOperation ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeEventQueryTimestampsExpPrologue( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + ZEParameterValidation::zeRTASParallelOperationGetPropertiesExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - if( nullptr == hEvent ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hDevice ) + if( nullptr == hParallelOperation ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pCount ) + if( nullptr == pProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(pProperties); } ze_result_t - ZEParameterValidation::zeImageGetMemoryPropertiesExpPrologue( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ZEParameterValidation::zeRTASParallelOperationJoinExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - if( nullptr == hImage ) + if( nullptr == hParallelOperation ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pMemoryProperties ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ParameterValidation::validateExtensions(pMemoryProperties); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeImageViewCreateExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ZEParameterValidation::zeRTASParallelOperationDestroyExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - if( nullptr == hContext ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hImage ) + if( nullptr == hParallelOperation ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phImageView ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( 0x3 < desc->flags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - if( ZE_IMAGE_TYPE_BUFFER < desc->type ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(desc); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeImageViewCreateExpPrologue( + ZEParameterValidation::zeMemGetPitchFor2dImagePrologue( ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { if( nullptr == hContext ) @@ -4359,237 +4263,173 @@ namespace validation_layer if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hImage ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phImageView ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( 0x3 < desc->flags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - if( ZE_IMAGE_TYPE_BUFFER < desc->type ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(desc); - } - - - ze_result_t - ZEParameterValidation::zeKernelSchedulingHintExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor - ) - { - if( nullptr == hKernel ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pHint ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( 0x7 < pHint->flags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(pHint); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeDevicePciGetPropertiesExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + ZEParameterValidation::zeImageGetDeviceOffsetExpPrologue( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { - if( nullptr == hDevice ) + if( nullptr == hImage ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pPciProperties ) + if( nullptr == pDeviceOffset ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ParameterValidation::validateExtensions(pPciProperties); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListAppendImageCopyToMemoryExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEParameterValidation::zeCommandListCreateCloneExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hSrcImage ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == dstptr ) + if( nullptr == phClonedCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListAppendImageCopyFromMemoryExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read + ZEParameterValidation::zeCommandListImmediateAppendCommandListsExpPrologue( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - if( nullptr == hCommandList ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hDstImage ) + if( nullptr == hCommandListImmediate ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == srcptr ) + if( nullptr == phCommandLists ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) - return ZE_RESULT_ERROR_INVALID_SIZE; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeImageGetAllocPropertiesExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + ZEParameterValidation::zeCommandListImmediateAppendCommandListsWithParametersPrologue( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - if( nullptr == hContext ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hImage ) + if( nullptr == hCommandListImmediate ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pImageAllocProperties ) + if( nullptr == phCommandLists ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ParameterValidation::validateExtensions(pImageAllocProperties); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeModuleInspectLinkageExtPrologue( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + ZEParameterValidation::zeCommandListGetNextCommandIdExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - if( nullptr == pInspectDesc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phModules ) + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == phLog ) + if( nullptr == pCommandId ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x7 < pInspectDesc->flags ) + if( 0xff < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ParameterValidation::validateExtensions(pInspectDesc); + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZEParameterValidation::zeMemFreeExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + ZEParameterValidation::zeCommandListGetNextCommandIdWithKernelsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - if( nullptr == hContext ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pMemFreeDesc ) + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == ptr ) + if( nullptr == pCommandId ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x3 < pMemFreeDesc->freePolicy ) + if( 0xff < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - return ParameterValidation::validateExtensions(pMemFreeDesc); + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZEParameterValidation::zeFabricVertexGetExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + ZEParameterValidation::zeCommandListUpdateMutableCommandsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { - if( nullptr == hDriver ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pCount ) + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZEParameterValidation::zeFabricVertexGetSubVerticesExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + ZEParameterValidation::zeCommandListIsMutableExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { - if( nullptr == hVertex ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pCount ) + if( nullptr == pIsMutable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4597,31 +4437,51 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeFabricVertexGetPropertiesExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + ZEParameterValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { - if( nullptr == hVertex ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pVertexProperties ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; + } - return ParameterValidation::validateExtensions(pVertexProperties); + + ze_result_t + ZEParameterValidation::zeCommandListUpdateMutableCommandWaitEventsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeFabricVertexGetDeviceExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + ZEParameterValidation::zeCommandListUpdateMutableCommandKernelsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { - if( nullptr == hVertex ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phDevice ) + if( nullptr == pCommandId ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phKernels ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4629,15 +4489,19 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeDeviceGetFabricVertexExpPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + ZEParameterValidation::zeKernelGetBinaryExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { - if( nullptr == hDevice ) + if( nullptr == hKernel ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phVertex ) + if( nullptr == pSize ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pKernelBinary ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4645,108 +4509,119 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeFabricEdgeGetExpPrologue( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + ZEParameterValidation::zeDeviceImportExternalSemaphoreExtPrologue( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { - if( nullptr == hVertexA ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hVertexB ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == desc ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pCount ) + if( nullptr == phSemaphore ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( 0x1ff < desc->flags ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(desc); + } + + + ze_result_t + ZEParameterValidation::zeDeviceReleaseExternalSemaphoreExtPrologue( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ) + { + if( nullptr == hSemaphore ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeFabricEdgeGetVerticesExpPrologue( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + ZEParameterValidation::zeCommandListAppendSignalExternalSemaphoreExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if( nullptr == hEdge ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phVertexA ) + if( nullptr == phSemaphores ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == phVertexB ) + if( nullptr == signalParams ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + + if( (nullptr == phSemaphores) && (0 < numSemaphores) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + + if( (nullptr == signalParams) && (0 < numSemaphores) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeFabricEdgeGetPropertiesExpPrologue( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + ZEParameterValidation::zeCommandListAppendWaitExternalSemaphoreExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if( nullptr == hEdge ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pEdgeProperties ) + if( nullptr == phSemaphores ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ParameterValidation::validateExtensions(pEdgeProperties); - } - + if( nullptr == waitParams ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - ze_result_t - ZEParameterValidation::zeEventQueryKernelTimestampsExtPrologue( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. - ) - { - if( nullptr == hEvent ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( (nullptr == phSemaphores) && (0 < numSemaphores) ) + return ZE_RESULT_ERROR_INVALID_SIZE; - if( nullptr == pCount ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( (nullptr == waitParams) && (0 < numSemaphores) ) + return ZE_RESULT_ERROR_INVALID_SIZE; - return ParameterValidation::validateExtensions(pResults); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeRTASBuilderCreateExpPrologue( + ZEParameterValidation::zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { if( nullptr == hDriver ) @@ -4758,7 +4633,7 @@ namespace validation_layer if( nullptr == phBuilder ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion ) + if( ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ParameterValidation::validateExtensions(pDescriptor); @@ -4766,10 +4641,10 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASBuilderGetBuildPropertiesExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + ZEParameterValidation::zeRTASBuilderGetBuildPropertiesExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { if( nullptr == hBuilder ) @@ -4781,10 +4656,10 @@ namespace validation_layer if( nullptr == pProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) + if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( 0x3 < pBuildOpDescriptor->buildFlags ) @@ -4800,19 +4675,19 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeDriverRTASFormatCompatibilityCheckExpPrologue( + ZEParameterValidation::zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA ) + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB ) + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; @@ -4820,17 +4695,17 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASBuilderBuildExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ZEParameterValidation::zeRTASBuilderBuildExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used ///< during acceleration structure construction size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes void* pRtasBuffer, ///< [in] pointer to destination buffer size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration ///< structure bounds size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in ///< bytes @@ -4848,10 +4723,10 @@ namespace validation_layer if( nullptr == pRtasBuffer ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) + if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( 0x3 < pBuildOpDescriptor->buildFlags ) @@ -4862,27 +4737,186 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASBuilderDestroyExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ZEParameterValidation::zeRTASBuilderCommandListAppendCopyExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == dstptr ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == srcptr ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeRTASBuilderDestroyExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + if( nullptr == hBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeRTASParallelOperationCreateExtPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phParallelOperation ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeRTASParallelOperationGetPropertiesExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + ) + { + if( nullptr == hParallelOperation ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pProperties ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ParameterValidation::validateExtensions(pProperties); + } + + + ze_result_t + ZEParameterValidation::zeRTASParallelOperationJoinExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) + { + if( nullptr == hParallelOperation ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeRTASParallelOperationDestroyExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) + { + if( nullptr == hParallelOperation ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeDeviceGetVectorWidthPropertiesExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeKernelGetAllocationPropertiesExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. + ) + { + if( nullptr == hKernel ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ParameterValidation::validateExtensions(pAllocationProperties); + } + + + ze_result_t + ZEParameterValidation::zeMemGetIpcHandleWithPropertiesPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - if( nullptr == hBuilder ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == ptr ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pIpcHandle ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeRTASParallelOperationCreateExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + ZEParameterValidation::zeGraphCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - if( nullptr == hDriver ) + if( nullptr == hContext ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phParallelOperation ) + if( nullptr == phGraph ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4890,27 +4924,31 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASParallelOperationGetPropertiesExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + ZEParameterValidation::zeCommandListBeginGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if( nullptr == hParallelOperation ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pProperties ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ParameterValidation::validateExtensions(pProperties); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeRTASParallelOperationJoinExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ZEParameterValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if( nullptr == hParallelOperation ) + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -4918,11 +4956,11 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeRTASParallelOperationDestroyExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ZEParameterValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - if( nullptr == hParallelOperation ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -4930,35 +4968,33 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeMemGetPitchFor2dImagePrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + ZEParameterValidation::zeCommandListEndGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { - if( nullptr == hContext ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == phGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeImageGetDeviceOffsetExpPrologue( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ZEParameterValidation::zeCommandListGetGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { - if( nullptr == hImage ) + if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pDeviceOffset ) + if( nullptr == phGraph ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4966,15 +5002,16 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListCreateCloneExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ZEParameterValidation::zeGraphGetPrimaryCommandListExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phClonedCommandList ) + if( nullptr == phCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -4982,52 +5019,33 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListImmediateAppendCommandListsExpPrologue( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ZEParameterValidation::zeGraphSetDestructionCallbackExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if( nullptr == hCommandListImmediate ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phCommandLists ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListImmediateAppendCommandListsWithParametersPrologue( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ZEParameterValidation::zeGraphInstantiateExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { - if( nullptr == hCommandListImmediate ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == phCommandLists ) + if( nullptr == phExecutableGraph ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -5035,83 +5053,68 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListGetNextCommandIdExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ZEParameterValidation::zeCommandListAppendGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pCommandId ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( 0xff < desc->flags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - return ParameterValidation::validateExtensions(desc); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListGetNextCommandIdWithKernelsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ZEParameterValidation::zeExecutableGraphGetSourceGraphExtPrologue( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pCommandId ) + if( nullptr == phSourceGraph ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0xff < desc->flags ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(desc); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListUpdateMutableCommandsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + ZEParameterValidation::zeGraphIsEmptyExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ParameterValidation::validateExtensions(desc); + return ZE_RESULT_SUCCESS; } ze_result_t - ZEParameterValidation::zeCommandListIsMutableExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + ZEParameterValidation::zeGraphDumpContentsExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pIsMutable ) + if( nullptr == filePath ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -5119,13 +5122,11 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ZEParameterValidation::zeExecutableGraphDestroyExtPrologue( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -5133,15 +5134,11 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListUpdateMutableCommandWaitEventsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEParameterValidation::zeGraphDestroyExtPrologue( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { - if( nullptr == hCommandList ) + if( nullptr == hGraph ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -5149,22 +5146,25 @@ namespace validation_layer ze_result_t - ZEParameterValidation::zeCommandListUpdateMutableCommandKernelsExpPrologue( + ZEParameterValidation::zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { if( nullptr == hCommandList ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pCommandId ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phKernels ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( (nullptr == phWaitEvents) && (0 < numWaitEvents) ) + return ZE_RESULT_ERROR_INVALID_SIZE; return ZE_RESULT_SUCCESS; } 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 47a64901..5e99aa5b 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -191,40 +191,6 @@ namespace validation_layer ze_result_t zeVirtualMemSetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t access ) override; ze_result_t zeVirtualMemGetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t* access, size_t* outSize ) override; ze_result_t zeKernelSetGlobalOffsetExpPrologue( ze_kernel_handle_t hKernel, uint32_t offsetX, uint32_t offsetY, uint32_t offsetZ ) override; - ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override; - ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override; - ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override; - ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override; - ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override; - ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override; - ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override; - ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override; - ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override; - ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override; - ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; - ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; - ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; - ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; - ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; - ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; - ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; - ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; - ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; - ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; - ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; - ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; - ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; - ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; - ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; - ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; - 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override; ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override; ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override; @@ -268,5 +234,39 @@ namespace validation_layer ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override; ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override; + ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override; + ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override; + ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override; + ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override; + ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override; + ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override; + ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override; + ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override; + ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override; + ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override; + ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; + ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; + ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; + ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; + ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; + ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; + ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; + ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; + ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; + ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; + ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; + ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; + ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; + ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; + 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 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; }; } \ 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 dcb591cb..aa9e8c9b 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp @@ -2477,24 +2477,6 @@ namespace validation_layer } - ze_result_t - ZESParameterValidation::zesDevicePciLinkSpeedUpdateExtPrologue( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pendingAction ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - ze_result_t ZESParameterValidation::zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, ///< [in] Power domain handle instance. @@ -3037,4 +3019,22 @@ namespace validation_layer return ParameterValidation::validateExtensions(pCapability); } + + ze_result_t + ZESParameterValidation::zesDevicePciLinkSpeedUpdateExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pendingAction ) + 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/zes_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h index 506654fc..e0d7674a 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h @@ -150,7 +150,6 @@ namespace validation_layer ze_result_t zesTemperatureGetConfigPrologue( zes_temp_handle_t hTemperature, zes_temp_config_t* pConfig ) override; ze_result_t zesTemperatureSetConfigPrologue( zes_temp_handle_t hTemperature, const zes_temp_config_t* pConfig ) override; ze_result_t zesTemperatureGetStatePrologue( zes_temp_handle_t hTemperature, double* pTemperature ) override; - ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override; ze_result_t zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) override; ze_result_t zesPowerSetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) override; ze_result_t zesPowerGetLimitsExt2Prologue( zes_pwr_handle_t hPower, uint32_t* pLimit ) override; @@ -177,5 +176,6 @@ namespace validation_layer ze_result_t zesVFManagementGetVFMemoryUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_mem_exp2_t* pMemUtil ) override; 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; }; } \ No newline at end of file diff --git a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp index c811c026..cfd494bb 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -771,293 +771,6 @@ namespace validation_layer } - ze_result_t - ZETParameterValidation::zetDeviceGetConcurrentMetricGroupsExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. - ) - { - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerCreateExpPrologue( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer - ) - { - if( nullptr == hContext ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == phMetricGroups ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == desc ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ParameterValidation::validateExtensions(desc); - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerDestroyExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer - ) - { - if( nullptr == hMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerEnableExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. - ) - { - if( nullptr == hMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerDisableExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. - ) - { - if( nullptr == hMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerReadDataExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - ) - { - if( nullptr == hMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pRawDataSize ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricDecoderCreateExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object - ) - { - if( nullptr == hMetricTracer ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == phMetricDecoder ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricDecoderDestroyExpPrologue( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object - ) - { - if( nullptr == phMetricDecoder ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricDecoderGetDecodableMetricsExpPrologue( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. - ) - { - if( nullptr == hMetricDecoder ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pCount ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phMetrics ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetMetricTracerDecodeExpPrologue( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries - ) - { - if( nullptr == phMetricDecoder ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pRawDataSize ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phMetrics ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pSetCount ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pMetricEntriesCount ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetCommandListAppendMarkerExpPrologue( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value - ) - { - if( nullptr == hCommandList ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == hMetricGroup ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetDeviceEnableMetricsExpPrologue( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. - ) - { - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - - ze_result_t - ZETParameterValidation::zetDeviceDisableMetricsExpPrologue( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled - ) - { - if( nullptr == hDevice ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - return ZE_RESULT_SUCCESS; - } - - ze_result_t ZETParameterValidation::zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group @@ -1320,87 +1033,293 @@ namespace validation_layer if( nullptr == hMetricProgrammable ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pParameterValues ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + if( nullptr == pParameterValues ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pName ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pDescription ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pMetricHandleCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricCreateFromProgrammableExpPrologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. + ) + { + if( nullptr == hMetricProgrammable ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pParameterValues ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pName ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pDescription ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pMetricHandleCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricGroupCreateExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pName ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pDescription ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phMetricGroup ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( 0x7 < samplingType ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricGroupAddMetricExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. + ) + { + if( nullptr == hMetricGroup ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hMetric ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricGroupRemoveMetricExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + ) + { + if( nullptr == hMetricGroup ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hMetric ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricGroupCloseExpPrologue( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + ) + { + if( nullptr == hMetricGroup ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricGroupDestroyExpPrologue( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + ) + { + if( nullptr == hMetricGroup ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricDestroyExpPrologue( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + ) + { + if( nullptr == hMetric ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetDeviceGetConcurrentMetricGroupsExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricTracerCreateExpPrologue( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + ) + { + if( nullptr == hContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pName ) + if( nullptr == phMetricGroups ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pDescription ) + if( nullptr == desc ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pMetricHandleCount ) + if( nullptr == phMetricTracer ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - return ZE_RESULT_SUCCESS; + return ParameterValidation::validateExtensions(desc); } ze_result_t - ZETParameterValidation::zetMetricCreateFromProgrammableExpPrologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + ZETParameterValidation::zetMetricTracerDestroyExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { - if( nullptr == hMetricProgrammable ) + if( nullptr == hMetricTracer ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pParameterValues ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pName ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; + } - if( nullptr == pDescription ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pMetricHandleCount ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + ze_result_t + ZETParameterValidation::zetMetricTracerEnableExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. + ) + { + if( nullptr == hMetricTracer ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; } ze_result_t - ZETParameterValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + ZETParameterValidation::zetMetricTracerDisableExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { - if( nullptr == hDevice ) + if( nullptr == hMetricTracer ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -1408,80 +1327,161 @@ namespace validation_layer ze_result_t - ZETParameterValidation::zetMetricGroupCreateExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + ZETParameterValidation::zetMetricTracerReadDataExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { - if( nullptr == hDevice ) + if( nullptr == hMetricTracer ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pName ) + if( nullptr == pRawDataSize ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( nullptr == pDescription ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; + } - if( nullptr == phMetricGroup ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x7 < samplingType ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; + ze_result_t + ZETParameterValidation::zetMetricDecoderCreateExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + ) + { + if( nullptr == hMetricTracer ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phMetricDecoder ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; } ze_result_t - ZETParameterValidation::zetMetricGroupAddMetricExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + ZETParameterValidation::zetMetricDecoderDestroyExpPrologue( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { - if( nullptr == hMetricGroup ) + if( nullptr == phMetricDecoder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hMetric ) + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZETParameterValidation::zetMetricDecoderGetDecodableMetricsExpPrologue( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. + ) + { + if( nullptr == hMetricDecoder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phMetrics ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; } ze_result_t - ZETParameterValidation::zetMetricGroupRemoveMetricExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + ZETParameterValidation::zetMetricTracerDecodeExpPrologue( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { - if( nullptr == hMetricGroup ) + if( nullptr == phMetricDecoder ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == hMetric ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == pRawDataSize ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phMetrics ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pSetCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pMetricEntriesCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; } ze_result_t - ZETParameterValidation::zetMetricGroupCloseExpPrologue( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + ZETParameterValidation::zetCommandListAppendMarkerExpPrologue( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == hMetricGroup ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; @@ -1490,11 +1490,11 @@ namespace validation_layer ze_result_t - ZETParameterValidation::zetMetricGroupDestroyExpPrologue( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + ZETParameterValidation::zetDeviceEnableMetricsExpPrologue( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { - if( nullptr == hMetricGroup ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; @@ -1502,11 +1502,11 @@ namespace validation_layer ze_result_t - ZETParameterValidation::zetMetricDestroyExpPrologue( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + ZETParameterValidation::zetDeviceDisableMetricsExpPrologue( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { - if( nullptr == hMetric ) + if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; return ZE_RESULT_SUCCESS; diff --git a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h index 975f7e58..7ac4e83f 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h @@ -59,19 +59,6 @@ namespace validation_layer ze_result_t zetTracerExpSetProloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override; ze_result_t zetTracerExpSetEpiloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override; ze_result_t zetTracerExpSetEnabledPrologue( zet_tracer_exp_handle_t hTracer, ze_bool_t enable ) override; - ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override; - ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override; - ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override; - ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; - ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; - ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override; - ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override; - ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override; - ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override; - ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override; - ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override; - ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override; - ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) override; ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override; ze_result_t zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ze_bool_t synchronizedWithHost, uint64_t* globalTimestamp, uint64_t* metricTimestamp ) override; ze_result_t zetMetricGroupGetExportDataExpPrologue( zet_metric_group_handle_t hMetricGroup, const uint8_t* pRawData, size_t rawDataSize, size_t* pExportDataSize, uint8_t * pExportData ) override; @@ -89,5 +76,18 @@ namespace validation_layer ze_result_t zetMetricGroupCloseExpPrologue( zet_metric_group_handle_t hMetricGroup ) override; ze_result_t zetMetricGroupDestroyExpPrologue( zet_metric_group_handle_t hMetricGroup ) override; ze_result_t zetMetricDestroyExpPrologue( zet_metric_handle_t hMetric ) override; + ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override; + ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override; + ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override; + ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; + ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; + ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override; + ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override; + ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override; + ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override; + ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override; + ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override; + ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override; + ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) 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 24a103fb..df916fd9 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -359,74 +359,6 @@ class ZEValidationEntryPoints { virtual ze_result_t zeVirtualMemGetAccessAttributeEpilogue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t* access, size_t* outSize , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelSetGlobalOffsetExpPrologue( ze_kernel_handle_t hKernel, uint32_t offsetX, uint32_t offsetY, uint32_t offsetZ ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelSetGlobalOffsetExpEpilogue( ze_kernel_handle_t hKernel, uint32_t offsetX, uint32_t offsetY, uint32_t offsetZ , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeKernelGetBinaryExpEpilogue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceImportExternalSemaphoreExtEpilogue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtEpilogue( ze_external_semaphore_ext_handle_t hSemaphore , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtEpilogue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, 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 zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListAppendWaitExternalSemaphoreExtEpilogue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, 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 zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderCreateExtEpilogue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtEpilogue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderBuildExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtEpilogue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, 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 zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASBuilderDestroyExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationCreateExtEpilogue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationGetPropertiesExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationJoinExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeRTASParallelOperationDestroyExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtEpilogue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeKernelGetAllocationPropertiesExpEpilogue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeMemGetIpcHandleWithPropertiesEpilogue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphCreateExtEpilogue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListBeginGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtEpilogue( ze_command_list_handle_t hCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListEndGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListGetGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphGetPrimaryCommandListExtEpilogue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphSetDestructionCallbackExtEpilogue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphInstantiateExtEpilogue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeCommandListAppendGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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 zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeExecutableGraphGetSourceGraphExtEpilogue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphIsEmptyExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeGraphDumpContentsExtEpilogue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} - 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceReserveCacheExtEpilogue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) {return ZE_RESULT_SUCCESS;} @@ -513,6 +445,74 @@ class ZEValidationEntryPoints { virtual ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpEpilogue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListUpdateMutableCommandKernelsExpEpilogue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetBinaryExpEpilogue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceImportExternalSemaphoreExtEpilogue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceReleaseExternalSemaphoreExtEpilogue( ze_external_semaphore_ext_handle_t hSemaphore , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendSignalExternalSemaphoreExtEpilogue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, 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 zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendWaitExternalSemaphoreExtEpilogue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, 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 zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderCreateExtEpilogue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderGetBuildPropertiesExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDriverRTASFormatCompatibilityCheckExtEpilogue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderBuildExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderCommandListAppendCopyExtEpilogue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, 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 zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASBuilderDestroyExtEpilogue( ze_rtas_builder_ext_handle_t hBuilder , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationCreateExtEpilogue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationGetPropertiesExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationJoinExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeRTASParallelOperationDestroyExtEpilogue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetVectorWidthPropertiesExtEpilogue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetAllocationPropertiesExpEpilogue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeMemGetIpcHandleWithPropertiesEpilogue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphCreateExtEpilogue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListBeginCaptureIntoGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListIsGraphCaptureEnabledExtEpilogue( ze_command_list_handle_t hCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListEndGraphCaptureExtEpilogue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListGetGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetPrimaryCommandListExtEpilogue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphSetDestructionCallbackExtEpilogue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphInstantiateExtEpilogue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendGraphExtEpilogue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, 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 zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeExecutableGraphGetSourceGraphExtEpilogue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphIsEmptyExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphDumpContentsExtEpilogue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + 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 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;} // 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 dfc7d111..5150a8b7 100644 --- a/source/layers/validation/common/zes_entry_points.h +++ b/source/layers/validation/common/zes_entry_points.h @@ -277,8 +277,6 @@ class ZESValidationEntryPoints { virtual ze_result_t zesTemperatureSetConfigEpilogue( zes_temp_handle_t hTemperature, const zes_temp_config_t* pConfig , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesTemperatureGetStatePrologue( zes_temp_handle_t hTemperature, double* pTemperature ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesTemperatureGetStateEpilogue( zes_temp_handle_t hTemperature, double* pTemperature , 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 zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesPowerGetLimitsExtEpilogue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesPowerSetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) {return ZE_RESULT_SUCCESS;} @@ -331,6 +329,8 @@ class ZESValidationEntryPoints { virtual ze_result_t zesVFManagementGetVFEngineUtilizationExp2Epilogue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_engine_exp2_t* pEngineUtil , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesVFManagementGetVFCapabilitiesExp2Prologue( zes_vf_handle_t hVFhandle, zes_vf_exp2_capabilities_t* pCapability ) {return ZE_RESULT_SUCCESS;} 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 ~ZESValidationEntryPoints() {} }; } \ No newline at end of file diff --git a/source/layers/validation/common/zet_entry_points.h b/source/layers/validation/common/zet_entry_points.h index e2a9e17d..7e67a5c5 100644 --- a/source/layers/validation/common/zet_entry_points.h +++ b/source/layers/validation/common/zet_entry_points.h @@ -95,32 +95,6 @@ class ZETValidationEntryPoints { virtual ze_result_t zetTracerExpSetEpiloguesEpilogue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetTracerExpSetEnabledPrologue( zet_tracer_exp_handle_t hTracer, ze_bool_t enable ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetTracerExpSetEnabledEpilogue( zet_tracer_exp_handle_t hTracer, ze_bool_t enable , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpEpilogue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerCreateExpEpilogue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDestroyExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerEnableExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDisableExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerReadDataExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderCreateExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderDestroyExpEpilogue( zet_metric_decoder_exp_handle_t phMetricDecoder , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpEpilogue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetMetricTracerDecodeExpEpilogue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetCommandListAppendMarkerExpEpilogue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceEnableMetricsExpEpilogue( zet_device_handle_t hDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceDisableMetricsExpEpilogue( zet_device_handle_t hDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpEpilogue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ze_bool_t synchronizedWithHost, uint64_t* globalTimestamp, uint64_t* metricTimestamp ) {return ZE_RESULT_SUCCESS;} @@ -155,6 +129,32 @@ class ZETValidationEntryPoints { virtual ze_result_t zetMetricGroupDestroyExpEpilogue( zet_metric_group_handle_t hMetricGroup , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricDestroyExpPrologue( zet_metric_handle_t hMetric ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricDestroyExpEpilogue( zet_metric_handle_t hMetric , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceGetConcurrentMetricGroupsExpEpilogue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerCreateExpEpilogue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDestroyExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerEnableExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDisableExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerReadDataExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderCreateExpEpilogue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderDestroyExpEpilogue( zet_metric_decoder_exp_handle_t phMetricDecoder , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricDecoderGetDecodableMetricsExpEpilogue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetMetricTracerDecodeExpEpilogue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetCommandListAppendMarkerExpEpilogue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceEnableMetricsExpEpilogue( zet_device_handle_t hDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceDisableMetricsExpEpilogue( zet_device_handle_t hDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ~ZETValidationEntryPoints() {} }; } \ 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 f2eefa11..9e43aa9b 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -2911,23 +2911,27 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeKernelGetBinaryExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ZEHandleLifetimeValidation::zeDeviceReserveCacheExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { - if ( !context.handleLifetime->isHandleValid( hKernel )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDeviceImportExternalSemaphoreExtPrologue( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + ZEHandleLifetimeValidation::zeDeviceSetCacheAdviceExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { @@ -2937,163 +2941,153 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDeviceReleaseExternalSemaphoreExtPrologue( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ZEHandleLifetimeValidation::zeEventQueryTimestampsExpPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { - if ( !context.handleLifetime->isHandleValid( hSemaphore )){ + if ( !context.handleLifetime->isHandleValid( hEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListAppendSignalExternalSemaphoreExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEHandleLifetimeValidation::zeImageGetMemoryPropertiesExpPrologue( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { - 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 != phSemaphores) && (i < numSemaphores); ++i){ - if (!context.handleLifetime->isHandleValid( phSemaphores[i] )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - } - if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ - if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + if ( !context.handleLifetime->isHandleValid( hImage )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListAppendWaitExternalSemaphoreExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEHandleLifetimeValidation::zeImageViewCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - 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 != phSemaphores) && (i < numSemaphores); ++i){ - if (!context.handleLifetime->isHandleValid( phSemaphores[i] )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } - if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ - if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + if ( !context.handleLifetime->isHandleValid( hImage )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderCreateExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ZEHandleLifetimeValidation::zeImageViewCreateExpPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hImage )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderGetBuildPropertiesExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ZEHandleLifetimeValidation::zeKernelSchedulingHintExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ + if ( !context.handleLifetime->isHandleValid( hKernel )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDriverRTASFormatCompatibilityCheckExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ZEHandleLifetimeValidation::zeDevicePciGetPropertiesExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderBuildExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ZEHandleLifetimeValidation::zeCommandListAppendImageCopyToMemoryExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + if ( !context.handleLifetime->isHandleValid( hSrcImage )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderCommandListAppendCopyExtPrologue( + ZEHandleLifetimeValidation::zeCommandListAppendImageCopyFromMemoryExtPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -3108,6 +3102,9 @@ namespace validation_layer if (!context.handleLifetime->isOpen( hCommandList )){ return ZE_RESULT_ERROR_INVALID_ARGUMENT; } + if ( !context.handleLifetime->isHandleValid( hDstImage )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -3119,353 +3116,396 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderDestroyExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ZEHandleLifetimeValidation::zeImageGetAllocPropertiesExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hImage )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationCreateExtPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + ZEHandleLifetimeValidation::zeModuleInspectLinkageExtPrologue( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + for (size_t i = 0; ( nullptr != phModules) && (i < numModules); ++i){ + if (!context.handleLifetime->isHandleValid( phModules[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationGetPropertiesExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + ZEHandleLifetimeValidation::zeMemFreeExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationJoinExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ZEHandleLifetimeValidation::zeFabricVertexGetExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationDestroyExtPrologue( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy - ) - { - - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeDeviceGetVectorWidthPropertiesExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. - ) - { - - if ( !context.handleLifetime->isHandleValid( hDevice )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeKernelGetAllocationPropertiesExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ZEHandleLifetimeValidation::zeFabricVertexGetSubVerticesExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { - if ( !context.handleLifetime->isHandleValid( hKernel )){ + if ( !context.handleLifetime->isHandleValid( hVertex )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeMemGetIpcHandleWithPropertiesPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + ZEHandleLifetimeValidation::zeFabricVertexGetPropertiesExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ + if ( !context.handleLifetime->isHandleValid( hVertex )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphCreateExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ZEHandleLifetimeValidation::zeFabricVertexGetDeviceExpPrologue( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ + if ( !context.handleLifetime->isHandleValid( hVertex )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListBeginGraphCaptureExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEHandleLifetimeValidation::zeDeviceGetFabricVertexExpPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEHandleLifetimeValidation::zeFabricEdgeGetExpPrologue( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hVertexA )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hVertexB )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ZEHandleLifetimeValidation::zeFabricEdgeGetVerticesExpPrologue( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hEdge )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListEndGraphCaptureExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ZEHandleLifetimeValidation::zeFabricEdgeGetPropertiesExpPrologue( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hEdge )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListGetGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ZEHandleLifetimeValidation::zeEventQueryKernelTimestampsExtPrologue( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphGetPrimaryCommandListExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + ZEHandleLifetimeValidation::zeRTASBuilderCreateExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphSetDestructionCallbackExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEHandleLifetimeValidation::zeRTASBuilderGetBuildPropertiesExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphInstantiateExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ZEHandleLifetimeValidation::zeDriverRTASFormatCompatibilityCheckExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListAppendGraphExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ZEHandleLifetimeValidation::zeRTASBuilderBuildExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - 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( hGraph )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ - if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeExecutableGraphGetSourceGraphExtPrologue( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ZEHandleLifetimeValidation::zeRTASBuilderDestroyExpPrologue( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphIsEmptyExtPrologue( - ze_graph_handle_t hGraph ///< [in] handle of the graph + ZEHandleLifetimeValidation::zeRTASParallelOperationCreateExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphDumpContentsExtPrologue( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ZEHandleLifetimeValidation::zeRTASParallelOperationGetPropertiesExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeExecutableGraphDestroyExtPrologue( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ZEHandleLifetimeValidation::zeRTASParallelOperationJoinExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeGraphDestroyExtPrologue( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ZEHandleLifetimeValidation::zeRTASParallelOperationDestroyExpPrologue( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - if ( !context.handleLifetime->isHandleValid( hGraph )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ 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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function + ZEHandleLifetimeValidation::zeMemGetPitchFor2dImagePrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch + ) + { + + if ( !context.handleLifetime->isHandleValid( hContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeImageGetDeviceOffsetExpPrologue( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ) + { + + if ( !context.handleLifetime->isHandleValid( hImage )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListCreateCloneExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListImmediateAppendCommandListsExpPrologue( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hCommandListImmediate )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if (!context.handleLifetime->isOpen( hCommandList )){ - return ZE_RESULT_ERROR_INVALID_ARGUMENT; + for (size_t i = 0; ( nullptr != phCommandLists) && (i < numCommandLists); ++i){ + if (!context.handleLifetime->isHandleValid( phCommandLists[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; @@ -3478,116 +3518,163 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDeviceReserveCacheExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + ZEHandleLifetimeValidation::zeCommandListImmediateAppendCommandListsWithParametersPrologue( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hCommandListImmediate )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } + for (size_t i = 0; ( nullptr != phCommandLists) && (i < numCommandLists); ++i){ + if (!context.handleLifetime->isHandleValid( phCommandLists[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDeviceSetCacheAdviceExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ZEHandleLifetimeValidation::zeCommandListGetNextCommandIdExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeEventQueryTimestampsExpPrologue( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + ZEHandleLifetimeValidation::zeCommandListGetNextCommandIdWithKernelsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - if ( !context.handleLifetime->isHandleValid( hEvent )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hDevice )){ + for (size_t i = 0; ( nullptr != phKernels) && (i < numKernels); ++i){ + if (!context.handleLifetime->isHandleValid( phKernels[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeImageGetMemoryPropertiesExpPrologue( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { - if ( !context.handleLifetime->isHandleValid( hImage )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeImageViewCreateExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ZEHandleLifetimeValidation::zeCommandListIsMutableExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hImage )){ + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeImageViewCreateExpPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandWaitEventsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hDevice )){ + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } - if ( !context.handleLifetime->isHandleValid( hImage )){ + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandKernelsExpPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } + for (size_t i = 0; ( nullptr != phKernels) && (i < numKernels); ++i){ + if (!context.handleLifetime->isHandleValid( phKernels[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeKernelSchedulingHintExpPrologue( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ZEHandleLifetimeValidation::zeKernelGetBinaryExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { @@ -3597,9 +3684,10 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDevicePciGetPropertiesExtPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + ZEHandleLifetimeValidation::zeDeviceImportExternalSemaphoreExtPrologue( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { @@ -3609,15 +3697,24 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListAppendImageCopyToMemoryExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written + ZEHandleLifetimeValidation::zeDeviceReleaseExternalSemaphoreExtPrologue( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ) + { + + if ( !context.handleLifetime->isHandleValid( hSemaphore )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListAppendSignalExternalSemaphoreExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -3632,8 +3729,10 @@ namespace validation_layer if (!context.handleLifetime->isOpen( hCommandList )){ return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - if ( !context.handleLifetime->isHandleValid( hSrcImage )){ + for (size_t i = 0; ( nullptr != phSemaphores) && (i < numSemaphores); ++i){ + if (!context.handleLifetime->isHandleValid( phSemaphores[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; @@ -3644,17 +3743,15 @@ namespace validation_layer } } return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeCommandListAppendImageCopyFromMemoryExtPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read + } + ze_result_t + ZEHandleLifetimeValidation::zeCommandListAppendWaitExternalSemaphoreExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -3669,8 +3766,10 @@ namespace validation_layer if (!context.handleLifetime->isOpen( hCommandList )){ return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - if ( !context.handleLifetime->isHandleValid( hDstImage )){ + for (size_t i = 0; ( nullptr != phSemaphores) && (i < numSemaphores); ++i){ + if (!context.handleLifetime->isHandleValid( phSemaphores[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; @@ -3683,64 +3782,36 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeImageGetAllocPropertiesExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties - ) - { - - if ( !context.handleLifetime->isHandleValid( hContext )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if ( !context.handleLifetime->isHandleValid( hImage )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeModuleInspectLinkageExtPrologue( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + ZEHandleLifetimeValidation::zeRTASBuilderCreateExtPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { - for (size_t i = 0; ( nullptr != phModules) && (i < numModules); ++i){ - if (!context.handleLifetime->isHandleValid( phModules[i] )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeMemFreeExtPrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + ZEHandleLifetimeValidation::zeRTASBuilderGetBuildPropertiesExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeFabricVertexGetExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + ZEHandleLifetimeValidation::zeDriverRTASFormatCompatibilityCheckExtPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { @@ -3750,365 +3821,320 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeFabricVertexGetSubVerticesExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + ZEHandleLifetimeValidation::zeRTASBuilderBuildExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - if ( !context.handleLifetime->isHandleValid( hVertex )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeFabricVertexGetPropertiesExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties - ) - { - - if ( !context.handleLifetime->isHandleValid( hVertex )){ + if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeFabricVertexGetDeviceExpPrologue( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + ZEHandleLifetimeValidation::zeRTASBuilderCommandListAppendCopyExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - if ( !context.handleLifetime->isHandleValid( hVertex )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeDeviceGetFabricVertexExpPrologue( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device - ) - { - - if ( !context.handleLifetime->isHandleValid( hDevice )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeFabricEdgeGetExpPrologue( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. - ) - { - - if ( !context.handleLifetime->isHandleValid( hVertexA )){ + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hVertexB )){ + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeFabricEdgeGetVerticesExpPrologue( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + ZEHandleLifetimeValidation::zeRTASBuilderDestroyExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - if ( !context.handleLifetime->isHandleValid( hEdge )){ + if ( !context.handleLifetime->isHandleValid( hBuilder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeFabricEdgeGetPropertiesExpPrologue( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + ZEHandleLifetimeValidation::zeRTASParallelOperationCreateExtPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - if ( !context.handleLifetime->isHandleValid( hEdge )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeEventQueryKernelTimestampsExtPrologue( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + ZEHandleLifetimeValidation::zeRTASParallelOperationGetPropertiesExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - if ( !context.handleLifetime->isHandleValid( hEvent )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderCreateExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + ZEHandleLifetimeValidation::zeRTASParallelOperationJoinExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderGetBuildPropertiesExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + ZEHandleLifetimeValidation::zeRTASParallelOperationDestroyExtPrologue( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeDriverRTASFormatCompatibilityCheckExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + ZEHandleLifetimeValidation::zeDeviceGetVectorWidthPropertiesExtPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderBuildExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ZEHandleLifetimeValidation::zeKernelGetAllocationPropertiesExpPrologue( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hKernel )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASBuilderDestroyExpPrologue( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ZEHandleLifetimeValidation::zeMemGetIpcHandleWithPropertiesPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - if ( !context.handleLifetime->isHandleValid( hBuilder )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationCreateExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + ZEHandleLifetimeValidation::zeGraphCreateExtPrologue( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hContext )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationGetPropertiesExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + ZEHandleLifetimeValidation::zeCommandListBeginGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationJoinExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ZEHandleLifetimeValidation::zeCommandListBeginCaptureIntoGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeRTASParallelOperationDestroyExpPrologue( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ZEHandleLifetimeValidation::zeCommandListIsGraphCaptureEnabledExtPrologue( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeMemGetPitchFor2dImagePrologue( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + ZEHandleLifetimeValidation::zeCommandListEndGraphCaptureExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeImageGetDeviceOffsetExpPrologue( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ZEHandleLifetimeValidation::zeCommandListGetGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { - if ( !context.handleLifetime->isHandleValid( hImage )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListCreateCloneExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ZEHandleLifetimeValidation::zeGraphGetPrimaryCommandListExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListImmediateAppendCommandListsExpPrologue( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ZEHandleLifetimeValidation::zeGraphSetDestructionCallbackExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if ( !context.handleLifetime->isHandleValid( hCommandListImmediate )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - for (size_t i = 0; ( nullptr != phCommandLists) && (i < numCommandLists); ++i){ - if (!context.handleLifetime->isHandleValid( phCommandLists[i] )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - } - if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ - if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphInstantiateExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListImmediateAppendCommandListsWithParametersPrologue( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function + ZEHandleLifetimeValidation::zeCommandListAppendGraphExtPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ///< on before launching ) { - if ( !context.handleLifetime->isHandleValid( hCommandListImmediate )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phCommandLists) && (i < numCommandLists); ++i){ - if (!context.handleLifetime->isHandleValid( phCommandLists[i] )){ + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; @@ -4121,87 +4147,75 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListGetNextCommandIdExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ZEHandleLifetimeValidation::zeExecutableGraphGetSourceGraphExtPrologue( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListGetNextCommandIdWithKernelsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ZEHandleLifetimeValidation::zeGraphIsEmptyExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - for (size_t i = 0; ( nullptr != phKernels) && (i < numKernels); ++i){ - if (!context.handleLifetime->isHandleValid( phKernels[i] )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + ZEHandleLifetimeValidation::zeGraphDumpContentsExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListIsMutableExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + ZEHandleLifetimeValidation::zeExecutableGraphDestroyExtPrologue( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandSignalEventExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ZEHandleLifetimeValidation::zeGraphDestroyExtPrologue( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { - if ( !context.handleLifetime->isHandleValid( hCommandList )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ + if ( !context.handleLifetime->isHandleValid( hGraph )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandWaitEventsExpPrologue( + ZEHandleLifetimeValidation::zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait ///< on before launching ) @@ -4210,28 +4224,14 @@ namespace validation_layer if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ - if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZEHandleLifetimeValidation::zeCommandListUpdateMutableCommandKernelsExpPrologue( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to - ) - { - - if ( !context.handleLifetime->isHandleValid( hCommandList )){ + if (hSignalEvent && !context.handleLifetime->isHandleValid( hSignalEvent )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - for (size_t i = 0; ( nullptr != phKernels) && (i < numKernels); ++i){ - if (!context.handleLifetime->isHandleValid( phKernels[i] )){ + for (size_t i = 0; ( nullptr != phWaitEvents) && (i < numWaitEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phWaitEvents[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } } 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 12ba8478..e7b2452c 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -187,40 +187,6 @@ namespace validation_layer ze_result_t zeVirtualMemSetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t access ) override; ze_result_t zeVirtualMemGetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t* access, size_t* outSize ) override; ze_result_t zeKernelSetGlobalOffsetExpPrologue( ze_kernel_handle_t hKernel, uint32_t offsetX, uint32_t offsetY, uint32_t offsetZ ) override; - ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override; - ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override; - ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override; - ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override; - ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override; - ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override; - ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override; - ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override; - ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override; - ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override; - ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; - ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; - ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; - ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; - ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; - ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; - ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; - ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; - ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; - ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; - ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; - ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; - ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; - ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; - ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; - ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; - ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; - 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 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 zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, size_t cacheLevel, size_t cacheReservationSize ) override; ze_result_t zeDeviceSetCacheAdviceExtPrologue( ze_device_handle_t hDevice, void* ptr, size_t regionSize, ze_cache_ext_region_t cacheRegion ) override; ze_result_t zeEventQueryTimestampsExpPrologue( ze_event_handle_t hEvent, ze_device_handle_t hDevice, uint32_t* pCount, ze_kernel_timestamp_result_t* pTimestamps ) override; @@ -264,6 +230,40 @@ namespace validation_layer ze_result_t zeCommandListUpdateMutableCommandSignalEventExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, ze_event_handle_t hSignalEvent ) override; ze_result_t zeCommandListUpdateMutableCommandWaitEventsExpPrologue( ze_command_list_handle_t hCommandList, uint64_t commandId, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListUpdateMutableCommandKernelsExpPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, uint64_t* pCommandId, ze_kernel_handle_t* phKernels ) override; + ze_result_t zeKernelGetBinaryExpPrologue( ze_kernel_handle_t hKernel, size_t* pSize, uint8_t* pKernelBinary ) override; + ze_result_t zeDeviceImportExternalSemaphoreExtPrologue( ze_device_handle_t hDevice, const ze_external_semaphore_ext_desc_t* desc, ze_external_semaphore_ext_handle_t* phSemaphore ) override; + ze_result_t zeDeviceReleaseExternalSemaphoreExtPrologue( ze_external_semaphore_ext_handle_t hSemaphore ) override; + ze_result_t zeCommandListAppendSignalExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_signal_params_ext_t* signalParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeCommandListAppendWaitExternalSemaphoreExtPrologue( ze_command_list_handle_t hCommandList, uint32_t numSemaphores, ze_external_semaphore_ext_handle_t* phSemaphores, ze_external_semaphore_wait_params_ext_t* waitParams, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeRTASBuilderCreateExtPrologue( ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t* pDescriptor, ze_rtas_builder_ext_handle_t* phBuilder ) override; + ze_result_t zeRTASBuilderGetBuildPropertiesExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ze_rtas_builder_ext_properties_t* pProperties ) override; + ze_result_t zeDriverRTASFormatCompatibilityCheckExtPrologue( ze_driver_handle_t hDriver, ze_rtas_format_ext_t rtasFormatA, ze_rtas_format_ext_t rtasFormatB ) override; + ze_result_t zeRTASBuilderBuildExtPrologue( ze_rtas_builder_ext_handle_t hBuilder, const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, void* pScratchBuffer, size_t scratchBufferSizeBytes, void* pRtasBuffer, size_t rtasBufferSizeBytes, ze_rtas_parallel_operation_ext_handle_t hParallelOperation, void* pBuildUserPtr, ze_rtas_aabb_ext_t* pBounds, size_t* pRtasBufferSizeBytes ) override; + ze_result_t zeRTASBuilderCommandListAppendCopyExtPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const void* srcptr, size_t size, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeRTASBuilderDestroyExtPrologue( ze_rtas_builder_ext_handle_t hBuilder ) override; + ze_result_t zeRTASParallelOperationCreateExtPrologue( ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ) override; + ze_result_t zeRTASParallelOperationGetPropertiesExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties ) override; + ze_result_t zeRTASParallelOperationJoinExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; + ze_result_t zeRTASParallelOperationDestroyExtPrologue( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ) override; + ze_result_t zeDeviceGetVectorWidthPropertiesExtPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_vector_width_properties_ext_t* pVectorWidthProperties ) override; + ze_result_t zeKernelGetAllocationPropertiesExpPrologue( ze_kernel_handle_t hKernel, uint32_t* pCount, ze_kernel_allocation_exp_properties_t* pAllocationProperties ) override; + ze_result_t zeMemGetIpcHandleWithPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, void* pNext, ze_ipc_mem_handle_t* pIpcHandle ) override; + ze_result_t zeGraphCreateExtPrologue( ze_context_handle_t hContext, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListBeginGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext ) override; + ze_result_t zeCommandListBeginCaptureIntoGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t hGraph, const void* pNext ) override; + ze_result_t zeCommandListIsGraphCaptureEnabledExtPrologue( ze_command_list_handle_t hCommandList ) override; + ze_result_t zeCommandListEndGraphCaptureExtPrologue( ze_command_list_handle_t hCommandList, const void* pNext, ze_graph_handle_t* phGraph ) override; + ze_result_t zeCommandListGetGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_graph_handle_t* phGraph ) override; + ze_result_t zeGraphGetPrimaryCommandListExtPrologue( ze_graph_handle_t hGraph, ze_command_list_handle_t* phCommandList ) override; + ze_result_t zeGraphSetDestructionCallbackExtPrologue( ze_graph_handle_t hGraph, zex_mem_graph_free_callback_fn_t pfnCallback, void* pUserData, const void* pNext ) override; + ze_result_t zeGraphInstantiateExtPrologue( ze_graph_handle_t hGraph, const void* pNext, ze_executable_graph_handle_t* phExecutableGraph ) override; + ze_result_t zeCommandListAppendGraphExtPrologue( ze_command_list_handle_t hCommandList, ze_executable_graph_handle_t hGraph, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeExecutableGraphGetSourceGraphExtPrologue( ze_executable_graph_handle_t hGraph, ze_graph_handle_t* phSourceGraph ) override; + ze_result_t zeGraphIsEmptyExtPrologue( ze_graph_handle_t hGraph ) override; + 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 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; // 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 7c9126e3..f0142297 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp @@ -1903,20 +1903,6 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZESHandleLifetimeValidation::zesDevicePciLinkSpeedUpdateExtPrologue( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - - if ( !context.handleLifetime->isHandleValid( hDevice )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - return ZE_RESULT_SUCCESS; - } - ze_result_t ZESHandleLifetimeValidation::zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, ///< [in] Power domain handle instance. uint32_t* pCount, ///< [in,out] Pointer to the number of power limit descriptors. If count is @@ -2352,4 +2338,18 @@ namespace validation_layer } return ZE_RESULT_SUCCESS; } + ze_result_t + ZESHandleLifetimeValidation::zesDevicePciLinkSpeedUpdateExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } } \ No newline at end of file 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 0f964941..a485b546 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h @@ -147,7 +147,6 @@ namespace validation_layer ze_result_t zesTemperatureGetConfigPrologue( zes_temp_handle_t hTemperature, zes_temp_config_t* pConfig ) override; ze_result_t zesTemperatureSetConfigPrologue( zes_temp_handle_t hTemperature, const zes_temp_config_t* pConfig ) override; ze_result_t zesTemperatureGetStatePrologue( zes_temp_handle_t hTemperature, double* pTemperature ) override; - ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override; ze_result_t zesPowerGetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) override; ze_result_t zesPowerSetLimitsExtPrologue( zes_pwr_handle_t hPower, uint32_t* pCount, zes_power_limit_ext_desc_t* pSustained ) override; ze_result_t zesPowerGetLimitsExt2Prologue( zes_pwr_handle_t hPower, uint32_t* pLimit ) override; @@ -174,6 +173,7 @@ namespace validation_layer ze_result_t zesVFManagementGetVFMemoryUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_mem_exp2_t* pMemUtil ) override; 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; }; } diff --git a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp index 8175d712..874207f1 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -659,243 +659,272 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetDeviceGetConcurrentMetricGroupsExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + ZETHandleLifetimeValidation::zetMetricGroupCalculateMultipleMetricValuesExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerCreateExpPrologue( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + ZETHandleLifetimeValidation::zetMetricGroupGetGlobalTimestampsExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { - if ( !context.handleLifetime->isHandleValid( hContext )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if ( !context.handleLifetime->isHandleValid( hDevice )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - for (size_t i = 0; ( nullptr != phMetricGroups) && (i < metricGroupCount ); ++i){ - if (!context.handleLifetime->isHandleValid( phMetricGroups[i] )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - } - if (hNotificationEvent && !context.handleLifetime->isHandleValid( hNotificationEvent )){ + if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerDestroyExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + ZETHandleLifetimeValidation::zetMetricGroupGetExportDataExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { - if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ + if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerEnableExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + ZETHandleLifetimeValidation::zetMetricGroupCalculateMetricExportDataExpPrologue( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { - if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ + if ( !context.handleLifetime->isHandleValid( hDriver )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerDisableExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. + ZETHandleLifetimeValidation::zetMetricProgrammableGetExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { - if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerReadDataExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + ZETHandleLifetimeValidation::zetMetricProgrammableGetPropertiesExpPrologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { - if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ + if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricDecoderCreateExpPrologue( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + ZETHandleLifetimeValidation::zetMetricProgrammableGetParamInfoExpPrologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { - if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ + if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricDecoderDestroyExpPrologue( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + ZETHandleLifetimeValidation::zetMetricProgrammableGetParamValueInfoExpPrologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { - if ( !context.handleLifetime->isHandleValid( phMetricDecoder )){ + if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricDecoderGetDecodableMetricsExpPrologue( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + ZETHandleLifetimeValidation::zetMetricCreateFromProgrammableExp2Prologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { - if ( !context.handleLifetime->isHandleValid( hMetricDecoder )){ + if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricTracerDecodeExpPrologue( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + ZETHandleLifetimeValidation::zetMetricCreateFromProgrammableExpPrologue( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { - if ( !context.handleLifetime->isHandleValid( phMetricDecoder )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - for (size_t i = 0; ( nullptr != phMetrics) && (i < metricsCount); ++i){ - if (!context.handleLifetime->isHandleValid( phMetrics[i] )){ + if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetCommandListAppendMarkerExpPrologue( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + ZETHandleLifetimeValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { - 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( hMetricGroup )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetDeviceEnableMetricsExpPrologue( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ZETHandleLifetimeValidation::zetMetricGroupCreateExpPrologue( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { @@ -905,57 +934,45 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetDeviceDisableMetricsExpPrologue( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + ZETHandleLifetimeValidation::zetMetricGroupAddMetricExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hMetric )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupCalculateMultipleMetricValuesExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + ZETHandleLifetimeValidation::zetMetricGroupRemoveMetricExpPrologue( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } + if ( !context.handleLifetime->isHandleValid( hMetric )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupGetGlobalTimestampsExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + ZETHandleLifetimeValidation::zetMetricGroupCloseExpPrologue( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { @@ -965,16 +982,8 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupGetExportDataExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + ZETHandleLifetimeValidation::zetMetricGroupDestroyExpPrologue( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { @@ -984,278 +993,269 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupCalculateMetricExportDataExpPrologue( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + ZETHandleLifetimeValidation::zetMetricDestroyExpPrologue( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { - if ( !context.handleLifetime->isHandleValid( hDriver )){ + if ( !context.handleLifetime->isHandleValid( hMetric )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricProgrammableGetExpPrologue( + ZETHandleLifetimeValidation::zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZETHandleLifetimeValidation::zetMetricTracerCreateExpPrologue( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { + if ( !context.handleLifetime->isHandleValid( hContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } + for (size_t i = 0; ( nullptr != phMetricGroups) && (i < metricGroupCount ); ++i){ + if (!context.handleLifetime->isHandleValid( phMetricGroups[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } + if (hNotificationEvent && !context.handleLifetime->isHandleValid( hNotificationEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricProgrammableGetPropertiesExpPrologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + ZETHandleLifetimeValidation::zetMetricTracerDestroyExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { - if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ + if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricProgrammableGetParamInfoExpPrologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + ZETHandleLifetimeValidation::zetMetricTracerEnableExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { - if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ + if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricProgrammableGetParamValueInfoExpPrologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + ZETHandleLifetimeValidation::zetMetricTracerDisableExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { - if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ + if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricCreateFromProgrammableExp2Prologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + ZETHandleLifetimeValidation::zetMetricTracerReadDataExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { - if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ + if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricCreateFromProgrammableExpPrologue( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + ZETHandleLifetimeValidation::zetMetricDecoderCreateExpPrologue( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { - if ( !context.handleLifetime->isHandleValid( hMetricProgrammable )){ + if ( !context.handleLifetime->isHandleValid( hMetricTracer )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + ZETHandleLifetimeValidation::zetMetricDecoderDestroyExpPrologue( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( phMetricDecoder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupCreateExpPrologue( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + ZETHandleLifetimeValidation::zetMetricDecoderGetDecodableMetricsExpPrologue( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { - if ( !context.handleLifetime->isHandleValid( hDevice )){ + if ( !context.handleLifetime->isHandleValid( hMetricDecoder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupAddMetricExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + ZETHandleLifetimeValidation::zetMetricTracerDecodeExpPrologue( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { - if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ + if ( !context.handleLifetime->isHandleValid( phMetricDecoder )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hMetric )){ + for (size_t i = 0; ( nullptr != phMetrics) && (i < metricsCount); ++i){ + if (!context.handleLifetime->isHandleValid( phMetrics[i] )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupRemoveMetricExpPrologue( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + ZETHandleLifetimeValidation::zetCommandListAppendMarkerExpPrologue( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { - if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ + if ( !context.handleLifetime->isHandleValid( hCommandList )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } - if ( !context.handleLifetime->isHandleValid( hMetric )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; } - return ZE_RESULT_SUCCESS; - } - ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupCloseExpPrologue( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group - ) - { - if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricGroupDestroyExpPrologue( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + ZETHandleLifetimeValidation::zetDeviceEnableMetricsExpPrologue( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { - if ( !context.handleLifetime->isHandleValid( hMetricGroup )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; } ze_result_t - ZETHandleLifetimeValidation::zetMetricDestroyExpPrologue( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + ZETHandleLifetimeValidation::zetDeviceDisableMetricsExpPrologue( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { - if ( !context.handleLifetime->isHandleValid( hMetric )){ + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } return ZE_RESULT_SUCCESS; diff --git a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h index 43a7f90d..4fba1a3e 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h @@ -58,19 +58,6 @@ namespace validation_layer ze_result_t zetTracerExpSetProloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override; ze_result_t zetTracerExpSetEpiloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override; ze_result_t zetTracerExpSetEnabledPrologue( zet_tracer_exp_handle_t hTracer, ze_bool_t enable ) override; - ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override; - ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override; - ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override; - ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; - ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; - ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override; - ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override; - ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override; - ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override; - ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override; - ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override; - ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override; - ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) override; ze_result_t zetMetricGroupCalculateMultipleMetricValuesExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pSetCount, uint32_t* pTotalMetricValueCount, uint32_t* pMetricCounts, zet_typed_value_t* pMetricValues ) override; ze_result_t zetMetricGroupGetGlobalTimestampsExpPrologue( zet_metric_group_handle_t hMetricGroup, ze_bool_t synchronizedWithHost, uint64_t* globalTimestamp, uint64_t* metricTimestamp ) override; ze_result_t zetMetricGroupGetExportDataExpPrologue( zet_metric_group_handle_t hMetricGroup, const uint8_t* pRawData, size_t rawDataSize, size_t* pExportDataSize, uint8_t * pExportData ) override; @@ -88,6 +75,19 @@ namespace validation_layer ze_result_t zetMetricGroupCloseExpPrologue( zet_metric_group_handle_t hMetricGroup ) override; ze_result_t zetMetricGroupDestroyExpPrologue( zet_metric_group_handle_t hMetricGroup ) override; ze_result_t zetMetricDestroyExpPrologue( zet_metric_handle_t hMetric ) override; + ze_result_t zetDeviceGetConcurrentMetricGroupsExpPrologue( zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t * phMetricGroups, uint32_t * pMetricGroupsCountPerConcurrentGroup, uint32_t * pConcurrentGroupCount ) override; + ze_result_t zetMetricTracerCreateExpPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t metricGroupCount, zet_metric_group_handle_t* phMetricGroups, zet_metric_tracer_exp_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_tracer_exp_handle_t* phMetricTracer ) override; + ze_result_t zetMetricTracerDestroyExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer ) override; + ze_result_t zetMetricTracerEnableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; + ze_result_t zetMetricTracerDisableExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, ze_bool_t synchronous ) override; + ze_result_t zetMetricTracerReadDataExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, size_t* pRawDataSize, uint8_t* pRawData ) override; + ze_result_t zetMetricDecoderCreateExpPrologue( zet_metric_tracer_exp_handle_t hMetricTracer, zet_metric_decoder_exp_handle_t* phMetricDecoder ) override; + ze_result_t zetMetricDecoderDestroyExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder ) override; + ze_result_t zetMetricDecoderGetDecodableMetricsExpPrologue( zet_metric_decoder_exp_handle_t hMetricDecoder, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override; + ze_result_t zetMetricTracerDecodeExpPrologue( zet_metric_decoder_exp_handle_t phMetricDecoder, size_t* pRawDataSize, uint8_t* pRawData, uint32_t metricsCount, zet_metric_handle_t* phMetrics, uint32_t* pSetCount, uint32_t* pMetricEntriesCountPerSet, uint32_t* pMetricEntriesCount, zet_metric_entry_exp_t* pMetricEntries ) override; + ze_result_t zetCommandListAppendMarkerExpPrologue( zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value ) override; + ze_result_t zetDeviceEnableMetricsExpPrologue( zet_device_handle_t hDevice ) override; + ze_result_t zetDeviceDisableMetricsExpPrologue( zet_device_handle_t hDevice ) override; }; } diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 6f5eab85..0777508f 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -5722,11 +5722,14 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelGetBinaryExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReserveCacheExt( ze_result_t result, - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5734,28 +5737,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeKernelGetBinaryExp("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceReserveCacheExt("; - oss << "hKernel="; - oss << loader::to_string(hKernel); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "pSize="; - oss << loader::to_string(pSize); + oss << "cacheLevel="; + oss << loader::to_string(cacheLevel); oss << ", "; - oss << "pKernelBinary="; - oss << loader::to_string(pKernelBinary); + oss << "cacheReservationSize="; + oss << loader::to_string(cacheReservationSize); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceImportExternalSemaphoreExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceSetCacheAdviceExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5763,31 +5767,39 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceImportExternalSemaphoreExt("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceSetCacheAdviceExt("; oss << "hDevice="; oss << loader::to_string(hDevice); oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "ptr="; + oss << loader::to_string(ptr); oss << ", "; - oss << "phSemaphore="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phSemaphore != nullptr) { - oss << loader::to_string(*phSemaphore); - } else { - oss << loader::to_string(phSemaphore); - } + oss << "regionSize="; + oss << loader::to_string(regionSize); + + oss << ", "; + oss << "cacheRegion="; + oss << loader::to_string(cacheRegion); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryTimestampsExp( ze_result_t result, - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5795,28 +5807,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceReleaseExternalSemaphoreExt("; + oss << status << " (" << loader::to_string(result) << ") in zeEventQueryTimestampsExp("; - oss << "hSemaphore="; - oss << loader::to_string(hSemaphore); + oss << "hEvent="; + oss << loader::to_string(hEvent); + + oss << ", "; + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "pTimestamps="; + oss << loader::to_string(pTimestamps); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetMemoryPropertiesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5824,52 +5839,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendSignalExternalSemaphoreExt("; - - - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - - oss << ", "; - oss << "numSemaphores="; - oss << loader::to_string(numSemaphores); - - oss << ", "; - oss << "phSemaphores="; - oss << loader::to_string(phSemaphores); - - oss << ", "; - oss << "signalParams="; - oss << loader::to_string(signalParams); + oss << status << " (" << loader::to_string(result) << ") in zeImageGetMemoryPropertiesExp("; - oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); - oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "hImage="; + oss << loader::to_string(hImage); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "pMemoryProperties="; + oss << loader::to_string(pMemoryProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5877,44 +5866,43 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendWaitExternalSemaphoreExt("; - - - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExt("; - oss << ", "; - oss << "numSemaphores="; - oss << loader::to_string(numSemaphores); - oss << ", "; - oss << "phSemaphores="; - oss << loader::to_string(phSemaphores); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "waitParams="; - oss << loader::to_string(waitParams); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "desc="; + oss << loader::to_string(desc); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "hImage="; + oss << loader::to_string(hImage); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "phImageView="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { + oss << loader::to_string(*phImageView); + } else { + oss << loader::to_string(phImageView); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExp( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5922,33 +5910,40 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExt("; + oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExp("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pDescriptor="; - oss << loader::to_string(pDescriptor); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "phBuilder="; + oss << "desc="; + oss << loader::to_string(desc); + + oss << ", "; + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "phImageView="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { - oss << loader::to_string(*phBuilder); + if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { + oss << loader::to_string(*phImageView); } else { - oss << loader::to_string(phBuilder); + oss << loader::to_string(phImageView); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelSchedulingHintExp( ze_result_t result, - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5956,28 +5951,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeKernelSchedulingHintExp("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); + oss << "hKernel="; + oss << loader::to_string(hKernel); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "pHint="; + oss << loader::to_string(pHint); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDevicePciGetPropertiesExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -5985,38 +5975,34 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDriverRTASFormatCompatibilityCheckExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeDevicePciGetPropertiesExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); - oss << ", "; - oss << "rtasFormatA="; - oss << loader::to_string(rtasFormatA); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "rtasFormatB="; - oss << loader::to_string(rtasFormatB); + oss << "pPciProperties="; + oss << loader::to_string(pPciProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt( ze_result_t result, - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6024,64 +6010,57 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderBuildExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyToMemoryExt("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pScratchBuffer="; - oss << loader::to_string(pScratchBuffer); + oss << "dstptr="; + oss << loader::to_string(dstptr); oss << ", "; - oss << "scratchBufferSizeBytes="; - oss << loader::to_string(scratchBufferSizeBytes); + oss << "hSrcImage="; + oss << loader::to_string(hSrcImage); oss << ", "; - oss << "pRtasBuffer="; - oss << loader::to_string(pRtasBuffer); + oss << "pSrcRegion="; + oss << loader::to_string(pSrcRegion); oss << ", "; - oss << "rtasBufferSizeBytes="; - oss << loader::to_string(rtasBufferSizeBytes); + oss << "destRowPitch="; + oss << loader::to_string(destRowPitch); oss << ", "; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "destSlicePitch="; + oss << loader::to_string(destSlicePitch); oss << ", "; - oss << "pBuildUserPtr="; - oss << loader::to_string(pBuildUserPtr); + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); oss << ", "; - oss << "pBounds="; - oss << loader::to_string(pBounds); + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); oss << ", "; - oss << "pRtasBufferSizeBytes="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { - oss << loader::to_string(*pRtasBufferSizeBytes); - } else { - oss << loader::to_string(pRtasBufferSizeBytes); - } + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt( ze_result_t result, ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -6094,23 +6073,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCommandListAppendCopyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyFromMemoryExt("; oss << "hCommandList="; oss << loader::to_string(hCommandList); oss << ", "; - oss << "dstptr="; - oss << loader::to_string(dstptr); + oss << "hDstImage="; + oss << loader::to_string(hDstImage); oss << ", "; oss << "srcptr="; oss << loader::to_string(srcptr); oss << ", "; - oss << "size="; - oss << loader::to_string(size); + oss << "pDstRegion="; + oss << loader::to_string(pDstRegion); + + oss << ", "; + oss << "srcRowPitch="; + oss << loader::to_string(srcRowPitch); + + oss << ", "; + oss << "srcSlicePitch="; + oss << loader::to_string(srcSlicePitch); oss << ", "; oss << "hSignalEvent="; @@ -6127,9 +6114,11 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetAllocPropertiesExt( ze_result_t result, - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6137,19 +6126,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeImageGetAllocPropertiesExt("; - oss << "hBuilder="; - oss << loader::to_string(hBuilder); + oss << "hContext="; + oss << loader::to_string(hContext); + + oss << ", "; + oss << "hImage="; + oss << loader::to_string(hImage); + + oss << ", "; + oss << "pImageAllocProperties="; + oss << loader::to_string(pImageAllocProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeModuleInspectLinkageExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6157,28 +6158,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationCreateExt("; + oss << status << " (" << loader::to_string(result) << ") in zeModuleInspectLinkageExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "pInspectDesc="; + oss << loader::to_string(pInspectDesc); oss << ", "; - oss << "phParallelOperation="; + oss << "numModules="; + oss << loader::to_string(numModules); + + oss << ", "; + oss << "phModules="; + oss << loader::to_string(phModules); + + oss << ", "; + oss << "phLog="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { - oss << loader::to_string(*phParallelOperation); + if (result == ZE_RESULT_SUCCESS && phLog != nullptr) { + oss << loader::to_string(*phLog); } else { - oss << loader::to_string(phParallelOperation); + oss << loader::to_string(phLog); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemFreeExt( ze_result_t result, - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6186,22 +6196,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationGetPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeMemFreeExt("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "pMemFreeDesc="; + oss << loader::to_string(pMemFreeDesc); + + oss << ", "; + oss << "ptr="; + oss << loader::to_string(ptr); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetExp( ze_result_t result, - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6209,18 +6232,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationJoinExt("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetExp("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phVertices="; + oss << loader::to_string(phVertices); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetSubVerticesExp( ze_result_t result, - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6228,27 +6268,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationDestroyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetSubVerticesExp("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hVertex="; + oss << loader::to_string(hVertex); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phSubvertices="; + oss << loader::to_string(phSubvertices); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetPropertiesExp( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6256,36 +6296,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetVectorWidthPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetPropertiesExp("; - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "hVertex="; + oss << loader::to_string(hVertex); oss << ", "; - oss << "pVectorWidthProperties="; - oss << loader::to_string(pVectorWidthProperties); + oss << "pVertexProperties="; + oss << loader::to_string(pVertexProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelGetAllocationPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetDeviceExp( ze_result_t result, - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6293,29 +6320,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeKernelGetAllocationPropertiesExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetDeviceExp("; - oss << "hKernel="; - oss << loader::to_string(hKernel); - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "hVertex="; + oss << loader::to_string(hVertex); oss << ", "; - oss << "pAllocationProperties="; - oss << loader::to_string(pAllocationProperties); + 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_zeMemGetIpcHandleWithProperties( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetFabricVertexExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6323,38 +6349,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeMemGetIpcHandleWithProperties("; - - - oss << "hContext="; - oss << loader::to_string(hContext); + oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetFabricVertexExp("; - oss << ", "; - oss << "ptr="; - oss << loader::to_string(ptr); - oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "pIpcHandle="; + oss << "phVertex="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pIpcHandle != nullptr) { - oss << loader::to_string(*pIpcHandle); + if (result == ZE_RESULT_SUCCESS && phVertex != nullptr) { + oss << loader::to_string(*phVertex); } else { - oss << loader::to_string(pIpcHandle); + oss << loader::to_string(phVertex); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphCreateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6362,33 +6387,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphCreateExt("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetExp("; - oss << "hContext="; - oss << loader::to_string(hContext); + oss << "hVertexA="; + oss << loader::to_string(hVertexA); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "hVertexB="; + oss << loader::to_string(hVertexB); oss << ", "; - oss << "phGraph="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { - oss << loader::to_string(*phGraph); - } else { - oss << loader::to_string(phGraph); - } + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phEdges="; + oss << loader::to_string(phEdges); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginGraphCaptureExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetVerticesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6396,25 +6420,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginGraphCaptureExt("; + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetVerticesExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hEdge="; + oss << loader::to_string(hEdge); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "phVertexA="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phVertexA != nullptr) { + oss << loader::to_string(*phVertexA); + } else { + oss << loader::to_string(phVertexA); + } + + oss << ", "; + oss << "phVertexB="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phVertexB != nullptr) { + oss << loader::to_string(*phVertexB); + } else { + oss << loader::to_string(phVertexB); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetPropertiesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6422,26 +6458,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginCaptureIntoGraphExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetPropertiesExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "hEdge="; + oss << loader::to_string(hEdge); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "pEdgeProperties="; + oss << loader::to_string(pEdgeProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryKernelTimestampsExt( ze_result_t result, - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6449,21 +6497,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListIsGraphCaptureEnabledExt("; + oss << status << " (" << loader::to_string(result) << ") in zeEventQueryKernelTimestampsExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hEvent="; + oss << loader::to_string(hEvent); + + oss << ", "; + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "pResults="; + oss << loader::to_string(pResults); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListEndGraphCaptureExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6471,32 +6530,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListEndGraphCaptureExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "pDescriptor="; + oss << loader::to_string(pDescriptor); oss << ", "; - oss << "phGraph="; + oss << "phBuilder="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { - oss << loader::to_string(*phGraph); + if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { + oss << loader::to_string(*phBuilder); } else { - oss << loader::to_string(phGraph); + oss << loader::to_string(phBuilder); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetGraphExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6504,61 +6564,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetGraphExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ", "; - oss << "phGraph="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { - oss << loader::to_string(*phGraph); - } else { - oss << loader::to_string(phGraph); - } - oss << ")"; - context.logger->log_trace(oss.str()); - return result; - } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphGetPrimaryCommandListExt( - ze_result_t result, - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph -) { - // 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 zeGraphGetPrimaryCommandListExt("; - - - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); oss << ", "; - oss << "phCommandList="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phCommandList != nullptr) { - oss << loader::to_string(*phCommandList); - } else { - oss << loader::to_string(phCommandList); - } + oss << "pProperties="; + oss << loader::to_string(pProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphSetDestructionCallbackExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp( ze_result_t result, - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6566,33 +6593,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphSetDestructionCallbackExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeDriverRTASFormatCompatibilityCheckExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); - oss << ", "; - oss << "pfnCallback="; - oss << loader::to_string(pfnCallback); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "pUserData="; - oss << loader::to_string(pUserData); + oss << "rtasFormatA="; + oss << loader::to_string(rtasFormatA); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "rtasFormatB="; + oss << loader::to_string(rtasFormatB); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphInstantiateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExp( ze_result_t result, - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6600,79 +6632,59 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphInstantiateExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderBuildExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); oss << ", "; - oss << "phExecutableGraph="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phExecutableGraph != nullptr) { - oss << loader::to_string(*phExecutableGraph); - } else { - oss << loader::to_string(phExecutableGraph); - } - oss << ")"; - context.logger->log_trace(oss.str()); - return result; - } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendGraphExt( - ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching -) { - // 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 zeCommandListAppendGraphExt("; + oss << "pScratchBuffer="; + oss << loader::to_string(pScratchBuffer); + oss << ", "; + oss << "scratchBufferSizeBytes="; + oss << loader::to_string(scratchBufferSizeBytes); - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << ", "; + oss << "pRtasBuffer="; + oss << loader::to_string(pRtasBuffer); oss << ", "; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "rtasBufferSizeBytes="; + oss << loader::to_string(rtasBufferSizeBytes); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "pBuildUserPtr="; + oss << loader::to_string(pBuildUserPtr); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "pBounds="; + oss << loader::to_string(pBounds); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "pRtasBufferSizeBytes="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { + oss << loader::to_string(*pRtasBufferSizeBytes); + } else { + oss << loader::to_string(pRtasBufferSizeBytes); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphGetSourceGraphExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExp( ze_result_t result, - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6680,27 +6692,19 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphGetSourceGraphExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); - oss << ", "; - oss << "phSourceGraph="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phSourceGraph != nullptr) { - oss << loader::to_string(*phSourceGraph); - } else { - oss << loader::to_string(phSourceGraph); - } + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphIsEmptyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExp( ze_result_t result, - ze_graph_handle_t hGraph ///< [in] handle of the graph + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6708,21 +6712,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphIsEmptyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationCreateExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "phParallelOperation="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { + oss << loader::to_string(*phParallelOperation); + } else { + oss << loader::to_string(phParallelOperation); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDumpContentsExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp( ze_result_t result, - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6730,26 +6741,22 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphDumpContentsExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationGetPropertiesExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); - oss << ", "; - oss << "filePath="; - oss << loader::to_string(filePath); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "pProperties="; + oss << loader::to_string(pProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphDestroyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExp( ze_result_t result, - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6757,18 +6764,18 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphDestroyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationJoinExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDestroyExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExp( ze_result_t result, - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6776,28 +6783,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeGraphDestroyExt("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationDestroyExp("; - oss << "hGraph="; - oss << loader::to_string(hGraph); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendHostFunction( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemGetPitchFor2dImage( ze_result_t result, - 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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6805,47 +6807,44 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendHostFunction("; + oss << status << " (" << loader::to_string(result) << ") in zeMemGetPitchFor2dImage("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - - oss << ", "; - oss << "pfnHostFunction="; - oss << loader::to_string(pfnHostFunction); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pUserData="; - oss << loader::to_string(pUserData); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "pNext="; - oss << loader::to_string(pNext); + oss << "imageWidth="; + oss << loader::to_string(imageWidth); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "imageHeight="; + oss << loader::to_string(imageHeight); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "elementSizeInBytes="; + oss << loader::to_string(elementSizeInBytes); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "rowPitch="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && rowPitch != nullptr) { + oss << loader::to_string(*rowPitch); + } else { + oss << loader::to_string(rowPitch); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReserveCacheExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetDeviceOffsetExp( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6853,29 +6852,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceReserveCacheExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeImageGetDeviceOffsetExp("; - oss << "hDevice="; - oss << loader::to_string(hDevice); - oss << ", "; - oss << "cacheLevel="; - oss << loader::to_string(cacheLevel); + oss << "hImage="; + oss << loader::to_string(hImage); oss << ", "; - oss << "cacheReservationSize="; - oss << loader::to_string(cacheReservationSize); + oss << "pDeviceOffset="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pDeviceOffset != nullptr) { + oss << loader::to_string(*pDeviceOffset); + } else { + oss << loader::to_string(pDeviceOffset); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceSetCacheAdviceExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListCreateCloneExp( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6883,39 +6881,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceSetCacheAdviceExt("; - - - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << status << " (" << loader::to_string(result) << ") in zeCommandListCreateCloneExp("; - oss << ", "; - oss << "ptr="; - oss << loader::to_string(ptr); - oss << ", "; - oss << "regionSize="; - oss << loader::to_string(regionSize); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "cacheRegion="; - oss << loader::to_string(cacheRegion); + oss << "phClonedCommandList="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phClonedCommandList != nullptr) { + oss << loader::to_string(*phClonedCommandList); + } else { + oss << loader::to_string(phClonedCommandList); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryTimestampsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp( ze_result_t result, - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6923,31 +6920,50 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeEventQueryTimestampsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsExp("; - oss << "hEvent="; - oss << loader::to_string(hEvent); + oss << "hCommandListImmediate="; + oss << loader::to_string(hCommandListImmediate); oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "numCommandLists="; + oss << loader::to_string(numCommandLists); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "phCommandLists="; + oss << loader::to_string(phCommandLists); oss << ", "; - oss << "pTimestamps="; - oss << loader::to_string(pTimestamps); + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetMemoryPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters( ze_result_t result, - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6955,26 +6971,44 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetMemoryPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsWithParameters("; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "hCommandListImmediate="; + oss << loader::to_string(hCommandListImmediate); oss << ", "; - oss << "pMemoryProperties="; - oss << loader::to_string(pMemoryProperties); + oss << "numCommandLists="; + oss << loader::to_string(numCommandLists); + + oss << ", "; + oss << "phCommandLists="; + oss << loader::to_string(phCommandLists); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -6982,43 +7016,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdExp("; - oss << "hContext="; - oss << loader::to_string(hContext); - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; oss << "desc="; oss << loader::to_string(desc); oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); - - oss << ", "; - oss << "phImageView="; + oss << "pCommandId="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { - oss << loader::to_string(*phImageView); + if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { + oss << loader::to_string(*pCommandId); } else { - oss << loader::to_string(phImageView); + oss << loader::to_string(pCommandId); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageViewCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7026,40 +7054,46 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageViewCreateExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdWithKernelsExp("; - oss << "hContext="; - oss << loader::to_string(hContext); - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; oss << "desc="; - oss << loader::to_string(desc); + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && desc != nullptr) { + oss << loader::to_string(*desc); + } else { + oss << loader::to_string(desc); + } oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "numKernels="; + oss << loader::to_string(numKernels); oss << ", "; - oss << "phImageView="; + oss << "phKernels="; + oss << loader::to_string(phKernels); + + oss << ", "; + oss << "pCommandId="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phImageView != nullptr) { - oss << loader::to_string(*phImageView); + if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { + oss << loader::to_string(*pCommandId); } else { - oss << loader::to_string(phImageView); + oss << loader::to_string(pCommandId); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelSchedulingHintExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandsExp( ze_result_t result, - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7067,23 +7101,24 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeKernelSchedulingHintExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandsExp("; - oss << "hKernel="; - oss << loader::to_string(hKernel); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pHint="; - oss << loader::to_string(pHint); + oss << "desc="; + oss << loader::to_string(desc); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDevicePciGetPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsMutableExp( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7091,34 +7126,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDevicePciGetPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListIsMutableExp("; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pPciProperties="; - oss << loader::to_string(pPciProperties); + oss << "pIsMutable="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pIsMutable != nullptr) { + oss << loader::to_string(*pIsMutable); + } else { + oss << loader::to_string(pIsMutable); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7126,60 +7156,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyToMemoryExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandSignalEventExp("; oss << "hCommandList="; oss << loader::to_string(hCommandList); oss << ", "; - oss << "dstptr="; - oss << loader::to_string(dstptr); - - oss << ", "; - oss << "hSrcImage="; - oss << loader::to_string(hSrcImage); - - oss << ", "; - oss << "pSrcRegion="; - oss << loader::to_string(pSrcRegion); - - oss << ", "; - oss << "destRowPitch="; - oss << loader::to_string(destRowPitch); - - oss << ", "; - oss << "destSlicePitch="; - oss << loader::to_string(destSlicePitch); + oss << "commandId="; + oss << loader::to_string(commandId); oss << ", "; oss << "hSignalEvent="; oss << loader::to_string(hSignalEvent); - - oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); - - oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait ///< on before launching ) { @@ -7189,35 +7187,15 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendImageCopyFromMemoryExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandWaitEventsExp("; oss << "hCommandList="; oss << loader::to_string(hCommandList); oss << ", "; - oss << "hDstImage="; - oss << loader::to_string(hDstImage); - - oss << ", "; - oss << "srcptr="; - oss << loader::to_string(srcptr); - - oss << ", "; - oss << "pDstRegion="; - oss << loader::to_string(pDstRegion); - - oss << ", "; - oss << "srcRowPitch="; - oss << loader::to_string(srcRowPitch); - - oss << ", "; - oss << "srcSlicePitch="; - oss << loader::to_string(srcSlicePitch); - - oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "commandId="; + oss << loader::to_string(commandId); oss << ", "; oss << "numWaitEvents="; @@ -7230,11 +7208,13 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetAllocPropertiesExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7242,31 +7222,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetAllocPropertiesExt("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandKernelsExp("; - oss << "hContext="; - oss << loader::to_string(hContext); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "numKernels="; + oss << loader::to_string(numKernels); oss << ", "; - oss << "pImageAllocProperties="; - oss << loader::to_string(pImageAllocProperties); + oss << "pCommandId="; + oss << loader::to_string(pCommandId); + + oss << ", "; + oss << "phKernels="; + oss << loader::to_string(phKernels); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeModuleInspectLinkageExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelGetBinaryExp( ze_result_t result, - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7274,37 +7255,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeModuleInspectLinkageExt("; - + oss << status << " (" << loader::to_string(result) << ") in zeKernelGetBinaryExp("; - oss << "pInspectDesc="; - oss << loader::to_string(pInspectDesc); - oss << ", "; - oss << "numModules="; - oss << loader::to_string(numModules); + oss << "hKernel="; + oss << loader::to_string(hKernel); oss << ", "; - oss << "phModules="; - oss << loader::to_string(phModules); + oss << "pSize="; + oss << loader::to_string(pSize); oss << ", "; - oss << "phLog="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phLog != nullptr) { - oss << loader::to_string(*phLog); - } else { - oss << loader::to_string(phLog); - } + oss << "pKernelBinary="; + oss << loader::to_string(pKernelBinary); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemFreeExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceImportExternalSemaphoreExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7312,35 +7284,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeMemFreeExt("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceImportExternalSemaphoreExt("; - oss << "hContext="; - oss << loader::to_string(hContext); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "pMemFreeDesc="; - oss << loader::to_string(pMemFreeDesc); + oss << "desc="; + oss << loader::to_string(desc); oss << ", "; - oss << "ptr="; - oss << loader::to_string(ptr); + oss << "phSemaphore="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phSemaphore != nullptr) { + oss << loader::to_string(*phSemaphore); + } else { + oss << loader::to_string(phSemaphore); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7348,35 +7316,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetExp("; - - - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << status << " (" << loader::to_string(result) << ") in zeDeviceReleaseExternalSemaphoreExt("; - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); - oss << ", "; - oss << "phVertices="; - oss << loader::to_string(phVertices); + oss << "hSemaphore="; + oss << loader::to_string(hSemaphore); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetSubVerticesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7384,27 +7345,52 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetSubVerticesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendSignalExternalSemaphoreExt("; - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "numSemaphores="; + oss << loader::to_string(numSemaphores); oss << ", "; - oss << "phSubvertices="; - oss << loader::to_string(phSubvertices); + oss << "phSemaphores="; + oss << loader::to_string(phSemaphores); + + oss << ", "; + oss << "signalParams="; + oss << loader::to_string(signalParams); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7412,23 +7398,44 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendWaitExternalSemaphoreExt("; - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pVertexProperties="; - oss << loader::to_string(pVertexProperties); + oss << "numSemaphores="; + oss << loader::to_string(numSemaphores); + + oss << ", "; + oss << "phSemaphores="; + oss << loader::to_string(phSemaphores); + + oss << ", "; + oss << "waitParams="; + oss << loader::to_string(waitParams); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); + + oss << ", "; + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricVertexGetDeviceExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7436,28 +7443,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricVertexGetDeviceExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExt("; - oss << "hVertex="; - oss << loader::to_string(hVertex); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "phDevice="; + oss << "pDescriptor="; + oss << loader::to_string(pDescriptor); + + oss << ", "; + oss << "phBuilder="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phDevice != nullptr) { - oss << loader::to_string(*phDevice); + if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { + oss << loader::to_string(*phBuilder); } else { - oss << loader::to_string(phDevice); + oss << loader::to_string(phBuilder); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetFabricVertexExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt( ze_result_t result, - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7465,37 +7477,137 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetFabricVertexExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExt("; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ", "; - oss << "phVertex="; + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); + + oss << ", "; + oss << "pProperties="; + oss << loader::to_string(pProperties); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt( + ze_result_t result, + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B +) { + // 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 zeDriverRTASFormatCompatibilityCheckExt("; + + + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "rtasFormatA="; + oss << loader::to_string(rtasFormatA); + + oss << ", "; + oss << "rtasFormatB="; + oss << loader::to_string(rtasFormatB); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExt( + ze_result_t result, + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes +) { + // 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 zeRTASBuilderBuildExt("; + + + oss << "hBuilder="; + oss << loader::to_string(hBuilder); + + oss << ", "; + oss << "pBuildOpDescriptor="; + oss << loader::to_string(pBuildOpDescriptor); + + oss << ", "; + oss << "pScratchBuffer="; + oss << loader::to_string(pScratchBuffer); + + oss << ", "; + oss << "scratchBufferSizeBytes="; + oss << loader::to_string(scratchBufferSizeBytes); + + oss << ", "; + oss << "pRtasBuffer="; + oss << loader::to_string(pRtasBuffer); + + oss << ", "; + oss << "rtasBufferSizeBytes="; + oss << loader::to_string(rtasBufferSizeBytes); + + oss << ", "; + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); + + oss << ", "; + oss << "pBuildUserPtr="; + oss << loader::to_string(pBuildUserPtr); + + oss << ", "; + oss << "pBounds="; + oss << loader::to_string(pBounds); + + oss << ", "; + oss << "pRtasBufferSizeBytes="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertex != nullptr) { - oss << loader::to_string(*phVertex); + if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { + oss << loader::to_string(*pRtasBufferSizeBytes); } else { - oss << loader::to_string(phVertex); + oss << loader::to_string(pRtasBufferSizeBytes); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt( ze_result_t result, - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7503,32 +7615,42 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCommandListAppendCopyExt("; - oss << "hVertexA="; - oss << loader::to_string(hVertexA); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "hVertexB="; - oss << loader::to_string(hVertexB); + oss << "dstptr="; + oss << loader::to_string(dstptr); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "srcptr="; + oss << loader::to_string(srcptr); + + oss << ", "; + oss << "size="; + oss << loader::to_string(size); + + oss << ", "; + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); + + oss << ", "; + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); oss << ", "; - oss << "phEdges="; - oss << loader::to_string(phEdges); + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetVerticesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExt( ze_result_t result, - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7536,37 +7658,19 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetVerticesExp("; - - - oss << "hEdge="; - oss << loader::to_string(hEdge); + oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExt("; - oss << ", "; - oss << "phVertexA="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertexA != nullptr) { - oss << loader::to_string(*phVertexA); - } else { - oss << loader::to_string(phVertexA); - } - oss << ", "; - oss << "phVertexB="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phVertexB != nullptr) { - oss << loader::to_string(*phVertexB); - } else { - oss << loader::to_string(phVertexB); - } + oss << "hBuilder="; + oss << loader::to_string(hBuilder); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeFabricEdgeGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExt( ze_result_t result, - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7574,38 +7678,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeFabricEdgeGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationCreateExt("; - oss << "hEdge="; - oss << loader::to_string(hEdge); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "pEdgeProperties="; - oss << loader::to_string(pEdgeProperties); + oss << "phParallelOperation="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { + oss << loader::to_string(*phParallelOperation); + } else { + oss << loader::to_string(phParallelOperation); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeEventQueryKernelTimestampsExt( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt( ze_result_t result, - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7613,32 +7707,22 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeEventQueryKernelTimestampsExt("; - - - oss << "hEvent="; - oss << loader::to_string(hEvent); + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationGetPropertiesExt("; - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); - oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ", "; - oss << "pResults="; - oss << loader::to_string(pResults); + oss << "pProperties="; + oss << loader::to_string(pProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7646,33 +7730,18 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderCreateExp("; - - - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationJoinExt("; - oss << ", "; - oss << "pDescriptor="; - oss << loader::to_string(pDescriptor); - oss << ", "; - oss << "phBuilder="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phBuilder != nullptr) { - oss << loader::to_string(*phBuilder); - } else { - oss << loader::to_string(phBuilder); - } + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExt( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7680,28 +7749,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderGetBuildPropertiesExp("; - - - oss << "hBuilder="; - oss << loader::to_string(hBuilder); + oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationDestroyExt("; - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); - oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "hParallelOperation="; + oss << loader::to_string(hParallelOperation); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7709,38 +7777,36 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeDriverRTASFormatCompatibilityCheckExp("; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetVectorWidthPropertiesExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "rtasFormatA="; - oss << loader::to_string(rtasFormatA); + oss << "pCount="; + oss << loader::to_string(pCount); oss << ", "; - oss << "rtasFormatB="; - oss << loader::to_string(rtasFormatB); + oss << "pVectorWidthProperties="; + oss << loader::to_string(pVectorWidthProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderBuildExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelGetAllocationPropertiesExp( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7748,59 +7814,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderBuildExp("; - - - oss << "hBuilder="; - oss << loader::to_string(hBuilder); - - oss << ", "; - oss << "pBuildOpDescriptor="; - oss << loader::to_string(pBuildOpDescriptor); - - oss << ", "; - oss << "pScratchBuffer="; - oss << loader::to_string(pScratchBuffer); - - oss << ", "; - oss << "scratchBufferSizeBytes="; - oss << loader::to_string(scratchBufferSizeBytes); - - oss << ", "; - oss << "pRtasBuffer="; - oss << loader::to_string(pRtasBuffer); - - oss << ", "; - oss << "rtasBufferSizeBytes="; - oss << loader::to_string(rtasBufferSizeBytes); + oss << status << " (" << loader::to_string(result) << ") in zeKernelGetAllocationPropertiesExp("; - oss << ", "; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); - oss << ", "; - oss << "pBuildUserPtr="; - oss << loader::to_string(pBuildUserPtr); + oss << "hKernel="; + oss << loader::to_string(hKernel); oss << ", "; - oss << "pBounds="; - oss << loader::to_string(pBounds); + oss << "pCount="; + oss << loader::to_string(pCount); oss << ", "; - oss << "pRtasBufferSizeBytes="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pRtasBufferSizeBytes != nullptr) { - oss << loader::to_string(*pRtasBufferSizeBytes); - } else { - oss << loader::to_string(pRtasBufferSizeBytes); - } + oss << "pAllocationProperties="; + oss << loader::to_string(pAllocationProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASBuilderDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemGetIpcHandleWithProperties( ze_result_t result, - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7808,19 +7844,38 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASBuilderDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zeMemGetIpcHandleWithProperties("; + + + oss << "hContext="; + oss << loader::to_string(hContext); + oss << ", "; + oss << "ptr="; + oss << loader::to_string(ptr); - oss << "hBuilder="; - oss << loader::to_string(hBuilder); + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "pIpcHandle="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pIpcHandle != nullptr) { + oss << loader::to_string(*pIpcHandle); + } else { + oss << loader::to_string(pIpcHandle); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphCreateExt( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7828,28 +7883,33 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationCreateExp("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphCreateExt("; - oss << "hDriver="; - oss << loader::to_string(hDriver); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "phParallelOperation="; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "phGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phParallelOperation != nullptr) { - oss << loader::to_string(*phParallelOperation); + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); } else { - oss << loader::to_string(phParallelOperation); + oss << loader::to_string(phGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginGraphCaptureExt( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7857,22 +7917,25 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginGraphCaptureExt("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationJoinExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7880,18 +7943,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationJoinExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListBeginCaptureIntoGraphExt("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "hGraph="; + oss << loader::to_string(hGraph); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeRTASParallelOperationDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt( ze_result_t result, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7899,23 +7970,21 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeRTASParallelOperationDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListIsGraphCaptureEnabledExt("; - oss << "hParallelOperation="; - oss << loader::to_string(hParallelOperation); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeMemGetPitchFor2dImage( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListEndGraphCaptureExt( ze_result_t result, - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7923,44 +7992,32 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeMemGetPitchFor2dImage("; - - - oss << "hContext="; - oss << loader::to_string(hContext); - - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << status << " (" << loader::to_string(result) << ") in zeCommandListEndGraphCaptureExt("; - oss << ", "; - oss << "imageWidth="; - oss << loader::to_string(imageWidth); - oss << ", "; - oss << "imageHeight="; - oss << loader::to_string(imageHeight); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "elementSizeInBytes="; - oss << loader::to_string(elementSizeInBytes); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "rowPitch="; + oss << "phGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && rowPitch != nullptr) { - oss << loader::to_string(*rowPitch); + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); } else { - oss << loader::to_string(rowPitch); + oss << loader::to_string(phGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeImageGetDeviceOffsetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetGraphExt( ze_result_t result, - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7968,28 +8025,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeImageGetDeviceOffsetExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetGraphExt("; - oss << "hImage="; - oss << loader::to_string(hImage); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "pDeviceOffset="; + oss << "phGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pDeviceOffset != nullptr) { - oss << loader::to_string(*pDeviceOffset); + if (result == ZE_RESULT_SUCCESS && phGraph != nullptr) { + oss << loader::to_string(*phGraph); } else { - oss << loader::to_string(pDeviceOffset); + oss << loader::to_string(phGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListCreateCloneExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphGetPrimaryCommandListExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -7997,38 +8055,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListCreateCloneExp("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphGetPrimaryCommandListExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "phClonedCommandList="; + oss << "phCommandList="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phClonedCommandList != nullptr) { - oss << loader::to_string(*phClonedCommandList); + if (result == ZE_RESULT_SUCCESS && phCommandList != nullptr) { + oss << loader::to_string(*phCommandList); } else { - oss << loader::to_string(phClonedCommandList); + oss << loader::to_string(phCommandList); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphSetDestructionCallbackExt( ze_result_t result, - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8036,50 +8087,73 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphSetDestructionCallbackExt("; - oss << "hCommandListImmediate="; - oss << loader::to_string(hCommandListImmediate); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "numCommandLists="; - oss << loader::to_string(numCommandLists); + oss << "pfnCallback="; + oss << loader::to_string(pfnCallback); oss << ", "; - oss << "phCommandLists="; - oss << loader::to_string(phCommandLists); + oss << "pUserData="; + oss << loader::to_string(pUserData); oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "pNext="; + oss << loader::to_string(pNext); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphInstantiateExt( + ze_result_t result, + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph +) { + // 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 zeGraphInstantiateExt("; + + + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); + oss << "phExecutableGraph="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phExecutableGraph != nullptr) { + oss << loader::to_string(*phExecutableGraph); + } else { + oss << loader::to_string(phExecutableGraph); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendGraphExt( ze_result_t result, - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ///< on before launching ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8087,19 +8161,15 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListImmediateAppendCommandListsWithParameters("; - + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendGraphExt("; - oss << "hCommandListImmediate="; - oss << loader::to_string(hCommandListImmediate); - oss << ", "; - oss << "numCommandLists="; - oss << loader::to_string(numCommandLists); + oss << "hCommandList="; + oss << loader::to_string(hCommandList); oss << ", "; - oss << "phCommandLists="; - oss << loader::to_string(phCommandLists); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; oss << "pNext="; @@ -8120,11 +8190,10 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphGetSourceGraphExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8132,37 +8201,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphGetSourceGraphExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "pCommandId="; + oss << "phSourceGraph="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { - oss << loader::to_string(*pCommandId); + if (result == ZE_RESULT_SUCCESS && phSourceGraph != nullptr) { + oss << loader::to_string(*phSourceGraph); } else { - oss << loader::to_string(pCommandId); + oss << loader::to_string(phSourceGraph); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphIsEmptyExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8170,46 +8229,21 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListGetNextCommandIdWithKernelsExp("; - - - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - - oss << ", "; - oss << "desc="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && desc != nullptr) { - oss << loader::to_string(*desc); - } else { - oss << loader::to_string(desc); - } - - oss << ", "; - oss << "numKernels="; - oss << loader::to_string(numKernels); + oss << status << " (" << loader::to_string(result) << ") in zeGraphIsEmptyExt("; - oss << ", "; - oss << "phKernels="; - oss << loader::to_string(phKernels); - oss << ", "; - oss << "pCommandId="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pCommandId != nullptr) { - oss << loader::to_string(*pCommandId); - } else { - oss << loader::to_string(pCommandId); - } + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDumpContentsExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8217,24 +8251,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeGraphDumpContentsExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "filePath="; + oss << loader::to_string(filePath); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListIsMutableExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeExecutableGraphDestroyExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8242,29 +8278,18 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListIsMutableExp("; - + oss << status << " (" << loader::to_string(result) << ") in zeExecutableGraphDestroyExt("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); - oss << ", "; - oss << "pIsMutable="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pIsMutable != nullptr) { - oss << loader::to_string(*pIsMutable); - } else { - oss << loader::to_string(pIsMutable); - } + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphDestroyExt( ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -8272,28 +8297,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandSignalEventExp("; - - - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << status << " (" << loader::to_string(result) << ") in zeGraphDestroyExt("; - oss << ", "; - oss << "commandId="; - oss << loader::to_string(commandId); - oss << ", "; - oss << "hSignalEvent="; - oss << loader::to_string(hSignalEvent); + oss << "hGraph="; + oss << loader::to_string(hGraph); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendHostFunction( ze_result_t result, ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait ///< on before launching ) { @@ -8303,58 +8326,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zeCommandListUpdateMutableCommandWaitEventsExp("; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendHostFunction("; oss << "hCommandList="; oss << loader::to_string(hCommandList); oss << ", "; - oss << "commandId="; - oss << loader::to_string(commandId); + oss << "pfnHostFunction="; + oss << loader::to_string(pfnHostFunction); oss << ", "; - oss << "numWaitEvents="; - oss << loader::to_string(numWaitEvents); + oss << "pUserData="; + oss << loader::to_string(pUserData); oss << ", "; - oss << "phWaitEvents="; - oss << loader::to_string(phWaitEvents); - oss << ")"; - context.logger->log_trace(oss.str()); - return result; - } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp( - ze_result_t result, - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to -) { - // 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 zeCommandListUpdateMutableCommandKernelsExp("; - - - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + oss << "pNext="; + oss << loader::to_string(pNext); oss << ", "; - oss << "numKernels="; - oss << loader::to_string(numKernels); + oss << "hSignalEvent="; + oss << loader::to_string(hSignalEvent); oss << ", "; - oss << "pCommandId="; - oss << loader::to_string(pCommandId); + oss << "numWaitEvents="; + oss << loader::to_string(numWaitEvents); oss << ", "; - oss << "phKernels="; - oss << loader::to_string(phKernels); + oss << "phWaitEvents="; + oss << loader::to_string(phWaitEvents); oss << ")"; context.logger->log_trace(oss.str()); return result; @@ -16190,25 +16190,28 @@ namespace validation_layer } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { - context.logger->log_trace("zeKernelGetBinaryExp(hKernel, pSize, pKernelBinary)"); + context.logger->log_trace("zeDeviceReserveCacheExt(hDevice, cacheLevel, cacheReservationSize)"); - auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; + auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; - if( nullptr == pfnGetBinaryExp ) - return logAndPropagateResult_zeKernelGetBinaryExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pKernelBinary); + if( nullptr == pfnReserveCacheExt ) + return logAndPropagateResult_zeDeviceReserveCacheExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, cacheLevel, cacheReservationSize); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReserveCacheExtPrologue( hDevice, cacheLevel, cacheReservationSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); } @@ -16218,44 +16221,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReserveCacheExtPrologue( hDevice, cacheLevel, cacheReservationSize ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); } - auto driver_result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + auto driver_result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpEpilogue( hKernel, pSize, pKernelBinary ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReserveCacheExtEpilogue( hDevice, cacheLevel, cacheReservationSize ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeKernelGetBinaryExp(driver_result, hKernel, pSize, pKernelBinary); + return logAndPropagateResult_zeDeviceReserveCacheExt(driver_result, hDevice, cacheLevel, cacheReservationSize); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeDeviceSetCacheAdviceExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { - context.logger->log_trace("zeDeviceImportExternalSemaphoreExt(hDevice, desc, phSemaphore)"); + context.logger->log_trace("zeDeviceSetCacheAdviceExt(hDevice, ptr, regionSize, cacheRegion)"); - auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; + auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; - if( nullptr == pfnImportExternalSemaphoreExt ) - return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, phSemaphore); + if( nullptr == pfnSetCacheAdviceExt ) + return logAndPropagateResult_zeDeviceSetCacheAdviceExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, ptr, regionSize, cacheRegion); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceSetCacheAdviceExtPrologue( hDevice, ptr, regionSize, cacheRegion ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); } @@ -16265,38 +16265,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceSetCacheAdviceExtPrologue( hDevice, ptr, regionSize, cacheRegion ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); } - auto driver_result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + auto driver_result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtEpilogue( hDevice, desc, phSemaphore ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceSetCacheAdviceExtEpilogue( hDevice, ptr, regionSize, cacheRegion ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); } - return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(driver_result, hDevice, desc, phSemaphore); + return logAndPropagateResult_zeDeviceSetCacheAdviceExt(driver_result, hDevice, ptr, regionSize, cacheRegion); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeEventQueryTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { - context.logger->log_trace("zeDeviceReleaseExternalSemaphoreExt(hSemaphore)"); + context.logger->log_trace("zeEventQueryTimestampsExp(hEvent, hDevice, pCount, pTimestamps)"); - auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; + auto pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnReleaseExternalSemaphoreExt ) - return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSemaphore); + if( nullptr == pfnQueryTimestampsExp ) + return logAndPropagateResult_zeEventQueryTimestampsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, hDevice, pCount, pTimestamps); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryTimestampsExpPrologue( hEvent, hDevice, pCount, pTimestamps ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); } @@ -16306,48 +16315,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryTimestampsExpPrologue( hEvent, hDevice, pCount, pTimestamps ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); } - auto driver_result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + auto driver_result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtEpilogue( hSemaphore ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryTimestampsExpEpilogue( hEvent, hDevice, pCount, pTimestamps ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); } - return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(driver_result, hSemaphore); + return logAndPropagateResult_zeEventQueryTimestampsExp(driver_result, hEvent, hDevice, pCount, pTimestamps); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeImageGetMemoryPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { - context.logger->log_trace("zeCommandListAppendSignalExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeImageGetMemoryPropertiesExp(hImage, pMemoryProperties)"); - auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; + auto pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) - return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnGetMemoryPropertiesExp ) + return logAndPropagateResult_zeImageGetMemoryPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage, pMemoryProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetMemoryPropertiesExpPrologue( hImage, pMemoryProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); } @@ -16357,48 +16357,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeImageGetMemoryPropertiesExpPrologue( hImage, pMemoryProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); } - auto driver_result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetMemoryPropertiesExpEpilogue( hImage, pMemoryProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); } - return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeImageGetMemoryPropertiesExp(driver_result, hImage, pMemoryProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeImageViewCreateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - context.logger->log_trace("zeCommandListAppendWaitExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeImageViewCreateExt(hContext, hDevice, desc, hImage, phImageView)"); - auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; + auto pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) - return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnViewCreateExt ) + return logAndPropagateResult_zeImageViewCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, hImage, phImageView); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExtPrologue( hContext, hDevice, desc, hImage, phImageView ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); } @@ -16408,40 +16406,51 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeImageViewCreateExtPrologue( hContext, hDevice, desc, hImage, phImageView ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); } - auto driver_result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExtEpilogue( hContext, hDevice, desc, hImage, phImageView ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); } - return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phImageView){ + context.handleLifetime->addHandle( *phImageView ); + context.handleLifetime->addDependent( hContext, *phImageView ); + + } + } + return logAndPropagateResult_zeImageViewCreateExt(driver_result, hContext, hDevice, desc, hImage, phImageView); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeImageViewCreateExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); + context.logger->log_trace("zeImageViewCreateExp(hContext, hDevice, desc, hImage, phImageView)"); - auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + auto pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; - if( nullptr == pfnCreateExt ) - return logAndPropagateResult_zeRTASBuilderCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); + if( nullptr == pfnViewCreateExp ) + return logAndPropagateResult_zeImageViewCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, hImage, phImageView); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExpPrologue( hContext, hDevice, desc, hImage, phImageView ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); } @@ -16451,49 +16460,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeImageViewCreateExpPrologue( hContext, hDevice, desc, hImage, phImageView ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); } - auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + auto driver_result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExpEpilogue( hContext, hDevice, desc, hImage, phImageView ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phBuilder){ - context.handleLifetime->addHandle( *phBuilder ); - context.handleLifetime->addDependent( hDriver, *phBuilder ); + if (phImageView){ + context.handleLifetime->addHandle( *phImageView ); + context.handleLifetime->addDependent( hContext, *phImageView ); } } - return logAndPropagateResult_zeRTASBuilderCreateExt(driver_result, hDriver, pDescriptor, phBuilder); + return logAndPropagateResult_zeImageViewCreateExp(driver_result, hContext, hDevice, desc, hImage, phImageView); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeKernelSchedulingHintExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { - context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); + context.logger->log_trace("zeKernelSchedulingHintExp(hKernel, pHint)"); - auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + auto pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; - if( nullptr == pfnGetBuildPropertiesExt ) - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); + if( nullptr == pfnSchedulingHintExp ) + return logAndPropagateResult_zeKernelSchedulingHintExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pHint); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSchedulingHintExpPrologue( hKernel, pHint ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); } @@ -16503,40 +16511,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelSchedulingHintExpPrologue( hKernel, pHint ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); } - auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + auto driver_result = pfnSchedulingHintExp( hKernel, pHint ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeKernelSchedulingHintExpEpilogue( hKernel, pHint ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); } - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(driver_result, hBuilder, pBuildOpDescriptor, pProperties); + return logAndPropagateResult_zeKernelSchedulingHintExp(driver_result, hKernel, pHint); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeDevicePciGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { - context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); + context.logger->log_trace("zeDevicePciGetPropertiesExt(hDevice, pPciProperties)"); - auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + auto pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); + if( nullptr == pfnPciGetPropertiesExt ) + return logAndPropagateResult_zeDevicePciGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pPciProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeDevicePciGetPropertiesExtPrologue( hDevice, pPciProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); } @@ -16546,50 +16553,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.handleLifetime->zeHandleLifetime.zeDevicePciGetPropertiesExtPrologue( hDevice, pPciProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); } - auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + auto driver_result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeDevicePciGetPropertiesExtEpilogue( hDevice, pPciProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); } - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(driver_result, hDriver, rtasFormatA, rtasFormatB); + return logAndPropagateResult_zeDevicePciGetPropertiesExt(driver_result, hDevice, pPciProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); + context.logger->log_trace("zeCommandListAppendImageCopyToMemoryExt(hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + auto pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnBuildExt ) - return logAndPropagateResult_zeRTASBuilderBuildExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + if( nullptr == pfnAppendImageCopyToMemoryExt ) + return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryExtPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -16599,30 +16606,32 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyToMemoryExtPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + auto driver_result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryExtEpilogue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeRTASBuilderBuildExt(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(driver_result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -16630,17 +16639,17 @@ namespace validation_layer ///< on before launching ) { - context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListAppendImageCopyFromMemoryExt(hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + auto pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnCommandListAppendCopyExt ) - return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnAppendImageCopyFromMemoryExt ) + return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryExtPrologue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -16650,38 +16659,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyFromMemoryExtPrologue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryExtEpilogue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(driver_result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeImageGetAllocPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { - context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); + context.logger->log_trace("zeImageGetAllocPropertiesExt(hContext, hImage, pImageAllocProperties)"); - auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + auto pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeRTASBuilderDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); + if( nullptr == pfnGetAllocPropertiesExt ) + return logAndPropagateResult_zeImageGetAllocPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hImage, pImageAllocProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetAllocPropertiesExtPrologue( hContext, hImage, pImageAllocProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); } @@ -16691,39 +16702,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeImageGetAllocPropertiesExtPrologue( hContext, hImage, pImageAllocProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); } - auto driver_result = pfnDestroyExt( hBuilder ); + auto driver_result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtEpilogue( hBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetAllocPropertiesExtEpilogue( hContext, hImage, pImageAllocProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); } - return logAndPropagateResult_zeRTASBuilderDestroyExt(driver_result, hBuilder); + return logAndPropagateResult_zeImageGetAllocPropertiesExt(driver_result, hContext, hImage, pImageAllocProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt + /// @brief Intercept function for zeModuleInspectLinkageExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { - context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); + context.logger->log_trace("zeModuleInspectLinkageExt(pInspectDesc, numModules, phModulesLocal, phLog)"); - auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + auto pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; - if( nullptr == pfnCreateExt ) - return logAndPropagateResult_zeRTASParallelOperationCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); + if( nullptr == pfnInspectLinkageExt ) + return logAndPropagateResult_zeModuleInspectLinkageExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pInspectDesc, numModules, phModules, phLog); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeModuleInspectLinkageExtPrologue( pInspectDesc, numModules, phModules, phLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); } @@ -16733,48 +16748,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeModuleInspectLinkageExtPrologue( pInspectDesc, numModules, phModules, phLog ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); } - auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); + auto driver_result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtEpilogue( hDriver, phParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeModuleInspectLinkageExtEpilogue( pInspectDesc, numModules, phModules, phLog ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phParallelOperation){ - context.handleLifetime->addHandle( *phParallelOperation ); - context.handleLifetime->addDependent( hDriver, *phParallelOperation ); - - } - } - return logAndPropagateResult_zeRTASParallelOperationCreateExt(driver_result, hDriver, phParallelOperation); + return logAndPropagateResult_zeModuleInspectLinkageExt(driver_result, pInspectDesc, numModules, phModules, phLog); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeMemFreeExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { - context.logger->log_trace("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); + context.logger->log_trace("zeMemFreeExt(hContext, pMemFreeDesc, ptr)"); - auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + auto pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; - if( nullptr == pfnGetPropertiesExt ) - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); + if( nullptr == pfnFreeExt ) + return logAndPropagateResult_zeMemFreeExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pMemFreeDesc, ptr); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeMemFreeExtPrologue( hContext, pMemFreeDesc, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); } @@ -16784,38 +16791,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeMemFreeExtPrologue( hContext, pMemFreeDesc, ptr ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); } - auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + auto driver_result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtEpilogue( hParallelOperation, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeMemFreeExtEpilogue( hContext, pMemFreeDesc, ptr ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); } - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(driver_result, hParallelOperation, pProperties); + return logAndPropagateResult_zeMemFreeExt(driver_result, hContext, pMemFreeDesc, ptr); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeFabricVertexGetExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { - context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); + context.logger->log_trace("zeFabricVertexGetExp(hDriver, pCount, phVertices)"); - auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + auto pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; - if( nullptr == pfnJoinExt ) - return logAndPropagateResult_zeRTASParallelOperationJoinExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnGetExp ) + return logAndPropagateResult_zeFabricVertexGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, phVertices); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetExpPrologue( hDriver, pCount, phVertices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); } @@ -16825,38 +16841,57 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetExpPrologue( hDriver, pCount, phVertices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); } - auto driver_result = pfnJoinExt( hParallelOperation ); + auto driver_result = pfnGetExp( hDriver, pCount, phVertices ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetExpEpilogue( hDriver, pCount, phVertices ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); } - return logAndPropagateResult_zeRTASParallelOperationJoinExt(driver_result, hParallelOperation); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phVertices) && (i < *pCount); ++i){ + if (phVertices[i]){ + context.handleLifetime->addHandle( phVertices[i] ); + context.handleLifetime->addDependent( hDriver, phVertices[i] ); + } + } + } + return logAndPropagateResult_zeFabricVertexGetExp(driver_result, hDriver, pCount, phVertices); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { - context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); + context.logger->log_trace("zeFabricVertexGetSubVerticesExp(hVertex, pCount, phSubvertices)"); - auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + auto pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeRTASParallelOperationDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnGetSubVerticesExp ) + return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, pCount, phSubvertices); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetSubVerticesExpPrologue( hVertex, pCount, phSubvertices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); } @@ -16866,47 +16901,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetSubVerticesExpPrologue( hVertex, pCount, phSubvertices ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); } - auto driver_result = pfnDestroyExt( hParallelOperation ); + auto driver_result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetSubVerticesExpEpilogue( hVertex, pCount, phSubvertices ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); } - return logAndPropagateResult_zeRTASParallelOperationDestroyExt(driver_result, hParallelOperation); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phSubvertices) && (i < *pCount); ++i){ + if (phSubvertices[i]){ + context.handleLifetime->addHandle( phSubvertices[i] ); + context.handleLifetime->addDependent( hVertex, phSubvertices[i] ); + } + } + } + return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(driver_result, hVertex, pCount, phSubvertices); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeFabricVertexGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { - context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); + context.logger->log_trace("zeFabricVertexGetPropertiesExp(hVertex, pVertexProperties)"); - auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + auto pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; - if( nullptr == pfnGetVectorWidthPropertiesExt ) - return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pVectorWidthProperties); + if( nullptr == pfnGetPropertiesExp ) + return logAndPropagateResult_zeFabricVertexGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, pVertexProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetPropertiesExpPrologue( hVertex, pVertexProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); } @@ -16916,48 +16953,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetPropertiesExpPrologue( hVertex, pVertexProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); } - auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + auto driver_result = pfnGetPropertiesExp( hVertex, pVertexProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtEpilogue( hDevice, pCount, pVectorWidthProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetPropertiesExpEpilogue( hVertex, pVertexProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); } - return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(driver_result, hDevice, pCount, pVectorWidthProperties); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeFabricVertexGetPropertiesExp(driver_result, hVertex, pVertexProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeFabricVertexGetDeviceExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { - context.logger->log_trace("zeKernelGetAllocationPropertiesExp(hKernel, pCount, pAllocationProperties)"); + context.logger->log_trace("zeFabricVertexGetDeviceExp(hVertex, phDevice)"); - auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; + auto pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; - if( nullptr == pfnGetAllocationPropertiesExp ) - return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pCount, pAllocationProperties); + if( nullptr == pfnGetDeviceExp ) + return logAndPropagateResult_zeFabricVertexGetDeviceExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, phDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetDeviceExpPrologue( hVertex, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); } @@ -16967,45 +16999,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetDeviceExpPrologue( hVertex, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); } - auto driver_result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + auto driver_result = pfnGetDeviceExp( hVertex, phDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpEpilogue( hKernel, pCount, pAllocationProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); + auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetDeviceExpEpilogue( hVertex, phDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + if (phDevice){ + context.handleLifetime->addHandle( *phDevice ); + context.handleLifetime->addDependent( hVertex, *phDevice ); + + } } - return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(driver_result, hKernel, pCount, pAllocationProperties); + return logAndPropagateResult_zeFabricVertexGetDeviceExp(driver_result, hVertex, phDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeDeviceGetFabricVertexExp __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { - context.logger->log_trace("zeMemGetIpcHandleWithProperties(hContext, ptr, pNext, pIpcHandle)"); + context.logger->log_trace("zeDeviceGetFabricVertexExp(hDevice, phVertex)"); - auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; + auto pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; - if( nullptr == pfnGetIpcHandleWithProperties ) - return logAndPropagateResult_zeMemGetIpcHandleWithProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pNext, pIpcHandle); + if( nullptr == pfnGetFabricVertexExp ) + return logAndPropagateResult_zeDeviceGetFabricVertexExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, phVertex); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetFabricVertexExpPrologue( hDevice, phVertex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); } @@ -17015,41 +17050,57 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetFabricVertexExpPrologue( hDevice, phVertex ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); } - auto driver_result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + auto driver_result = pfnGetFabricVertexExp( hDevice, phVertex ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesEpilogue( hContext, ptr, pNext, pIpcHandle ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetFabricVertexExpEpilogue( hDevice, phVertex ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); } - return logAndPropagateResult_zeMemGetIpcHandleWithProperties(driver_result, hContext, ptr, pNext, pIpcHandle); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phVertex){ + context.handleLifetime->addHandle( *phVertex ); + context.handleLifetime->addDependent( hDevice, *phVertex ); + + } + } + return logAndPropagateResult_zeDeviceGetFabricVertexExp(driver_result, hDevice, phVertex); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphCreateExt + /// @brief Intercept function for zeFabricEdgeGetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { - context.logger->log_trace("zeGraphCreateExt(hContext, pNext, phGraph)"); + context.logger->log_trace("zeFabricEdgeGetExp(hVertexA, hVertexB, pCount, phEdges)"); - auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; + auto pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; - if( nullptr == pfnCreateExt ) - return logAndPropagateResult_zeGraphCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pNext, phGraph); + if( nullptr == pfnGetExp ) + return logAndPropagateResult_zeFabricEdgeGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertexA, hVertexB, pCount, phEdges); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtPrologue( hContext, pNext, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetExpPrologue( hVertexA, hVertexB, pCount, phEdges ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); } @@ -17059,49 +17110,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphCreateExtPrologue( hContext, pNext, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetExpPrologue( hVertexA, hVertexB, pCount, phEdges ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); } - auto driver_result = pfnCreateExt( hContext, pNext, phGraph ); + auto driver_result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtEpilogue( hContext, pNext, phGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetExpEpilogue( hVertexA, hVertexB, pCount, phEdges ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phGraph){ - context.handleLifetime->addHandle( *phGraph ); - context.handleLifetime->addDependent( hContext, *phGraph ); - + for (size_t i = 0; ( nullptr != phEdges) && (i < *pCount); ++i){ + if (phEdges[i]){ + context.handleLifetime->addHandle( phEdges[i] ); + context.handleLifetime->addDependent( hVertexA, phEdges[i] ); + } } } - return logAndPropagateResult_zeGraphCreateExt(driver_result, hContext, pNext, phGraph); + return logAndPropagateResult_zeFabricEdgeGetExp(driver_result, hVertexA, hVertexB, pCount, phEdges); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginGraphCaptureExt + /// @brief Intercept function for zeFabricEdgeGetVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { - context.logger->log_trace("zeCommandListBeginGraphCaptureExt(hCommandList, pNext)"); + context.logger->log_trace("zeFabricEdgeGetVerticesExp(hEdge, phVertexA, phVertexB)"); - auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; + auto pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; - if( nullptr == pfnBeginGraphCaptureExt ) - return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext); + if( nullptr == pfnGetVerticesExp ) + return logAndPropagateResult_zeFabricEdgeGetVerticesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEdge, phVertexA, phVertexB); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetVerticesExpPrologue( hEdge, phVertexA, phVertexB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); } @@ -17111,41 +17163,53 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetVerticesExpPrologue( hEdge, phVertexA, phVertexB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); } - auto driver_result = pfnBeginGraphCaptureExt( hCommandList, pNext ); + auto driver_result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtEpilogue( hCommandList, pNext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetVerticesExpEpilogue( hEdge, phVertexA, phVertexB ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); } - return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(driver_result, hCommandList, pNext); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phVertexA){ + context.handleLifetime->addHandle( *phVertexA ); + context.handleLifetime->addDependent( hEdge, *phVertexA ); + + } + if (phVertexB){ + context.handleLifetime->addHandle( *phVertexB ); + context.handleLifetime->addDependent( hEdge, *phVertexB ); + + } + } + return logAndPropagateResult_zeFabricEdgeGetVerticesExp(driver_result, hEdge, phVertexA, phVertexB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { - context.logger->log_trace("zeCommandListBeginCaptureIntoGraphExt(hCommandList, hGraph, pNext)"); + context.logger->log_trace("zeFabricEdgeGetPropertiesExp(hEdge, pEdgeProperties)"); - auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; + auto pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr == pfnBeginCaptureIntoGraphExt ) - return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext); + if( nullptr == pfnGetPropertiesExp ) + return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEdge, pEdgeProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetPropertiesExpPrologue( hEdge, pEdgeProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); } @@ -17155,38 +17219,58 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); + auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetPropertiesExpPrologue( hEdge, pEdgeProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); } - auto driver_result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + auto driver_result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtEpilogue( hCommandList, hGraph, pNext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetPropertiesExpEpilogue( hEdge, pEdgeProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); } - return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(driver_result, hCommandList, hGraph, pNext); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(driver_result, hEdge, pEdgeProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + /// @brief Intercept function for zeEventQueryKernelTimestampsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { - context.logger->log_trace("zeCommandListIsGraphCaptureEnabledExt(hCommandList)"); + context.logger->log_trace("zeEventQueryKernelTimestampsExt(hEvent, hDevice, pCount, pResults)"); - auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; + auto pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; - if( nullptr == pfnIsGraphCaptureEnabledExt ) - return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); + if( nullptr == pfnQueryKernelTimestampsExt ) + return logAndPropagateResult_zeEventQueryKernelTimestampsExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, hDevice, pCount, pResults); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampsExtPrologue( hEvent, hDevice, pCount, pResults ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); } @@ -17196,41 +17280,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryKernelTimestampsExtPrologue( hEvent, hDevice, pCount, pResults ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); } - auto driver_result = pfnIsGraphCaptureEnabledExt( hCommandList ); + auto driver_result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtEpilogue( hCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampsExtEpilogue( hEvent, hDevice, pCount, pResults ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); } - return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(driver_result, hCommandList); + return logAndPropagateResult_zeEventQueryKernelTimestampsExt(driver_result, hEvent, hDevice, pCount, pResults); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListEndGraphCaptureExt + /// @brief Intercept function for zeRTASBuilderCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { - context.logger->log_trace("zeCommandListEndGraphCaptureExt(hCommandList, pNext, phGraph)"); + context.logger->log_trace("zeRTASBuilderCreateExp(hDriver, pDescriptor, phBuilder)"); - auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; + auto pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; - if( nullptr == pfnEndGraphCaptureExt ) - return logAndPropagateResult_zeCommandListEndGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext, phGraph); + if( nullptr == pfnCreateExp ) + return logAndPropagateResult_zeRTASBuilderCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExpPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); } @@ -17240,39 +17323,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExpPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); } - auto driver_result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + auto driver_result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtEpilogue( hCommandList, pNext, phGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExpEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); } - return logAndPropagateResult_zeCommandListEndGraphCaptureExt(driver_result, hCommandList, pNext, phGraph); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phBuilder){ + context.handleLifetime->addHandle( *phBuilder ); + context.handleLifetime->addDependent( hDriver, *phBuilder ); + + } + } + return logAndPropagateResult_zeRTASBuilderCreateExp(driver_result, hDriver, pDescriptor, phBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetGraphExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { - context.logger->log_trace("zeCommandListGetGraphExt(hCommandList, phGraph)"); + context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExp(hBuilder, pBuildOpDescriptor, pProperties)"); - auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; + auto pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr == pfnGetGraphExt ) - return logAndPropagateResult_zeCommandListGetGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phGraph); + if( nullptr == pfnGetBuildPropertiesExp ) + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExpPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); } @@ -17282,40 +17375,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExpPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); } - auto driver_result = pfnGetGraphExt( hCommandList, phGraph ); + auto driver_result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtEpilogue( hCommandList, phGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExpEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); } - return logAndPropagateResult_zeCommandListGetGraphExt(driver_result, hCommandList, phGraph); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(driver_result, hBuilder, pBuildOpDescriptor, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { - context.logger->log_trace("zeGraphGetPrimaryCommandListExt(hGraph, phCommandList)"); + context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExp(hDriver, rtasFormatA, rtasFormatB)"); - auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; + auto pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnGetPrimaryCommandListExt ) - return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phCommandList); + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExpPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); } @@ -17325,42 +17422,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExpPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); } - auto driver_result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + auto driver_result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtEpilogue( hGraph, phCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExpEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); } - return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(driver_result, hGraph, phCommandList); + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(driver_result, hDriver, rtasFormatA, rtasFormatB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphSetDestructionCallbackExt + /// @brief Intercept function for zeRTASBuilderBuildExp __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - context.logger->log_trace("zeGraphSetDestructionCallbackExt(hGraph, pfnCallback, pUserData, pNext)"); + context.logger->log_trace("zeRTASBuilderBuildExp(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); - auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; + auto pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; - if( nullptr == pfnSetDestructionCallbackExt ) - return logAndPropagateResult_zeGraphSetDestructionCallbackExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pfnCallback, pUserData, pNext); + if( nullptr == pfnBuildExp ) + return logAndPropagateResult_zeRTASBuilderBuildExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExpPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } @@ -17370,41 +17475,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExpPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - auto driver_result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + auto driver_result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtEpilogue( hGraph, pfnCallback, pUserData, pNext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExpEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - return logAndPropagateResult_zeGraphSetDestructionCallbackExt(driver_result, hGraph, pfnCallback, pUserData, pNext); + return logAndPropagateResult_zeRTASBuilderBuildExp(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphInstantiateExt + /// @brief Intercept function for zeRTASBuilderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - context.logger->log_trace("zeGraphInstantiateExt(hGraph, pNext, phExecutableGraph)"); + context.logger->log_trace("zeRTASBuilderDestroyExp(hBuilder)"); - auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; + auto pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; - if( nullptr == pfnInstantiateExt ) - return logAndPropagateResult_zeGraphInstantiateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pNext, phExecutableGraph); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zeRTASBuilderDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExpPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); } @@ -17414,46 +17516,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExpPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); } - auto driver_result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + auto driver_result = pfnDestroyExp( hBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtEpilogue( hGraph, pNext, phExecutableGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExpEpilogue( hBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); } - return logAndPropagateResult_zeGraphInstantiateExt(driver_result, hGraph, pNext, phExecutableGraph); + return logAndPropagateResult_zeRTASBuilderDestroyExp(driver_result, hBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendGraphExt + /// @brief Intercept function for zeRTASParallelOperationCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - context.logger->log_trace("zeCommandListAppendGraphExt(hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeRTASParallelOperationCreateExp(hDriver, phParallelOperation)"); - auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; + auto pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; - if( nullptr == pfnAppendGraphExt ) - return logAndPropagateResult_zeCommandListAppendGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCreateExp ) + return logAndPropagateResult_zeRTASParallelOperationCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExpPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); } @@ -17463,39 +17558,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExpPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); } - auto driver_result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCreateExp( hDriver, phParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtEpilogue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExpEpilogue( hDriver, phParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); } - return logAndPropagateResult_zeCommandListAppendGraphExt(driver_result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phParallelOperation){ + context.handleLifetime->addHandle( *phParallelOperation ); + context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + + } + } + return logAndPropagateResult_zeRTASParallelOperationCreateExp(driver_result, hDriver, phParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - context.logger->log_trace("zeExecutableGraphGetSourceGraphExt(hGraph, phSourceGraph)"); + context.logger->log_trace("zeRTASParallelOperationGetPropertiesExp(hParallelOperation, pProperties)"); - auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; + auto pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr == pfnGetSourceGraphExt ) - return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phSourceGraph); + if( nullptr == pfnGetPropertiesExp ) + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExpPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); } @@ -17505,38 +17609,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExpPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); } - auto driver_result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + auto driver_result = pfnGetPropertiesExp( hParallelOperation, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtEpilogue( hGraph, phSourceGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExpEpilogue( hParallelOperation, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); } - return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(driver_result, hGraph, phSourceGraph); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(driver_result, hParallelOperation, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphIsEmptyExt + /// @brief Intercept function for zeRTASParallelOperationJoinExp __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - context.logger->log_trace("zeGraphIsEmptyExt(hGraph)"); + context.logger->log_trace("zeRTASParallelOperationJoinExp(hParallelOperation)"); - auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; + auto pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; - if( nullptr == pfnIsEmptyExt ) - return logAndPropagateResult_zeGraphIsEmptyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph); + if( nullptr == pfnJoinExp ) + return logAndPropagateResult_zeRTASParallelOperationJoinExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExpPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); } @@ -17546,41 +17654,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphIsEmptyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExpPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); } - auto driver_result = pfnIsEmptyExt( hGraph ); + auto driver_result = pfnJoinExp( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtEpilogue( hGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExpEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); } - return logAndPropagateResult_zeGraphIsEmptyExt(driver_result, hGraph); + return logAndPropagateResult_zeRTASParallelOperationJoinExp(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDumpContentsExt + /// @brief Intercept function for zeRTASParallelOperationDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - context.logger->log_trace("zeGraphDumpContentsExt(hGraph, filePath, pNext)"); + context.logger->log_trace("zeRTASParallelOperationDestroyExp(hParallelOperation)"); - auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; + auto pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; - if( nullptr == pfnDumpContentsExt ) - return logAndPropagateResult_zeGraphDumpContentsExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, filePath, pNext); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zeRTASParallelOperationDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExpPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); } @@ -17590,38 +17695,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExpPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); } - auto driver_result = pfnDumpContentsExt( hGraph, filePath, pNext ); + auto driver_result = pfnDestroyExp( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtEpilogue( hGraph, filePath, pNext ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExpEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); } - return logAndPropagateResult_zeGraphDumpContentsExt(driver_result, hGraph, filePath, pNext); + return logAndPropagateResult_zeRTASParallelOperationDestroyExp(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphDestroyExt + /// @brief Intercept function for zeMemGetPitchFor2dImage __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { - context.logger->log_trace("zeExecutableGraphDestroyExt(hGraph)"); + context.logger->log_trace("zeMemGetPitchFor2dImage(hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch)"); - auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; + auto pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeExecutableGraphDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph); + if( nullptr == pfnGetPitchFor2dImage ) + return logAndPropagateResult_zeMemGetPitchFor2dImage(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetPitchFor2dImagePrologue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); } @@ -17631,38 +17741,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphDestroyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetPitchFor2dImagePrologue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); } - auto driver_result = pfnDestroyExt( hGraph ); + auto driver_result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtEpilogue( hGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetPitchFor2dImageEpilogue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); } - return logAndPropagateResult_zeExecutableGraphDestroyExt(driver_result, hGraph); + return logAndPropagateResult_zeMemGetPitchFor2dImage(driver_result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDestroyExt + /// @brief Intercept function for zeImageGetDeviceOffsetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { - context.logger->log_trace("zeGraphDestroyExt(hGraph)"); + context.logger->log_trace("zeImageGetDeviceOffsetExp(hImage, pDeviceOffset)"); - auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; + auto pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult_zeGraphDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph); + if( nullptr == pfnGetDeviceOffsetExp ) + return logAndPropagateResult_zeImageGetDeviceOffsetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage, pDeviceOffset); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetDeviceOffsetExpPrologue( hImage, pDeviceOffset ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); } @@ -17672,48 +17783,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeGraphDestroyExtPrologue( hGraph ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); + auto result = context.handleLifetime->zeHandleLifetime.zeImageGetDeviceOffsetExpPrologue( hImage, pDeviceOffset ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); } - auto driver_result = pfnDestroyExt( hGraph ); + auto driver_result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtEpilogue( hGraph ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); + auto result = context.validationHandlers[i]->zeValidation->zeImageGetDeviceOffsetExpEpilogue( hImage, pDeviceOffset ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); } - return logAndPropagateResult_zeGraphDestroyExt(driver_result, hGraph); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeImageGetDeviceOffsetExp(driver_result, hImage, pDeviceOffset); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendHostFunction + /// @brief Intercept function for zeCommandListCreateCloneExp __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { - context.logger->log_trace("zeCommandListAppendHostFunction(hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListCreateCloneExp(hCommandList, phClonedCommandList)"); - auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; + auto pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; - if( nullptr == pfnAppendHostFunction ) - return logAndPropagateResult_zeCommandListAppendHostFunction(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnCreateCloneExp ) + return logAndPropagateResult_zeCommandListCreateCloneExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phClonedCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateCloneExpPrologue( hCommandList, phClonedCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); } @@ -17723,43 +17829,58 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreateCloneExpPrologue( hCommandList, phClonedCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); } - auto driver_result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionEpilogue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateCloneExpEpilogue( hCommandList, phClonedCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); } - return logAndPropagateResult_zeCommandListAppendHostFunction(driver_result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phClonedCommandList){ + context.handleLifetime->addHandle( *phClonedCommandList ); + context.handleLifetime->addDependent( hCommandList, *phClonedCommandList ); + + } + } + return logAndPropagateResult_zeCommandListCreateCloneExp(driver_result, hCommandList, phClonedCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - context.logger->log_trace("zeDeviceReserveCacheExt(hDevice, cacheLevel, cacheReservationSize)"); + context.logger->log_trace("zeCommandListImmediateAppendCommandListsExp(hCommandListImmediate, numCommandLists, phCommandListsLocal, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnReserveCacheExt = context.zeDdiTable.Device.pfnReserveCacheExt; + auto pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr == pfnReserveCacheExt ) - return logAndPropagateResult_zeDeviceReserveCacheExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, cacheLevel, cacheReservationSize); + if( nullptr == pfnImmediateAppendCommandListsExp ) + return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReserveCacheExtPrologue( hDevice, cacheLevel, cacheReservationSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsExpPrologue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -17769,41 +17890,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReserveCacheExtPrologue( hDevice, cacheLevel, cacheReservationSize ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateAppendCommandListsExpPrologue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + auto driver_result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceReserveCacheExtEpilogue( hDevice, cacheLevel, cacheReservationSize ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReserveCacheExt(result, hDevice, cacheLevel, cacheReservationSize); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsExpEpilogue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeDeviceReserveCacheExt(driver_result, hDevice, cacheLevel, cacheReservationSize); + return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(driver_result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { - context.logger->log_trace("zeDeviceSetCacheAdviceExt(hDevice, ptr, regionSize, cacheRegion)"); + context.logger->log_trace("zeCommandListImmediateAppendCommandListsWithParameters(hCommandListImmediate, numCommandLists, phCommandListsLocal, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnSetCacheAdviceExt = context.zeDdiTable.Device.pfnSetCacheAdviceExt; + auto pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnSetCacheAdviceExt ) - return logAndPropagateResult_zeDeviceSetCacheAdviceExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, ptr, regionSize, cacheRegion); + if( nullptr == pfnImmediateAppendCommandListsWithParameters ) + return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceSetCacheAdviceExtPrologue( hDevice, ptr, regionSize, cacheRegion ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsWithParametersPrologue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -17813,47 +17943,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceSetCacheAdviceExtPrologue( hDevice, ptr, regionSize, cacheRegion ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateAppendCommandListsWithParametersPrologue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + auto driver_result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceSetCacheAdviceExtEpilogue( hDevice, ptr, regionSize, cacheRegion ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceSetCacheAdviceExt(result, hDevice, ptr, regionSize, cacheRegion); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsWithParametersEpilogue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeDeviceSetCacheAdviceExt(driver_result, hDevice, ptr, regionSize, cacheRegion); + return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(driver_result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListGetNextCommandIdExp __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - context.logger->log_trace("zeEventQueryTimestampsExp(hEvent, hDevice, pCount, pTimestamps)"); + context.logger->log_trace("zeCommandListGetNextCommandIdExp(hCommandList, desc, pCommandId)"); - auto pfnQueryTimestampsExp = context.zeDdiTable.EventExp.pfnQueryTimestampsExp; + auto pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; - if( nullptr == pfnQueryTimestampsExp ) - return logAndPropagateResult_zeEventQueryTimestampsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, hDevice, pCount, pTimestamps); + if( nullptr == pfnGetNextCommandIdExp ) + return logAndPropagateResult_zeCommandListGetNextCommandIdExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc, pCommandId); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryTimestampsExpPrologue( hEvent, hDevice, pCount, pTimestamps ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdExpPrologue( hCommandList, desc, pCommandId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); } @@ -17863,39 +17986,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryTimestampsExpPrologue( hEvent, hDevice, pCount, pTimestamps ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetNextCommandIdExpPrologue( hCommandList, desc, pCommandId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); } - auto driver_result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + auto driver_result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryTimestampsExpEpilogue( hEvent, hDevice, pCount, pTimestamps ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryTimestampsExp(result, hEvent, hDevice, pCount, pTimestamps); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdExpEpilogue( hCommandList, desc, pCommandId ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); } - return logAndPropagateResult_zeEventQueryTimestampsExp(driver_result, hEvent, hDevice, pCount, pTimestamps); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeCommandListGetNextCommandIdExp(driver_result, hCommandList, desc, pCommandId); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - context.logger->log_trace("zeImageGetMemoryPropertiesExp(hImage, pMemoryProperties)"); + context.logger->log_trace("zeCommandListGetNextCommandIdWithKernelsExp(hCommandList, desc, numKernels, phKernelsLocal, pCommandId)"); - auto pfnGetMemoryPropertiesExp = context.zeDdiTable.ImageExp.pfnGetMemoryPropertiesExp; + auto pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetMemoryPropertiesExp ) - return logAndPropagateResult_zeImageGetMemoryPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage, pMemoryProperties); + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) + return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc, numKernels, phKernels, pCommandId); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetMemoryPropertiesExpPrologue( hImage, pMemoryProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdWithKernelsExpPrologue( hCommandList, desc, numKernels, phKernels, pCommandId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); } @@ -17905,46 +18037,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageGetMemoryPropertiesExpPrologue( hImage, pMemoryProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetNextCommandIdWithKernelsExpPrologue( hCommandList, desc, numKernels, phKernels, pCommandId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); } - auto driver_result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + auto driver_result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetMemoryPropertiesExpEpilogue( hImage, pMemoryProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetMemoryPropertiesExp(result, hImage, pMemoryProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdWithKernelsExpEpilogue( hCommandList, desc, numKernels, phKernels, pCommandId ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ } - return logAndPropagateResult_zeImageGetMemoryPropertiesExp(driver_result, hImage, pMemoryProperties); + return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(driver_result, hCommandList, desc, numKernels, phKernels, pCommandId); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { - context.logger->log_trace("zeImageViewCreateExt(hContext, hDevice, desc, hImage, phImageView)"); + context.logger->log_trace("zeCommandListUpdateMutableCommandsExp(hCommandList, desc)"); - auto pfnViewCreateExt = context.zeDdiTable.Image.pfnViewCreateExt; + auto pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr == pfnViewCreateExt ) - return logAndPropagateResult_zeImageViewCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, hImage, phImageView); + if( nullptr == pfnUpdateMutableCommandsExp ) + return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExtPrologue( hContext, hDevice, desc, hImage, phImageView ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandsExpPrologue( hCommandList, desc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); } @@ -17954,51 +18084,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageViewCreateExtPrologue( hContext, hDevice, desc, hImage, phImageView ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandsExpPrologue( hCommandList, desc ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); } - auto driver_result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + auto driver_result = pfnUpdateMutableCommandsExp( hCommandList, desc ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExtEpilogue( hContext, hDevice, desc, hImage, phImageView ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExt(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandsExpEpilogue( hCommandList, desc ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phImageView){ - context.handleLifetime->addHandle( *phImageView ); - context.handleLifetime->addDependent( hContext, *phImageView ); - - } - } - return logAndPropagateResult_zeImageViewCreateExt(driver_result, hContext, hDevice, desc, hImage, phImageView); + return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(driver_result, hCommandList, desc); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListIsMutableExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { - context.logger->log_trace("zeImageViewCreateExp(hContext, hDevice, desc, hImage, phImageView)"); + context.logger->log_trace("zeCommandListIsMutableExp(hCommandList, pIsMutable)"); - auto pfnViewCreateExp = context.zeDdiTable.ImageExp.pfnViewCreateExp; + auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; - if( nullptr == pfnViewCreateExp ) - return logAndPropagateResult_zeImageViewCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, desc, hImage, phImageView); + if( nullptr == pfnIsMutableExp ) + return logAndPropagateResult_zeCommandListIsMutableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pIsMutable); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExpPrologue( hContext, hDevice, desc, hImage, phImageView ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); } @@ -18008,48 +18127,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageViewCreateExpPrologue( hContext, hDevice, desc, hImage, phImageView ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); } - auto driver_result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + auto driver_result = pfnIsMutableExp( hCommandList, pIsMutable ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageViewCreateExpEpilogue( hContext, hDevice, desc, hImage, phImageView ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageViewCreateExp(result, hContext, hDevice, desc, hImage, phImageView); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpEpilogue( hCommandList, pIsMutable ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phImageView){ - context.handleLifetime->addHandle( *phImageView ); - context.handleLifetime->addDependent( hContext, *phImageView ); - - } - } - return logAndPropagateResult_zeImageViewCreateExp(driver_result, hContext, hDevice, desc, hImage, phImageView); + return logAndPropagateResult_zeCommandListIsMutableExp(driver_result, hCommandList, pIsMutable); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { - context.logger->log_trace("zeKernelSchedulingHintExp(hKernel, pHint)"); + context.logger->log_trace("zeCommandListUpdateMutableCommandSignalEventExp(hCommandList, commandId, hSignalEvent)"); - auto pfnSchedulingHintExp = context.zeDdiTable.KernelExp.pfnSchedulingHintExp; + auto pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnSchedulingHintExp ) - return logAndPropagateResult_zeKernelSchedulingHintExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pHint); + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) + return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, commandId, hSignalEvent); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSchedulingHintExpPrologue( hKernel, pHint ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandSignalEventExpPrologue( hCommandList, commandId, hSignalEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); } @@ -18059,39 +18170,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeKernelSchedulingHintExpPrologue( hKernel, pHint ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandSignalEventExpPrologue( hCommandList, commandId, hSignalEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); } - auto driver_result = pfnSchedulingHintExp( hKernel, pHint ); + auto driver_result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeKernelSchedulingHintExpEpilogue( hKernel, pHint ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelSchedulingHintExp(result, hKernel, pHint); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandSignalEventExpEpilogue( hCommandList, commandId, hSignalEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); } - return logAndPropagateResult_zeKernelSchedulingHintExp(driver_result, hKernel, pHint); + return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(driver_result, hCommandList, commandId, hSignalEvent); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDevicePciGetPropertiesExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeDevicePciGetPropertiesExt(hDevice, pPciProperties)"); + context.logger->log_trace("zeCommandListUpdateMutableCommandWaitEventsExp(hCommandList, commandId, numWaitEvents, phWaitEventsLocal)"); - auto pfnPciGetPropertiesExt = context.zeDdiTable.Device.pfnPciGetPropertiesExt; + auto pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnPciGetPropertiesExt ) - return logAndPropagateResult_zeDevicePciGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pPciProperties); + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) + return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, commandId, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDevicePciGetPropertiesExtPrologue( hDevice, pPciProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandWaitEventsExpPrologue( hCommandList, commandId, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); } @@ -18101,50 +18215,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDevicePciGetPropertiesExtPrologue( hDevice, pPciProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandWaitEventsExpPrologue( hCommandList, commandId, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); } - auto driver_result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); + auto driver_result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDevicePciGetPropertiesExtEpilogue( hDevice, pPciProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDevicePciGetPropertiesExt(result, hDevice, pPciProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandWaitEventsExpEpilogue( hCommandList, commandId, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeDevicePciGetPropertiesExt(driver_result, hDevice, pPciProperties); + return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(driver_result, hCommandList, commandId, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { - context.logger->log_trace("zeCommandListAppendImageCopyToMemoryExt(hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeCommandListUpdateMutableCommandKernelsExp(hCommandList, numKernels, pCommandId, phKernelsLocal)"); - auto pfnAppendImageCopyToMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt; + auto pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnAppendImageCopyToMemoryExt ) - return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnUpdateMutableCommandKernelsExp ) + return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numKernels, pCommandId, phKernels); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryExtPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandKernelsExpPrologue( hCommandList, numKernels, pCommandId, phKernels ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); } @@ -18154,50 +18260,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyToMemoryExtPrologue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandKernelsExpPrologue( hCommandList, numKernels, pCommandId, phKernels ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); } - auto driver_result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyToMemoryExtEpilogue( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandKernelsExpEpilogue( hCommandList, numKernels, pCommandId, phKernels ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); } - return logAndPropagateResult_zeCommandListAppendImageCopyToMemoryExt(driver_result, hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(driver_result, hCommandList, numKernels, pCommandId, phKernels); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { - context.logger->log_trace("zeCommandListAppendImageCopyFromMemoryExt(hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeKernelGetBinaryExp(hKernel, pSize, pKernelBinary)"); - auto pfnAppendImageCopyFromMemoryExt = context.zeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt; + auto pfnGetBinaryExp = context.zeDdiTable.KernelExp.pfnGetBinaryExp; - if( nullptr == pfnAppendImageCopyFromMemoryExt ) - return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnGetBinaryExp ) + return logAndPropagateResult_zeKernelGetBinaryExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pSize, pKernelBinary); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryExtPrologue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } @@ -18207,40 +18303,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendImageCopyFromMemoryExtPrologue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetBinaryExpPrologue( hKernel, pSize, pKernelBinary ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } - auto driver_result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendImageCopyFromMemoryExtEpilogue( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetBinaryExpEpilogue( hKernel, pSize, pKernelBinary ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetBinaryExp(result, hKernel, pSize, pKernelBinary); } - return logAndPropagateResult_zeCommandListAppendImageCopyFromMemoryExt(driver_result, hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeKernelGetBinaryExp(driver_result, hKernel, pSize, pKernelBinary); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetAllocPropertiesExt + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { - context.logger->log_trace("zeImageGetAllocPropertiesExt(hContext, hImage, pImageAllocProperties)"); + context.logger->log_trace("zeDeviceImportExternalSemaphoreExt(hDevice, desc, phSemaphore)"); - auto pfnGetAllocPropertiesExt = context.zeDdiTable.Image.pfnGetAllocPropertiesExt; + auto pfnImportExternalSemaphoreExt = context.zeDdiTable.Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnGetAllocPropertiesExt ) - return logAndPropagateResult_zeImageGetAllocPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hImage, pImageAllocProperties); + if( nullptr == pfnImportExternalSemaphoreExt ) + return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, desc, phSemaphore); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetAllocPropertiesExtPrologue( hContext, hImage, pImageAllocProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } @@ -18250,43 +18350,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageGetAllocPropertiesExtPrologue( hContext, hImage, pImageAllocProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceImportExternalSemaphoreExtPrologue( hDevice, desc, phSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } - auto driver_result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + auto driver_result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetAllocPropertiesExtEpilogue( hContext, hImage, pImageAllocProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetAllocPropertiesExt(result, hContext, hImage, pImageAllocProperties); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceImportExternalSemaphoreExtEpilogue( hDevice, desc, phSemaphore ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(result, hDevice, desc, phSemaphore); } - return logAndPropagateResult_zeImageGetAllocPropertiesExt(driver_result, hContext, hImage, pImageAllocProperties); + return logAndPropagateResult_zeDeviceImportExternalSemaphoreExt(driver_result, hDevice, desc, phSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleInspectLinkageExt + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { - context.logger->log_trace("zeModuleInspectLinkageExt(pInspectDesc, numModules, phModulesLocal, phLog)"); + context.logger->log_trace("zeDeviceReleaseExternalSemaphoreExt(hSemaphore)"); - auto pfnInspectLinkageExt = context.zeDdiTable.Module.pfnInspectLinkageExt; + auto pfnReleaseExternalSemaphoreExt = context.zeDdiTable.Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnInspectLinkageExt ) - return logAndPropagateResult_zeModuleInspectLinkageExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pInspectDesc, numModules, phModules, phLog); + if( nullptr == pfnReleaseExternalSemaphoreExt ) + return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hSemaphore); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleInspectLinkageExtPrologue( pInspectDesc, numModules, phModules, phLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } @@ -18296,40 +18391,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeModuleInspectLinkageExtPrologue( pInspectDesc, numModules, phModules, phLog ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceReleaseExternalSemaphoreExtPrologue( hSemaphore ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } - auto driver_result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + auto driver_result = pfnReleaseExternalSemaphoreExt( hSemaphore ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeModuleInspectLinkageExtEpilogue( pInspectDesc, numModules, phModules, phLog ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleInspectLinkageExt(result, pInspectDesc, numModules, phModules, phLog); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceReleaseExternalSemaphoreExtEpilogue( hSemaphore ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(result, hSemaphore); } - return logAndPropagateResult_zeModuleInspectLinkageExt(driver_result, pInspectDesc, numModules, phModules, phLog); + return logAndPropagateResult_zeDeviceReleaseExternalSemaphoreExt(driver_result, hSemaphore); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFreeExt + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeMemFreeExt(hContext, pMemFreeDesc, ptr)"); + context.logger->log_trace("zeCommandListAppendSignalExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnFreeExt = context.zeDdiTable.Mem.pfnFreeExt; + auto pfnAppendSignalExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnFreeExt ) - return logAndPropagateResult_zeMemFreeExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pMemFreeDesc, ptr); + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) + return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemFreeExtPrologue( hContext, pMemFreeDesc, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -18339,47 +18442,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemFreeExtPrologue( hContext, pMemFreeDesc, ptr ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); + auto driver_result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemFreeExtEpilogue( hContext, pMemFreeDesc, ptr ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemFreeExt(result, hContext, pMemFreeDesc, ptr); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeMemFreeExt(driver_result, hContext, pMemFreeDesc, ptr); + return logAndPropagateResult_zeCommandListAppendSignalExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetExp + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeFabricVertexGetExp(hDriver, pCount, phVertices)"); + context.logger->log_trace("zeCommandListAppendWaitExternalSemaphoreExt(hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetExp = context.zeDdiTable.FabricVertexExp.pfnGetExp; + auto pfnAppendWaitExternalSemaphoreExt = context.zeDdiTable.CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnGetExp ) - return logAndPropagateResult_zeFabricVertexGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pCount, phVertices); + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) + return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetExpPrologue( hDriver, pCount, phVertices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -18389,57 +18493,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetExpPrologue( hDriver, pCount, phVertices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitExternalSemaphoreExtPrologue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetExp( hDriver, pCount, phVertices ); + auto driver_result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetExpEpilogue( hDriver, pCount, phVertices ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetExp(result, hDriver, pCount, phVertices); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitExternalSemaphoreExtEpilogue( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phVertices) && (i < *pCount); ++i){ - if (phVertices[i]){ - context.handleLifetime->addHandle( phVertices[i] ); - context.handleLifetime->addDependent( hDriver, phVertices[i] ); - } - } - } - return logAndPropagateResult_zeFabricVertexGetExp(driver_result, hDriver, pCount, phVertices); + return logAndPropagateResult_zeCommandListAppendWaitExternalSemaphoreExt(driver_result, hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { - context.logger->log_trace("zeFabricVertexGetSubVerticesExp(hVertex, pCount, phSubvertices)"); + context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); - auto pfnGetSubVerticesExp = context.zeDdiTable.FabricVertexExp.pfnGetSubVerticesExp; + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - if( nullptr == pfnGetSubVerticesExp ) - return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, pCount, phSubvertices); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeRTASBuilderCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetSubVerticesExpPrologue( hVertex, pCount, phSubvertices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } @@ -18449,49 +18536,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetSubVerticesExpPrologue( hVertex, pCount, phSubvertices ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } - auto driver_result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetSubVerticesExpEpilogue( hVertex, pCount, phSubvertices ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(result, hVertex, pCount, phSubvertices); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExtEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExt(result, hDriver, pDescriptor, phBuilder); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - for (size_t i = 0; ( nullptr != phSubvertices) && (i < *pCount); ++i){ - if (phSubvertices[i]){ - context.handleLifetime->addHandle( phSubvertices[i] ); - context.handleLifetime->addDependent( hVertex, phSubvertices[i] ); - } + if (phBuilder){ + context.handleLifetime->addHandle( *phBuilder ); + context.handleLifetime->addDependent( hDriver, *phBuilder ); + } } - return logAndPropagateResult_zeFabricVertexGetSubVerticesExp(driver_result, hVertex, pCount, phSubvertices); + return logAndPropagateResult_zeRTASBuilderCreateExt(driver_result, hDriver, pDescriptor, phBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetPropertiesExp + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { - context.logger->log_trace("zeFabricVertexGetPropertiesExp(hVertex, pVertexProperties)"); + context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); - auto pfnGetPropertiesExp = context.zeDdiTable.FabricVertexExp.pfnGetPropertiesExp; + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetPropertiesExp ) - return logAndPropagateResult_zeFabricVertexGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, pVertexProperties); + if( nullptr == pfnGetBuildPropertiesExt ) + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetPropertiesExpPrologue( hVertex, pVertexProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } @@ -18501,43 +18588,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetPropertiesExpPrologue( hVertex, pVertexProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } - auto driver_result = pfnGetPropertiesExp( hVertex, pVertexProperties ); + auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetPropertiesExpEpilogue( hVertex, pVertexProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetPropertiesExp(result, hVertex, pVertexProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExtEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(result, hBuilder, pBuildOpDescriptor, pProperties); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeFabricVertexGetPropertiesExp(driver_result, hVertex, pVertexProperties); + return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExt(driver_result, hBuilder, pBuildOpDescriptor, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetDeviceExp - __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + __zedlllocal ze_result_t ZE_APICALL + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { - context.logger->log_trace("zeFabricVertexGetDeviceExp(hVertex, phDevice)"); + context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); - auto pfnGetDeviceExp = context.zeDdiTable.FabricVertexExp.pfnGetDeviceExp; + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnGetDeviceExp ) - return logAndPropagateResult_zeFabricVertexGetDeviceExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertex, phDevice); + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetDeviceExpPrologue( hVertex, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } @@ -18547,48 +18631,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricVertexGetDeviceExpPrologue( hVertex, phDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); + auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } - auto driver_result = pfnGetDeviceExp( hVertex, phDevice ); + auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricVertexGetDeviceExpEpilogue( hVertex, phDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricVertexGetDeviceExp(result, hVertex, phDevice); + auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExtEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(result, hDriver, rtasFormatA, rtasFormatB); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phDevice){ - context.handleLifetime->addHandle( *phDevice ); - context.handleLifetime->addDependent( hVertex, *phDevice ); - - } - } - return logAndPropagateResult_zeFabricVertexGetDeviceExp(driver_result, hVertex, phDevice); + return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExt(driver_result, hDriver, rtasFormatA, rtasFormatB); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetFabricVertexExp + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { - context.logger->log_trace("zeDeviceGetFabricVertexExp(hDevice, phVertex)"); + context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); - auto pfnGetFabricVertexExp = context.zeDdiTable.DeviceExp.pfnGetFabricVertexExp; + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - if( nullptr == pfnGetFabricVertexExp ) - return logAndPropagateResult_zeDeviceGetFabricVertexExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, phVertex); + if( nullptr == pfnBuildExt ) + return logAndPropagateResult_zeRTASBuilderBuildExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetFabricVertexExpPrologue( hDevice, phVertex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } @@ -18598,57 +18684,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetFabricVertexExpPrologue( hDevice, phVertex ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExtPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - auto driver_result = pfnGetFabricVertexExp( hDevice, phVertex ); + auto driver_result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetFabricVertexExpEpilogue( hDevice, phVertex ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetFabricVertexExp(result, hDevice, phVertex); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExt(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phVertex){ - context.handleLifetime->addHandle( *phVertex ); - context.handleLifetime->addDependent( hDevice, *phVertex ); - - } - } - return logAndPropagateResult_zeDeviceGetFabricVertexExp(driver_result, hDevice, phVertex); + return logAndPropagateResult_zeRTASBuilderBuildExt(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetExp + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeFabricEdgeGetExp(hVertexA, hVertexB, pCount, phEdges)"); + context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetExp = context.zeDdiTable.FabricEdgeExp.pfnGetExp; + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnGetExp ) - return logAndPropagateResult_zeFabricEdgeGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hVertexA, hVertexB, pCount, phEdges); + if( nullptr == pfnCommandListAppendCopyExt ) + return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetExpPrologue( hVertexA, hVertexB, pCount, phEdges ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -18658,50 +18735,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetExpPrologue( hVertexA, hVertexB, pCount, phEdges ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCommandListAppendCopyExtPrologue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + auto driver_result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetExpEpilogue( hVertexA, hVertexB, pCount, phEdges ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetExp(result, hVertexA, hVertexB, pCount, phEdges); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCommandListAppendCopyExtEpilogue( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phEdges) && (i < *pCount); ++i){ - if (phEdges[i]){ - context.handleLifetime->addHandle( phEdges[i] ); - context.handleLifetime->addDependent( hVertexA, phEdges[i] ); - } - } - } - return logAndPropagateResult_zeFabricEdgeGetExp(driver_result, hVertexA, hVertexB, pCount, phEdges); + return logAndPropagateResult_zeRTASBuilderCommandListAppendCopyExt(driver_result, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetVerticesExp + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - context.logger->log_trace("zeFabricEdgeGetVerticesExp(hEdge, phVertexA, phVertexB)"); + context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); - auto pfnGetVerticesExp = context.zeDdiTable.FabricEdgeExp.pfnGetVerticesExp; + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - if( nullptr == pfnGetVerticesExp ) - return logAndPropagateResult_zeFabricEdgeGetVerticesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEdge, phVertexA, phVertexB); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeRTASBuilderDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetVerticesExpPrologue( hEdge, phVertexA, phVertexB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } @@ -18711,53 +18776,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetVerticesExpPrologue( hEdge, phVertexA, phVertexB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } - auto driver_result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + auto driver_result = pfnDestroyExt( hBuilder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetVerticesExpEpilogue( hEdge, phVertexA, phVertexB ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetVerticesExp(result, hEdge, phVertexA, phVertexB); + auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExtEpilogue( hBuilder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExt(result, hBuilder); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phVertexA){ - context.handleLifetime->addHandle( *phVertexA ); - context.handleLifetime->addDependent( hEdge, *phVertexA ); - - } - if (phVertexB){ - context.handleLifetime->addHandle( *phVertexB ); - context.handleLifetime->addDependent( hEdge, *phVertexB ); - - } - } - return logAndPropagateResult_zeFabricEdgeGetVerticesExp(driver_result, hEdge, phVertexA, phVertexB); + return logAndPropagateResult_zeRTASBuilderDestroyExt(driver_result, hBuilder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - context.logger->log_trace("zeFabricEdgeGetPropertiesExp(hEdge, pEdgeProperties)"); + context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); - auto pfnGetPropertiesExp = context.zeDdiTable.FabricEdgeExp.pfnGetPropertiesExp; + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnGetPropertiesExp ) - return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEdge, pEdgeProperties); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeRTASParallelOperationCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetPropertiesExpPrologue( hEdge, pEdgeProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } @@ -18767,58 +18818,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeFabricEdgeGetPropertiesExpPrologue( hEdge, pEdgeProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } - auto driver_result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); + auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeFabricEdgeGetPropertiesExpEpilogue( hEdge, pEdgeProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(result, hEdge, pEdgeProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExtEpilogue( hDriver, phParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExt(result, hDriver, phParallelOperation); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + if (phParallelOperation){ + context.handleLifetime->addHandle( *phParallelOperation ); + context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + + } } - return logAndPropagateResult_zeFabricEdgeGetPropertiesExp(driver_result, hEdge, pEdgeProperties); + return logAndPropagateResult_zeRTASParallelOperationCreateExt(driver_result, hDriver, phParallelOperation); } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestampsExt - __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - context.logger->log_trace("zeEventQueryKernelTimestampsExt(hEvent, hDevice, pCount, pResults)"); + context.logger->log_trace("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); - auto pfnQueryKernelTimestampsExt = context.zeDdiTable.Event.pfnQueryKernelTimestampsExt; + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnQueryKernelTimestampsExt ) - return logAndPropagateResult_zeEventQueryKernelTimestampsExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hEvent, hDevice, pCount, pResults); + if( nullptr == pfnGetPropertiesExt ) + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampsExtPrologue( hEvent, hDevice, pCount, pResults ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } @@ -18828,40 +18869,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeEventQueryKernelTimestampsExtPrologue( hEvent, hDevice, pCount, pResults ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } - auto driver_result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeEventQueryKernelTimestampsExtEpilogue( hEvent, hDevice, pCount, pResults ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeEventQueryKernelTimestampsExt(result, hEvent, hDevice, pCount, pResults); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExtEpilogue( hParallelOperation, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(result, hParallelOperation, pProperties); } - return logAndPropagateResult_zeEventQueryKernelTimestampsExt(driver_result, hEvent, hDevice, pCount, pResults); + return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExt(driver_result, hParallelOperation, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExp + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - context.logger->log_trace("zeRTASBuilderCreateExp(hDriver, pDescriptor, phBuilder)"); + context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); - auto pfnCreateExp = context.zeDdiTable.RTASBuilderExp.pfnCreateExp; + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnCreateExp ) - return logAndPropagateResult_zeRTASBuilderCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pDescriptor, phBuilder); + if( nullptr == pfnJoinExt ) + return logAndPropagateResult_zeRTASParallelOperationJoinExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExpPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } @@ -18871,49 +18910,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExpPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } - auto driver_result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); + auto driver_result = pfnJoinExt( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderCreateExpEpilogue( hDriver, pDescriptor, phBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderCreateExp(result, hDriver, pDescriptor, phBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExtEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExt(result, hParallelOperation); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phBuilder){ - context.handleLifetime->addHandle( *phBuilder ); - context.handleLifetime->addDependent( hDriver, *phBuilder ); - - } - } - return logAndPropagateResult_zeRTASBuilderCreateExp(driver_result, hDriver, pDescriptor, phBuilder); + return logAndPropagateResult_zeRTASParallelOperationJoinExt(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExp(hBuilder, pBuildOpDescriptor, pProperties)"); + context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); - auto pfnGetBuildPropertiesExp = context.zeDdiTable.RTASBuilderExp.pfnGetBuildPropertiesExp; + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnGetBuildPropertiesExp ) - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pProperties); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeRTASParallelOperationDestroyExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExpPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } @@ -18923,44 +18951,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExpPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } - auto driver_result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + auto driver_result = pfnDestroyExt( hParallelOperation ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderGetBuildPropertiesExpEpilogue( hBuilder, pBuildOpDescriptor, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(result, hBuilder, pBuildOpDescriptor, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExtEpilogue( hParallelOperation ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExt(result, hParallelOperation); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeRTASBuilderGetBuildPropertiesExp(driver_result, hBuilder, pBuildOpDescriptor, pProperties); + return logAndPropagateResult_zeRTASParallelOperationDestroyExt(driver_result, hParallelOperation); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { - context.logger->log_trace("zeDriverRTASFormatCompatibilityCheckExp(hDriver, rtasFormatA, rtasFormatB)"); + context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); - auto pfnRTASFormatCompatibilityCheckExp = context.zeDdiTable.DriverExp.pfnRTASFormatCompatibilityCheckExp; + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExp ) - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, rtasFormatA, rtasFormatB); + if( nullptr == pfnGetVectorWidthPropertiesExt ) + return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, pVectorWidthProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExpPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } @@ -18970,50 +19001,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExpPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } - auto driver_result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeDriverRTASFormatCompatibilityCheckExpEpilogue( hDriver, rtasFormatA, rtasFormatB ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(result, hDriver, rtasFormatA, rtasFormatB); + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetVectorWidthPropertiesExtEpilogue( hDevice, pCount, pVectorWidthProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(result, hDevice, pCount, pVectorWidthProperties); } - return logAndPropagateResult_zeDriverRTASFormatCompatibilityCheckExp(driver_result, hDriver, rtasFormatA, rtasFormatB); + return logAndPropagateResult_zeDeviceGetVectorWidthPropertiesExt(driver_result, hDevice, pCount, pVectorWidthProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { - context.logger->log_trace("zeRTASBuilderBuildExp(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); + context.logger->log_trace("zeKernelGetAllocationPropertiesExp(hKernel, pCount, pAllocationProperties)"); - auto pfnBuildExp = context.zeDdiTable.RTASBuilderExp.pfnBuildExp; + auto pfnGetAllocationPropertiesExp = context.zeDdiTable.KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnBuildExp ) - return logAndPropagateResult_zeRTASBuilderBuildExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + if( nullptr == pfnGetAllocationPropertiesExp ) + return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, pCount, pAllocationProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExpPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } @@ -19023,38 +19052,45 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderBuildExpPrologue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetAllocationPropertiesExpPrologue( hKernel, pCount, pAllocationProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } - auto driver_result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + auto driver_result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderBuildExpEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderBuildExp(result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetAllocationPropertiesExpEpilogue( hKernel, pCount, pAllocationProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(result, hKernel, pCount, pAllocationProperties); } - return logAndPropagateResult_zeRTASBuilderBuildExp(driver_result, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zeKernelGetAllocationPropertiesExp(driver_result, hKernel, pCount, pAllocationProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExp + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - context.logger->log_trace("zeRTASBuilderDestroyExp(hBuilder)"); + context.logger->log_trace("zeMemGetIpcHandleWithProperties(hContext, ptr, pNext, pIpcHandle)"); - auto pfnDestroyExp = context.zeDdiTable.RTASBuilderExp.pfnDestroyExp; + auto pfnGetIpcHandleWithProperties = context.zeDdiTable.Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zeRTASBuilderDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hBuilder); + if( nullptr == pfnGetIpcHandleWithProperties ) + return logAndPropagateResult_zeMemGetIpcHandleWithProperties(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, ptr, pNext, pIpcHandle); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExpPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } @@ -19064,39 +19100,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExpPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); + auto result = context.handleLifetime->zeHandleLifetime.zeMemGetIpcHandleWithPropertiesPrologue( hContext, ptr, pNext, pIpcHandle ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } - auto driver_result = pfnDestroyExp( hBuilder ); + auto driver_result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASBuilderDestroyExpEpilogue( hBuilder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASBuilderDestroyExp(result, hBuilder); + auto result = context.validationHandlers[i]->zeValidation->zeMemGetIpcHandleWithPropertiesEpilogue( hContext, ptr, pNext, pIpcHandle ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetIpcHandleWithProperties(result, hContext, ptr, pNext, pIpcHandle); } - return logAndPropagateResult_zeRTASBuilderDestroyExp(driver_result, hBuilder); + return logAndPropagateResult_zeMemGetIpcHandleWithProperties(driver_result, hContext, ptr, pNext, pIpcHandle); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExp + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { - context.logger->log_trace("zeRTASParallelOperationCreateExp(hDriver, phParallelOperation)"); + context.logger->log_trace("zeGraphCreateExt(hContext, pNext, phGraph)"); - auto pfnCreateExp = context.zeDdiTable.RTASParallelOperationExp.pfnCreateExp; + auto pfnCreateExt = context.zeDdiTable.Graph.pfnCreateExt; - if( nullptr == pfnCreateExp ) - return logAndPropagateResult_zeRTASParallelOperationCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, phParallelOperation); + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zeGraphCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, pNext, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExpPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtPrologue( hContext, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } @@ -19106,48 +19144,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExpPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphCreateExtPrologue( hContext, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } - auto driver_result = pfnCreateExp( hDriver, phParallelOperation ); + auto driver_result = pfnCreateExt( hContext, pNext, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationCreateExpEpilogue( hDriver, phParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationCreateExp(result, hDriver, phParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeGraphCreateExtEpilogue( hContext, pNext, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphCreateExt(result, hContext, pNext, phGraph); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phParallelOperation){ - context.handleLifetime->addHandle( *phParallelOperation ); - context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + if (phGraph){ + context.handleLifetime->addHandle( *phGraph ); + context.handleLifetime->addDependent( hContext, *phGraph ); } } - return logAndPropagateResult_zeRTASParallelOperationCreateExp(driver_result, hDriver, phParallelOperation); + return logAndPropagateResult_zeGraphCreateExt(driver_result, hContext, pNext, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeRTASParallelOperationGetPropertiesExp(hParallelOperation, pProperties)"); + context.logger->log_trace("zeCommandListBeginGraphCaptureExt(hCommandList, pNext)"); - auto pfnGetPropertiesExp = context.zeDdiTable.RTASParallelOperationExp.pfnGetPropertiesExp; + auto pfnBeginGraphCaptureExt = context.zeDdiTable.CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnGetPropertiesExp ) - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation, pProperties); + if( nullptr == pfnBeginGraphCaptureExt ) + return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExpPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } @@ -19157,42 +19196,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExpPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginGraphCaptureExtPrologue( hCommandList, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } - auto driver_result = pfnGetPropertiesExp( hParallelOperation, pProperties ); + auto driver_result = pfnBeginGraphCaptureExt( hCommandList, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationGetPropertiesExpEpilogue( hParallelOperation, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(result, hParallelOperation, pProperties); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginGraphCaptureExtEpilogue( hCommandList, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(result, hCommandList, pNext); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeRTASParallelOperationGetPropertiesExp(driver_result, hParallelOperation, pProperties); + return logAndPropagateResult_zeCommandListBeginGraphCaptureExt(driver_result, hCommandList, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeRTASParallelOperationJoinExp(hParallelOperation)"); + context.logger->log_trace("zeCommandListBeginCaptureIntoGraphExt(hCommandList, hGraph, pNext)"); - auto pfnJoinExp = context.zeDdiTable.RTASParallelOperationExp.pfnJoinExp; + auto pfnBeginCaptureIntoGraphExt = context.zeDdiTable.CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnJoinExp ) - return logAndPropagateResult_zeRTASParallelOperationJoinExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnBeginCaptureIntoGraphExt ) + return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExpPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } @@ -19202,38 +19240,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExpPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListBeginCaptureIntoGraphExtPrologue( hCommandList, hGraph, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } - auto driver_result = pfnJoinExp( hParallelOperation ); + auto driver_result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationJoinExpEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationJoinExp(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListBeginCaptureIntoGraphExtEpilogue( hCommandList, hGraph, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(result, hCommandList, hGraph, pNext); } - return logAndPropagateResult_zeRTASParallelOperationJoinExp(driver_result, hParallelOperation); + return logAndPropagateResult_zeCommandListBeginCaptureIntoGraphExt(driver_result, hCommandList, hGraph, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - context.logger->log_trace("zeRTASParallelOperationDestroyExp(hParallelOperation)"); + context.logger->log_trace("zeCommandListIsGraphCaptureEnabledExt(hCommandList)"); - auto pfnDestroyExp = context.zeDdiTable.RTASParallelOperationExp.pfnDestroyExp; + auto pfnIsGraphCaptureEnabledExt = context.zeDdiTable.CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zeRTASParallelOperationDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hParallelOperation); + if( nullptr == pfnIsGraphCaptureEnabledExt ) + return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExpPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } @@ -19243,43 +19281,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExpPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsGraphCaptureEnabledExtPrologue( hCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } - auto driver_result = pfnDestroyExp( hParallelOperation ); + auto driver_result = pfnIsGraphCaptureEnabledExt( hCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeRTASParallelOperationDestroyExpEpilogue( hParallelOperation ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeRTASParallelOperationDestroyExp(result, hParallelOperation); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsGraphCaptureEnabledExtEpilogue( hCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(result, hCommandList); } - return logAndPropagateResult_zeRTASParallelOperationDestroyExp(driver_result, hParallelOperation); + return logAndPropagateResult_zeCommandListIsGraphCaptureEnabledExt(driver_result, hCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetPitchFor2dImage + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { - context.logger->log_trace("zeMemGetPitchFor2dImage(hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch)"); + context.logger->log_trace("zeCommandListEndGraphCaptureExt(hCommandList, pNext, phGraph)"); - auto pfnGetPitchFor2dImage = context.zeDdiTable.Mem.pfnGetPitchFor2dImage; + auto pfnEndGraphCaptureExt = context.zeDdiTable.CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnGetPitchFor2dImage ) - return logAndPropagateResult_zeMemGetPitchFor2dImage(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + if( nullptr == pfnEndGraphCaptureExt ) + return logAndPropagateResult_zeCommandListEndGraphCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetPitchFor2dImagePrologue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } @@ -19289,39 +19325,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeMemGetPitchFor2dImagePrologue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListEndGraphCaptureExtPrologue( hCommandList, pNext, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } - auto driver_result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + auto driver_result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeMemGetPitchFor2dImageEpilogue( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeMemGetPitchFor2dImage(result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListEndGraphCaptureExtEpilogue( hCommandList, pNext, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListEndGraphCaptureExt(result, hCommandList, pNext, phGraph); } - return logAndPropagateResult_zeMemGetPitchFor2dImage(driver_result, hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch); + return logAndPropagateResult_zeCommandListEndGraphCaptureExt(driver_result, hCommandList, pNext, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetDeviceOffsetExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { - context.logger->log_trace("zeImageGetDeviceOffsetExp(hImage, pDeviceOffset)"); + context.logger->log_trace("zeCommandListGetGraphExt(hCommandList, phGraph)"); - auto pfnGetDeviceOffsetExp = context.zeDdiTable.ImageExp.pfnGetDeviceOffsetExp; + auto pfnGetGraphExt = context.zeDdiTable.CommandList.pfnGetGraphExt; - if( nullptr == pfnGetDeviceOffsetExp ) - return logAndPropagateResult_zeImageGetDeviceOffsetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hImage, pDeviceOffset); + if( nullptr == pfnGetGraphExt ) + return logAndPropagateResult_zeCommandListGetGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetDeviceOffsetExpPrologue( hImage, pDeviceOffset ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } @@ -19331,43 +19367,40 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeImageGetDeviceOffsetExpPrologue( hImage, pDeviceOffset ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetGraphExtPrologue( hCommandList, phGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } - auto driver_result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + auto driver_result = pfnGetGraphExt( hCommandList, phGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeImageGetDeviceOffsetExpEpilogue( hImage, pDeviceOffset ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeImageGetDeviceOffsetExp(result, hImage, pDeviceOffset); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetGraphExtEpilogue( hCommandList, phGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetGraphExt(result, hCommandList, phGraph); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeImageGetDeviceOffsetExp(driver_result, hImage, pDeviceOffset); + return logAndPropagateResult_zeCommandListGetGraphExt(driver_result, hCommandList, phGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateCloneExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { - context.logger->log_trace("zeCommandListCreateCloneExp(hCommandList, phClonedCommandList)"); + context.logger->log_trace("zeGraphGetPrimaryCommandListExt(hGraph, phCommandList)"); - auto pfnCreateCloneExp = context.zeDdiTable.CommandListExp.pfnCreateCloneExp; + auto pfnGetPrimaryCommandListExt = context.zeDdiTable.Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnCreateCloneExp ) - return logAndPropagateResult_zeCommandListCreateCloneExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, phClonedCommandList); + if( nullptr == pfnGetPrimaryCommandListExt ) + return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phCommandList); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateCloneExpPrologue( hCommandList, phClonedCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } @@ -19377,58 +19410,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListCreateCloneExpPrologue( hCommandList, phClonedCommandList ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphGetPrimaryCommandListExtPrologue( hGraph, phCommandList ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } - auto driver_result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); + auto driver_result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListCreateCloneExpEpilogue( hCommandList, phClonedCommandList ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListCreateCloneExp(result, hCommandList, phClonedCommandList); + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetPrimaryCommandListExtEpilogue( hGraph, phCommandList ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(result, hGraph, phCommandList); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phClonedCommandList){ - context.handleLifetime->addHandle( *phClonedCommandList ); - context.handleLifetime->addDependent( hCommandList, *phClonedCommandList ); - - } - } - return logAndPropagateResult_zeCommandListCreateCloneExp(driver_result, hCommandList, phClonedCommandList); + return logAndPropagateResult_zeGraphGetPrimaryCommandListExt(driver_result, hGraph, phCommandList); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeCommandListImmediateAppendCommandListsExp(hCommandListImmediate, numCommandLists, phCommandListsLocal, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeGraphSetDestructionCallbackExt(hGraph, pfnCallback, pUserData, pNext)"); - auto pfnImmediateAppendCommandListsExp = context.zeDdiTable.CommandListExp.pfnImmediateAppendCommandListsExp; + auto pfnSetDestructionCallbackExt = context.zeDdiTable.Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnImmediateAppendCommandListsExp ) - return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnSetDestructionCallbackExt ) + return logAndPropagateResult_zeGraphSetDestructionCallbackExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pfnCallback, pUserData, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsExpPrologue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } @@ -19438,50 +19455,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateAppendCommandListsExpPrologue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphSetDestructionCallbackExtPrologue( hGraph, pfnCallback, pUserData, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } - auto driver_result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsExpEpilogue( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphSetDestructionCallbackExtEpilogue( hGraph, pfnCallback, pUserData, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphSetDestructionCallbackExt(result, hGraph, pfnCallback, pUserData, pNext); } - return logAndPropagateResult_zeCommandListImmediateAppendCommandListsExp(driver_result, hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeGraphSetDestructionCallbackExt(driver_result, hGraph, pfnCallback, pUserData, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { - context.logger->log_trace("zeCommandListImmediateAppendCommandListsWithParameters(hCommandListImmediate, numCommandLists, phCommandListsLocal, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeGraphInstantiateExt(hGraph, pNext, phExecutableGraph)"); - auto pfnImmediateAppendCommandListsWithParameters = context.zeDdiTable.CommandList.pfnImmediateAppendCommandListsWithParameters; + auto pfnInstantiateExt = context.zeDdiTable.Graph.pfnInstantiateExt; - if( nullptr == pfnImmediateAppendCommandListsWithParameters ) - return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + if( nullptr == pfnInstantiateExt ) + return logAndPropagateResult_zeGraphInstantiateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pNext, phExecutableGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsWithParametersPrologue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } @@ -19491,40 +19499,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListImmediateAppendCommandListsWithParametersPrologue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphInstantiateExtPrologue( hGraph, pNext, phExecutableGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } - auto driver_result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + auto driver_result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListImmediateAppendCommandListsWithParametersEpilogue( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphInstantiateExtEpilogue( hGraph, pNext, phExecutableGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphInstantiateExt(result, hGraph, pNext, phExecutableGraph); } - return logAndPropagateResult_zeCommandListImmediateAppendCommandListsWithParameters(driver_result, hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeGraphInstantiateExt(driver_result, hGraph, pNext, phExecutableGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdExp + /// @brief Intercept function for zeCommandListAppendGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListGetNextCommandIdExp(hCommandList, desc, pCommandId)"); + context.logger->log_trace("zeCommandListAppendGraphExt(hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnGetNextCommandIdExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdExp; + auto pfnAppendGraphExt = context.zeDdiTable.CommandList.pfnAppendGraphExt; - if( nullptr == pfnGetNextCommandIdExp ) - return logAndPropagateResult_zeCommandListGetNextCommandIdExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc, pCommandId); + if( nullptr == pfnAppendGraphExt ) + return logAndPropagateResult_zeCommandListAppendGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdExpPrologue( hCommandList, desc, pCommandId ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -19534,48 +19548,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetNextCommandIdExpPrologue( hCommandList, desc, pCommandId ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendGraphExtPrologue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + auto driver_result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdExpEpilogue( hCommandList, desc, pCommandId ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdExp(result, hCommandList, desc, pCommandId); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendGraphExtEpilogue( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendGraphExt(result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeCommandListGetNextCommandIdExp(driver_result, hCommandList, desc, pCommandId); + return logAndPropagateResult_zeCommandListAppendGraphExt(driver_result, hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { - context.logger->log_trace("zeCommandListGetNextCommandIdWithKernelsExp(hCommandList, desc, numKernels, phKernelsLocal, pCommandId)"); + context.logger->log_trace("zeExecutableGraphGetSourceGraphExt(hGraph, phSourceGraph)"); - auto pfnGetNextCommandIdWithKernelsExp = context.zeDdiTable.CommandListExp.pfnGetNextCommandIdWithKernelsExp; + auto pfnGetSourceGraphExt = context.zeDdiTable.ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetNextCommandIdWithKernelsExp ) - return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc, numKernels, phKernels, pCommandId); + if( nullptr == pfnGetSourceGraphExt ) + return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, phSourceGraph); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdWithKernelsExpPrologue( hCommandList, desc, numKernels, phKernels, pCommandId ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } @@ -19585,44 +19590,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListGetNextCommandIdWithKernelsExpPrologue( hCommandList, desc, numKernels, phKernels, pCommandId ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); + auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphGetSourceGraphExtPrologue( hGraph, phSourceGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } - auto driver_result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + auto driver_result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListGetNextCommandIdWithKernelsExpEpilogue( hCommandList, desc, numKernels, phKernels, pCommandId ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(result, hCommandList, desc, numKernels, phKernels, pCommandId); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphGetSourceGraphExtEpilogue( hGraph, phSourceGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(result, hGraph, phSourceGraph); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zeCommandListGetNextCommandIdWithKernelsExp(driver_result, hCommandList, desc, numKernels, phKernels, pCommandId); + return logAndPropagateResult_zeExecutableGraphGetSourceGraphExt(driver_result, hGraph, phSourceGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { - context.logger->log_trace("zeCommandListUpdateMutableCommandsExp(hCommandList, desc)"); + context.logger->log_trace("zeGraphIsEmptyExt(hGraph)"); - auto pfnUpdateMutableCommandsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandsExp; + auto pfnIsEmptyExt = context.zeDdiTable.Graph.pfnIsEmptyExt; - if( nullptr == pfnUpdateMutableCommandsExp ) - return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, desc); + if( nullptr == pfnIsEmptyExt ) + return logAndPropagateResult_zeGraphIsEmptyExt(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->zeCommandListUpdateMutableCommandsExpPrologue( hCommandList, desc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); + auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } @@ -19632,40 +19631,41 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandsExpPrologue( hCommandList, desc ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphIsEmptyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } - auto driver_result = pfnUpdateMutableCommandsExp( hCommandList, desc ); + auto driver_result = pfnIsEmptyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandsExpEpilogue( hCommandList, desc ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(result, hCommandList, desc); + auto result = context.validationHandlers[i]->zeValidation->zeGraphIsEmptyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphIsEmptyExt(result, hGraph); } - return logAndPropagateResult_zeCommandListUpdateMutableCommandsExp(driver_result, hCommandList, desc); + return logAndPropagateResult_zeGraphIsEmptyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsMutableExp + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { - context.logger->log_trace("zeCommandListIsMutableExp(hCommandList, pIsMutable)"); + context.logger->log_trace("zeGraphDumpContentsExt(hGraph, filePath, pNext)"); - auto pfnIsMutableExp = context.zeDdiTable.CommandListExp.pfnIsMutableExp; + auto pfnDumpContentsExt = context.zeDdiTable.Graph.pfnDumpContentsExt; - if( nullptr == pfnIsMutableExp ) - return logAndPropagateResult_zeCommandListIsMutableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pIsMutable); + if( nullptr == pfnDumpContentsExt ) + return logAndPropagateResult_zeGraphDumpContentsExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, filePath, pNext); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } @@ -19675,40 +19675,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListIsMutableExpPrologue( hCommandList, pIsMutable ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphDumpContentsExtPrologue( hGraph, filePath, pNext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } - auto driver_result = pfnIsMutableExp( hCommandList, pIsMutable ); + auto driver_result = pfnDumpContentsExt( hGraph, filePath, pNext ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListIsMutableExpEpilogue( hCommandList, pIsMutable ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListIsMutableExp(result, hCommandList, pIsMutable); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDumpContentsExtEpilogue( hGraph, filePath, pNext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDumpContentsExt(result, hGraph, filePath, pNext); } - return logAndPropagateResult_zeCommandListIsMutableExp(driver_result, hCommandList, pIsMutable); + return logAndPropagateResult_zeGraphDumpContentsExt(driver_result, hGraph, filePath, pNext); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { - context.logger->log_trace("zeCommandListUpdateMutableCommandSignalEventExp(hCommandList, commandId, hSignalEvent)"); + context.logger->log_trace("zeExecutableGraphDestroyExt(hGraph)"); - auto pfnUpdateMutableCommandSignalEventExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandSignalEventExp; + auto pfnDestroyExt = context.zeDdiTable.ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnUpdateMutableCommandSignalEventExp ) - return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, commandId, hSignalEvent); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeExecutableGraphDestroyExt(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->zeCommandListUpdateMutableCommandSignalEventExpPrologue( hCommandList, commandId, hSignalEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } @@ -19718,42 +19716,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandSignalEventExpPrologue( hCommandList, commandId, hSignalEvent ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); + auto result = context.handleLifetime->zeHandleLifetime.zeExecutableGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } - auto driver_result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); + auto driver_result = pfnDestroyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandSignalEventExpEpilogue( hCommandList, commandId, hSignalEvent ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(result, hCommandList, commandId, hSignalEvent); + auto result = context.validationHandlers[i]->zeValidation->zeExecutableGraphDestroyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeExecutableGraphDestroyExt(result, hGraph); } - return logAndPropagateResult_zeCommandListUpdateMutableCommandSignalEventExp(driver_result, hCommandList, commandId, hSignalEvent); + return logAndPropagateResult_zeExecutableGraphDestroyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { - context.logger->log_trace("zeCommandListUpdateMutableCommandWaitEventsExp(hCommandList, commandId, numWaitEvents, phWaitEventsLocal)"); + context.logger->log_trace("zeGraphDestroyExt(hGraph)"); - auto pfnUpdateMutableCommandWaitEventsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + auto pfnDestroyExt = context.zeDdiTable.Graph.pfnDestroyExt; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) - return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, commandId, numWaitEvents, phWaitEvents); + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult_zeGraphDestroyExt(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->zeCommandListUpdateMutableCommandWaitEventsExpPrologue( hCommandList, commandId, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } @@ -19763,42 +19757,48 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandWaitEventsExpPrologue( hCommandList, commandId, numWaitEvents, phWaitEvents ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); + auto result = context.handleLifetime->zeHandleLifetime.zeGraphDestroyExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } - auto driver_result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + auto driver_result = pfnDestroyExt( hGraph ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandWaitEventsExpEpilogue( hCommandList, commandId, numWaitEvents, phWaitEvents ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(result, hCommandList, commandId, numWaitEvents, phWaitEvents); + auto result = context.validationHandlers[i]->zeValidation->zeGraphDestroyExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphDestroyExt(result, hGraph); } - return logAndPropagateResult_zeCommandListUpdateMutableCommandWaitEventsExp(driver_result, hCommandList, commandId, numWaitEvents, phWaitEvents); + return logAndPropagateResult_zeGraphDestroyExt(driver_result, hGraph); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandKernelsExp( + zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { - context.logger->log_trace("zeCommandListUpdateMutableCommandKernelsExp(hCommandList, numKernels, pCommandId, phKernelsLocal)"); + context.logger->log_trace("zeCommandListAppendHostFunction(hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - auto pfnUpdateMutableCommandKernelsExp = context.zeDdiTable.CommandListExp.pfnUpdateMutableCommandKernelsExp; + auto pfnAppendHostFunction = context.zeDdiTable.CommandList.pfnAppendHostFunction; - if( nullptr == pfnUpdateMutableCommandKernelsExp ) - return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, numKernels, pCommandId, phKernels); + if( nullptr == pfnAppendHostFunction ) + return logAndPropagateResult_zeCommandListAppendHostFunction(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandKernelsExpPrologue( hCommandList, numKernels, pCommandId, phKernels ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } @@ -19808,18 +19808,18 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeCommandListUpdateMutableCommandKernelsExpPrologue( hCommandList, numKernels, pCommandId, phKernels ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendHostFunctionPrologue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - auto driver_result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + auto driver_result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zeValidation->zeCommandListUpdateMutableCommandKernelsExpEpilogue( hCommandList, numKernels, pCommandId, phKernels ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(result, hCommandList, numKernels, pCommandId, phKernels); + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendHostFunctionEpilogue( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendHostFunction(result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } - return logAndPropagateResult_zeCommandListUpdateMutableCommandKernelsExp(driver_result, hCommandList, numKernels, pCommandId, phKernels); + return logAndPropagateResult_zeCommandListAppendHostFunction(driver_result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } /////////////////////////////////////////////////////////////////////////////// @@ -19944,96 +19944,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = validation_layer::context.zeDdiTable.ExecutableGraph; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (validation_layer::context.version < version) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; - pDdiTable->pfnGetSourceGraphExt = validation_layer::zeExecutableGraphGetSourceGraphExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = validation_layer::zeExecutableGraphDestroyExt; - } - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = validation_layer::context.zeDdiTable.Graph; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (validation_layer::context.version < version) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = validation_layer::zeGraphCreateExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; - pDdiTable->pfnGetPrimaryCommandListExt = validation_layer::zeGraphGetPrimaryCommandListExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; - pDdiTable->pfnSetDestructionCallbackExt = validation_layer::zeGraphSetDestructionCallbackExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; - pDdiTable->pfnInstantiateExt = validation_layer::zeGraphInstantiateExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; - pDdiTable->pfnIsEmptyExt = validation_layer::zeGraphIsEmptyExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; - pDdiTable->pfnDumpContentsExt = validation_layer::zeGraphDumpContentsExt; - } - if (version >= ZE_API_VERSION_1_17) { - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = validation_layer::zeGraphDestroyExt; - } - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses @@ -21765,6 +21675,96 @@ zeGetFabricVertexExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.ExecutableGraph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (validation_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetSourceGraphExt = pDdiTable->pfnGetSourceGraphExt; + pDdiTable->pfnGetSourceGraphExt = validation_layer::zeExecutableGraphGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeExecutableGraphDestroyExt; + } + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.Graph; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (validation_layer::context.version < version) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeGraphCreateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnGetPrimaryCommandListExt = pDdiTable->pfnGetPrimaryCommandListExt; + pDdiTable->pfnGetPrimaryCommandListExt = validation_layer::zeGraphGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnSetDestructionCallbackExt = pDdiTable->pfnSetDestructionCallbackExt; + pDdiTable->pfnSetDestructionCallbackExt = validation_layer::zeGraphSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnInstantiateExt = pDdiTable->pfnInstantiateExt; + pDdiTable->pfnInstantiateExt = validation_layer::zeGraphInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnIsEmptyExt = pDdiTable->pfnIsEmptyExt; + pDdiTable->pfnIsEmptyExt = validation_layer::zeGraphIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDumpContentsExt = pDdiTable->pfnDumpContentsExt; + pDdiTable->pfnDumpContentsExt = validation_layer::zeGraphDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeGraphDestroyExt; + } + return result; +} + #if defined(__cplusplus) }; #endif diff --git a/source/layers/validation/zes_valddi.cpp b/source/layers/validation/zes_valddi.cpp index 14d82762..a9fb5f12 100644 --- a/source/layers/validation/zes_valddi.cpp +++ b/source/layers/validation/zes_valddi.cpp @@ -3859,41 +3859,6 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; - } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt( - ze_result_t result, - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action -) { - // 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 zesDevicePciLinkSpeedUpdateExt("; - - - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "shouldDowngrade="; - oss << loader::to_string(shouldDowngrade); - - oss << ", "; - oss << "pendingAction="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pendingAction != nullptr) { - oss << loader::to_string(*pendingAction); - } else { - oss << loader::to_string(pendingAction); - } - oss << ")"; - context.logger->log_trace(oss.str()); - return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesPowerGetLimitsExt( ze_result_t result, @@ -4748,6 +4713,41 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt( + ze_result_t result, + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action +) { + // 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 zesDevicePciLinkSpeedUpdateExt("; + + + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "shouldDowngrade="; + oss << loader::to_string(shouldDowngrade); + + oss << ", "; + oss << "pendingAction="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pendingAction != nullptr) { + oss << loader::to_string(*pendingAction); + } else { + oss << loader::to_string(pendingAction); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesInit @@ -10573,50 +10573,6 @@ namespace validation_layer return logAndPropagateResult_zesTemperatureGetState(driver_result, hTemperature, pTemperature); } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt - __zedlllocal ze_result_t ZE_APICALL - zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - context.logger->log_trace("zesDevicePciLinkSpeedUpdateExt(hDevice, shouldDowngrade, pendingAction)"); - - auto pfnPciLinkSpeedUpdateExt = context.zesDdiTable.Device.pfnPciLinkSpeedUpdateExt; - - if( nullptr == pfnPciLinkSpeedUpdateExt ) - return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, shouldDowngrade, pendingAction); - - auto numValHandlers = context.validationHandlers.size(); - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zesValidation->zesDevicePciLinkSpeedUpdateExtPrologue( hDevice, shouldDowngrade, pendingAction ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zesHandleLifetime.zesDevicePciLinkSpeedUpdateExtPrologue( hDevice, shouldDowngrade, pendingAction ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); - } - - auto driver_result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zesValidation->zesDevicePciLinkSpeedUpdateExtEpilogue( hDevice, shouldDowngrade, pendingAction ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); - } - - return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(driver_result, hDevice, shouldDowngrade, pendingAction); - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesPowerGetLimitsExt __zedlllocal ze_result_t ZE_APICALL @@ -11878,6 +11834,50 @@ namespace validation_layer return logAndPropagateResult_zesVFManagementGetVFCapabilitiesExp2(driver_result, hVFhandle, pCapability); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + context.logger->log_trace("zesDevicePciLinkSpeedUpdateExt(hDevice, shouldDowngrade, pendingAction)"); + + auto pfnPciLinkSpeedUpdateExt = context.zesDdiTable.Device.pfnPciLinkSpeedUpdateExt; + + if( nullptr == pfnPciLinkSpeedUpdateExt ) + return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, shouldDowngrade, pendingAction); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDevicePciLinkSpeedUpdateExtPrologue( hDevice, shouldDowngrade, pendingAction ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesDevicePciLinkSpeedUpdateExtPrologue( hDevice, shouldDowngrade, pendingAction ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); + } + + auto driver_result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDevicePciLinkSpeedUpdateExtEpilogue( hDevice, shouldDowngrade, pendingAction ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(result, hDevice, shouldDowngrade, pendingAction); + } + + return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(driver_result, hDevice, shouldDowngrade, pendingAction); + } + } // namespace validation_layer #if defined(__cplusplus) diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index cd1406e0..38eb931e 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -1255,17 +1255,31 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp( ze_result_t result, - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1273,48 +1287,51 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetDeviceGetConcurrentMetricGroupsExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCalculateMultipleMetricValuesExp("; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << "hMetricGroup="; + oss << loader::to_string(hMetricGroup); oss << ", "; - oss << "metricGroupCount="; - oss << loader::to_string(metricGroupCount); + oss << "type="; + oss << loader::to_string(type); oss << ", "; - oss << "phMetricGroups="; - oss << loader::to_string(phMetricGroups); + oss << "rawDataSize="; + oss << loader::to_string(rawDataSize); oss << ", "; - oss << "pMetricGroupsCountPerConcurrentGroup="; - oss << loader::to_string(pMetricGroupsCountPerConcurrentGroup); + oss << "pRawData="; + oss << loader::to_string(pRawData); oss << ", "; - oss << "pConcurrentGroupCount="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && pConcurrentGroupCount != nullptr) { - oss << loader::to_string(*pConcurrentGroupCount); - } else { - oss << loader::to_string(pConcurrentGroupCount); - } + oss << "pSetCount="; + oss << loader::to_string(pSetCount); + + oss << ", "; + oss << "pTotalMetricValueCount="; + oss << loader::to_string(pTotalMetricValueCount); + + oss << ", "; + oss << "pMetricCounts="; + oss << loader::to_string(pMetricCounts); + + oss << ", "; + oss << "pMetricValues="; + oss << loader::to_string(pMetricValues); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp( ze_result_t result, - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1322,47 +1339,48 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerCreateExp("; - - - oss << "hContext="; - oss << loader::to_string(hContext); - - oss << ", "; - oss << "hDevice="; - oss << loader::to_string(hDevice); + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupGetGlobalTimestampsExp("; - oss << ", "; - oss << "metricGroupCount="; - oss << loader::to_string(metricGroupCount); - oss << ", "; - oss << "phMetricGroups="; - oss << loader::to_string(phMetricGroups); + oss << "hMetricGroup="; + oss << loader::to_string(hMetricGroup); oss << ", "; - oss << "desc="; - oss << loader::to_string(desc); + oss << "synchronizedWithHost="; + oss << loader::to_string(synchronizedWithHost); oss << ", "; - oss << "hNotificationEvent="; - oss << loader::to_string(hNotificationEvent); + oss << "globalTimestamp="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && globalTimestamp != nullptr) { + oss << loader::to_string(*globalTimestamp); + } else { + oss << loader::to_string(globalTimestamp); + } oss << ", "; - oss << "phMetricTracer="; + oss << "metricTimestamp="; // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phMetricTracer != nullptr) { - oss << loader::to_string(*phMetricTracer); + if (result == ZE_RESULT_SUCCESS && metricTimestamp != nullptr) { + oss << loader::to_string(*metricTimestamp); } else { - oss << loader::to_string(phMetricTracer); + oss << loader::to_string(metricTimestamp); } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupGetExportDataExp( ze_result_t result, - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1370,23 +1388,57 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupGetExportDataExp("; - oss << "hMetricTracer="; - oss << loader::to_string(hMetricTracer); + oss << "hMetricGroup="; + oss << loader::to_string(hMetricGroup); + + oss << ", "; + oss << "pRawData="; + oss << loader::to_string(pRawData); + + oss << ", "; + oss << "rawDataSize="; + oss << loader::to_string(rawDataSize); + + oss << ", "; + oss << "pExportDataSize="; + oss << loader::to_string(pExportDataSize); + + oss << ", "; + oss << "pExportData="; + oss << loader::to_string(pExportData); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerEnableExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp( ze_result_t result, - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1394,28 +1446,59 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerEnableExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCalculateMetricExportDataExp("; - oss << "hMetricTracer="; - oss << loader::to_string(hMetricTracer); + oss << "hDriver="; + oss << loader::to_string(hDriver); oss << ", "; - oss << "synchronous="; - oss << loader::to_string(synchronous); + oss << "type="; + oss << loader::to_string(type); + + oss << ", "; + oss << "exportDataSize="; + oss << loader::to_string(exportDataSize); + + oss << ", "; + oss << "pExportData="; + oss << loader::to_string(pExportData); + + oss << ", "; + oss << "pCalculateDescriptor="; + oss << loader::to_string(pCalculateDescriptor); + + oss << ", "; + oss << "pSetCount="; + oss << loader::to_string(pSetCount); + + oss << ", "; + oss << "pTotalMetricValueCount="; + oss << loader::to_string(pTotalMetricValueCount); + + oss << ", "; + oss << "pMetricCounts="; + oss << loader::to_string(pMetricCounts); + + oss << ", "; + oss << "pMetricValues="; + oss << loader::to_string(pMetricValues); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDisableExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetExp( ze_result_t result, - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1423,31 +1506,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDisableExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetExp("; - oss << "hMetricTracer="; - oss << loader::to_string(hMetricTracer); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ", "; - oss << "synchronous="; - oss << loader::to_string(synchronous); + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "phMetricProgrammables="; + oss << loader::to_string(phMetricProgrammables); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerReadDataExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetPropertiesExp( ze_result_t result, - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1455,27 +1534,30 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerReadDataExp("; - + oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetPropertiesExp("; - oss << "hMetricTracer="; - oss << loader::to_string(hMetricTracer); - oss << ", "; - oss << "pRawDataSize="; - oss << loader::to_string(pRawDataSize); + oss << "hMetricProgrammable="; + oss << loader::to_string(hMetricProgrammable); oss << ", "; - oss << "pRawData="; - oss << loader::to_string(pRawData); + oss << "pProperties="; + oss << loader::to_string(pProperties); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetParamInfoExp( ze_result_t result, - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1483,57 +1565,35 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricDecoderCreateExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetParamInfoExp("; - oss << "hMetricTracer="; - oss << loader::to_string(hMetricTracer); + oss << "hMetricProgrammable="; + oss << loader::to_string(hMetricProgrammable); oss << ", "; - oss << "phMetricDecoder="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && phMetricDecoder != nullptr) { - oss << loader::to_string(*phMetricDecoder); - } else { - oss << loader::to_string(phMetricDecoder); - } - oss << ")"; - context.logger->log_trace(oss.str()); - return result; - } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderDestroyExp( - ze_result_t result, - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object -) { - // 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 zetMetricDecoderDestroyExp("; - + oss << "pParameterCount="; + oss << loader::to_string(pParameterCount); - oss << "phMetricDecoder="; - oss << loader::to_string(phMetricDecoder); + oss << ", "; + oss << "pParameterInfo="; + oss << loader::to_string(pParameterInfo); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp( ze_result_t result, - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1541,65 +1601,46 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricDecoderGetDecodableMetricsExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetParamValueInfoExp("; - oss << "hMetricDecoder="; - oss << loader::to_string(hMetricDecoder); + oss << "hMetricProgrammable="; + oss << loader::to_string(hMetricProgrammable); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "parameterOrdinal="; + oss << loader::to_string(parameterOrdinal); oss << ", "; - oss << "phMetrics="; - oss << loader::to_string(phMetrics); + oss << "pValueInfoCount="; + oss << loader::to_string(pValueInfoCount); + + oss << ", "; + oss << "pValueInfo="; + oss << loader::to_string(pValueInfo); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDecodeExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricCreateFromProgrammableExp2( ze_result_t result, - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1607,54 +1648,58 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDecodeExp("; - - - oss << "phMetricDecoder="; - oss << loader::to_string(phMetricDecoder); + oss << status << " (" << loader::to_string(result) << ") in zetMetricCreateFromProgrammableExp2("; - oss << ", "; - oss << "pRawDataSize="; - oss << loader::to_string(pRawDataSize); - oss << ", "; - oss << "pRawData="; - oss << loader::to_string(pRawData); + oss << "hMetricProgrammable="; + oss << loader::to_string(hMetricProgrammable); oss << ", "; - oss << "metricsCount="; - oss << loader::to_string(metricsCount); + oss << "parameterCount="; + oss << loader::to_string(parameterCount); oss << ", "; - oss << "phMetrics="; - oss << loader::to_string(phMetrics); + oss << "pParameterValues="; + oss << loader::to_string(pParameterValues); oss << ", "; - oss << "pSetCount="; - oss << loader::to_string(pSetCount); + oss << "pName="; + oss << loader::to_string(pName); oss << ", "; - oss << "pMetricEntriesCountPerSet="; - oss << loader::to_string(pMetricEntriesCountPerSet); + oss << "pDescription="; + oss << loader::to_string(pDescription); oss << ", "; - oss << "pMetricEntriesCount="; - oss << loader::to_string(pMetricEntriesCount); + oss << "pMetricHandleCount="; + oss << loader::to_string(pMetricHandleCount); oss << ", "; - oss << "pMetricEntries="; - oss << loader::to_string(pMetricEntries); + oss << "phMetricHandles="; + oss << loader::to_string(phMetricHandles); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetCommandListAppendMarkerExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricCreateFromProgrammableExp( ze_result_t result, - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1662,26 +1707,61 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetCommandListAppendMarkerExp("; - + oss << status << " (" << loader::to_string(result) << ") in zetMetricCreateFromProgrammableExp("; - oss << "hCommandList="; - oss << loader::to_string(hCommandList); + + oss << "hMetricProgrammable="; + oss << loader::to_string(hMetricProgrammable); oss << ", "; - oss << "hMetricGroup="; - oss << loader::to_string(hMetricGroup); + oss << "pParameterValues="; + oss << loader::to_string(pParameterValues); oss << ", "; - oss << "value="; - oss << loader::to_string(value); + oss << "parameterCount="; + oss << loader::to_string(parameterCount); + + oss << ", "; + oss << "pName="; + oss << loader::to_string(pName); + + oss << ", "; + oss << "pDescription="; + oss << loader::to_string(pDescription); + + oss << ", "; + oss << "pMetricHandleCount="; + oss << loader::to_string(pMetricHandleCount); + + oss << ", "; + oss << "phMetricHandles="; + oss << loader::to_string(phMetricHandles); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceEnableMetricsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp( ze_result_t result, - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1689,18 +1769,49 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetDeviceEnableMetricsExp("; + oss << status << " (" << loader::to_string(result) << ") in zetDeviceCreateMetricGroupsFromMetricsExp("; oss << "hDevice="; oss << loader::to_string(hDevice); + + oss << ", "; + oss << "metricCount="; + oss << loader::to_string(metricCount); + + oss << ", "; + oss << "phMetrics="; + oss << loader::to_string(phMetrics); + + oss << ", "; + oss << "pMetricGroupNamePrefix="; + oss << loader::to_string(pMetricGroupNamePrefix); + + oss << ", "; + oss << "pDescription="; + oss << loader::to_string(pDescription); + + oss << ", "; + oss << "pMetricGroupCount="; + oss << loader::to_string(pMetricGroupCount); + + oss << ", "; + oss << "phMetricGroup="; + oss << loader::to_string(phMetricGroup); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceDisableMetricsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCreateExp( ze_result_t result, - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1708,40 +1819,42 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetDeviceDisableMetricsExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCreateExp("; oss << "hDevice="; oss << loader::to_string(hDevice); + + oss << ", "; + oss << "pName="; + oss << loader::to_string(pName); + + oss << ", "; + oss << "pDescription="; + oss << loader::to_string(pDescription); + + oss << ", "; + oss << "samplingType="; + oss << loader::to_string(samplingType); + + oss << ", "; + oss << "phMetricGroup="; + oss << loader::to_string(phMetricGroup); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupAddMetricExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1749,51 +1862,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCalculateMultipleMetricValuesExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupAddMetricExp("; oss << "hMetricGroup="; oss << loader::to_string(hMetricGroup); oss << ", "; - oss << "type="; - oss << loader::to_string(type); - - oss << ", "; - oss << "rawDataSize="; - oss << loader::to_string(rawDataSize); - - oss << ", "; - oss << "pRawData="; - oss << loader::to_string(pRawData); - - oss << ", "; - oss << "pSetCount="; - oss << loader::to_string(pSetCount); - - oss << ", "; - oss << "pTotalMetricValueCount="; - oss << loader::to_string(pTotalMetricValueCount); + oss << "hMetric="; + oss << loader::to_string(hMetric); oss << ", "; - oss << "pMetricCounts="; - oss << loader::to_string(pMetricCounts); + oss << "pErrorStringSize="; + oss << loader::to_string(pErrorStringSize); oss << ", "; - oss << "pMetricValues="; - oss << loader::to_string(pMetricValues); + oss << "pErrorString="; + oss << loader::to_string(pErrorString); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupRemoveMetricExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1801,48 +1894,22 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupGetGlobalTimestampsExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupRemoveMetricExp("; oss << "hMetricGroup="; oss << loader::to_string(hMetricGroup); oss << ", "; - oss << "synchronizedWithHost="; - oss << loader::to_string(synchronizedWithHost); - - oss << ", "; - oss << "globalTimestamp="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && globalTimestamp != nullptr) { - oss << loader::to_string(*globalTimestamp); - } else { - oss << loader::to_string(globalTimestamp); - } - - oss << ", "; - oss << "metricTimestamp="; - // Dereference output parameter if not null and result is success - if (result == ZE_RESULT_SUCCESS && metricTimestamp != nullptr) { - oss << loader::to_string(*metricTimestamp); - } else { - oss << loader::to_string(metricTimestamp); - } + oss << "hMetric="; + oss << loader::to_string(hMetric); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupGetExportDataExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCloseExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1850,57 +1917,37 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupGetExportDataExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCloseExp("; oss << "hMetricGroup="; oss << loader::to_string(hMetricGroup); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupDestroyExp( + ze_result_t result, + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy +) { + // 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 zetMetricGroupDestroyExp("; - oss << ", "; - oss << "pRawData="; - oss << loader::to_string(pRawData); - - oss << ", "; - oss << "rawDataSize="; - oss << loader::to_string(rawDataSize); - - oss << ", "; - oss << "pExportDataSize="; - oss << loader::to_string(pExportDataSize); - oss << ", "; - oss << "pExportData="; - oss << loader::to_string(pExportData); + oss << "hMetricGroup="; + oss << loader::to_string(hMetricGroup); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDestroyExp( ze_result_t result, - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1908,59 +1955,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCalculateMetricExportDataExp("; - - - oss << "hDriver="; - oss << loader::to_string(hDriver); - - oss << ", "; - oss << "type="; - oss << loader::to_string(type); - - oss << ", "; - oss << "exportDataSize="; - oss << loader::to_string(exportDataSize); - - oss << ", "; - oss << "pExportData="; - oss << loader::to_string(pExportData); - - oss << ", "; - oss << "pCalculateDescriptor="; - oss << loader::to_string(pCalculateDescriptor); - - oss << ", "; - oss << "pSetCount="; - oss << loader::to_string(pSetCount); - - oss << ", "; - oss << "pTotalMetricValueCount="; - oss << loader::to_string(pTotalMetricValueCount); + oss << status << " (" << loader::to_string(result) << ") in zetMetricDestroyExp("; - oss << ", "; - oss << "pMetricCounts="; - oss << loader::to_string(pMetricCounts); - oss << ", "; - oss << "pMetricValues="; - oss << loader::to_string(pMetricValues); + oss << "hMetric="; + oss << loader::to_string(hMetric); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp( ze_result_t result, zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1968,27 +1982,48 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetExp("; + oss << status << " (" << loader::to_string(result) << ") in zetDeviceGetConcurrentMetricGroupsExp("; oss << "hDevice="; oss << loader::to_string(hDevice); oss << ", "; - oss << "pCount="; - oss << loader::to_string(pCount); + oss << "metricGroupCount="; + oss << loader::to_string(metricGroupCount); oss << ", "; - oss << "phMetricProgrammables="; - oss << loader::to_string(phMetricProgrammables); + oss << "phMetricGroups="; + oss << loader::to_string(phMetricGroups); + + oss << ", "; + oss << "pMetricGroupsCountPerConcurrentGroup="; + oss << loader::to_string(pMetricGroupsCountPerConcurrentGroup); + + oss << ", "; + oss << "pConcurrentGroupCount="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pConcurrentGroupCount != nullptr) { + oss << loader::to_string(*pConcurrentGroupCount); + } else { + oss << loader::to_string(pConcurrentGroupCount); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetPropertiesExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerCreateExp( ze_result_t result, - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -1996,30 +2031,47 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetPropertiesExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerCreateExp("; - oss << "hMetricProgrammable="; - oss << loader::to_string(hMetricProgrammable); + oss << "hContext="; + oss << loader::to_string(hContext); oss << ", "; - oss << "pProperties="; - oss << loader::to_string(pProperties); + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "metricGroupCount="; + oss << loader::to_string(metricGroupCount); + + oss << ", "; + oss << "phMetricGroups="; + oss << loader::to_string(phMetricGroups); + + oss << ", "; + oss << "desc="; + oss << loader::to_string(desc); + + oss << ", "; + oss << "hNotificationEvent="; + oss << loader::to_string(hNotificationEvent); + + oss << ", "; + oss << "phMetricTracer="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phMetricTracer != nullptr) { + oss << loader::to_string(*phMetricTracer); + } else { + oss << loader::to_string(phMetricTracer); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetParamInfoExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDestroyExp( ze_result_t result, - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2027,35 +2079,23 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetParamInfoExp("; - - - oss << "hMetricProgrammable="; - oss << loader::to_string(hMetricProgrammable); + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDestroyExp("; - oss << ", "; - oss << "pParameterCount="; - oss << loader::to_string(pParameterCount); - oss << ", "; - oss << "pParameterInfo="; - oss << loader::to_string(pParameterInfo); + oss << "hMetricTracer="; + oss << loader::to_string(hMetricTracer); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerEnableExp( ze_result_t result, - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2063,46 +2103,28 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricProgrammableGetParamValueInfoExp("; - - - oss << "hMetricProgrammable="; - oss << loader::to_string(hMetricProgrammable); + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerEnableExp("; - oss << ", "; - oss << "parameterOrdinal="; - oss << loader::to_string(parameterOrdinal); - oss << ", "; - oss << "pValueInfoCount="; - oss << loader::to_string(pValueInfoCount); + oss << "hMetricTracer="; + oss << loader::to_string(hMetricTracer); oss << ", "; - oss << "pValueInfo="; - oss << loader::to_string(pValueInfo); + oss << "synchronous="; + oss << loader::to_string(synchronous); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricCreateFromProgrammableExp2( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDisableExp( ze_result_t result, - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2110,58 +2132,31 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricCreateFromProgrammableExp2("; - - - oss << "hMetricProgrammable="; - oss << loader::to_string(hMetricProgrammable); - - oss << ", "; - oss << "parameterCount="; - oss << loader::to_string(parameterCount); - - oss << ", "; - oss << "pParameterValues="; - oss << loader::to_string(pParameterValues); - - oss << ", "; - oss << "pName="; - oss << loader::to_string(pName); + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDisableExp("; - oss << ", "; - oss << "pDescription="; - oss << loader::to_string(pDescription); - oss << ", "; - oss << "pMetricHandleCount="; - oss << loader::to_string(pMetricHandleCount); + oss << "hMetricTracer="; + oss << loader::to_string(hMetricTracer); oss << ", "; - oss << "phMetricHandles="; - oss << loader::to_string(phMetricHandles); + oss << "synchronous="; + oss << loader::to_string(synchronous); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricCreateFromProgrammableExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerReadDataExp( ze_result_t result, - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2169,61 +2164,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricCreateFromProgrammableExp("; - - - oss << "hMetricProgrammable="; - oss << loader::to_string(hMetricProgrammable); - - oss << ", "; - oss << "pParameterValues="; - oss << loader::to_string(pParameterValues); - - oss << ", "; - oss << "parameterCount="; - oss << loader::to_string(parameterCount); + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerReadDataExp("; - oss << ", "; - oss << "pName="; - oss << loader::to_string(pName); - oss << ", "; - oss << "pDescription="; - oss << loader::to_string(pDescription); + oss << "hMetricTracer="; + oss << loader::to_string(hMetricTracer); oss << ", "; - oss << "pMetricHandleCount="; - oss << loader::to_string(pMetricHandleCount); + oss << "pRawDataSize="; + oss << loader::to_string(pRawDataSize); oss << ", "; - oss << "phMetricHandles="; - oss << loader::to_string(phMetricHandles); + oss << "pRawData="; + oss << loader::to_string(pRawData); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderCreateExp( ze_result_t result, - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2231,49 +2192,27 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetDeviceCreateMetricGroupsFromMetricsExp("; - - - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "metricCount="; - oss << loader::to_string(metricCount); - - oss << ", "; - oss << "phMetrics="; - oss << loader::to_string(phMetrics); - - oss << ", "; - oss << "pMetricGroupNamePrefix="; - oss << loader::to_string(pMetricGroupNamePrefix); + oss << status << " (" << loader::to_string(result) << ") in zetMetricDecoderCreateExp("; - oss << ", "; - oss << "pDescription="; - oss << loader::to_string(pDescription); - oss << ", "; - oss << "pMetricGroupCount="; - oss << loader::to_string(pMetricGroupCount); + oss << "hMetricTracer="; + oss << loader::to_string(hMetricTracer); oss << ", "; - oss << "phMetricGroup="; - oss << loader::to_string(phMetricGroup); + oss << "phMetricDecoder="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phMetricDecoder != nullptr) { + oss << loader::to_string(*phMetricDecoder); + } else { + oss << loader::to_string(phMetricDecoder); + } oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCreateExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderDestroyExp( ze_result_t result, - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2281,42 +2220,29 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCreateExp("; - - - oss << "hDevice="; - oss << loader::to_string(hDevice); - - oss << ", "; - oss << "pName="; - oss << loader::to_string(pName); - - oss << ", "; - oss << "pDescription="; - oss << loader::to_string(pDescription); + oss << status << " (" << loader::to_string(result) << ") in zetMetricDecoderDestroyExp("; - oss << ", "; - oss << "samplingType="; - oss << loader::to_string(samplingType); - oss << ", "; - oss << "phMetricGroup="; - oss << loader::to_string(phMetricGroup); + oss << "phMetricDecoder="; + oss << loader::to_string(phMetricDecoder); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupAddMetricExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2324,31 +2250,65 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupAddMetricExp("; - + oss << status << " (" << loader::to_string(result) << ") in zetMetricDecoderGetDecodableMetricsExp("; - oss << "hMetricGroup="; - oss << loader::to_string(hMetricGroup); - oss << ", "; - oss << "hMetric="; - oss << loader::to_string(hMetric); + oss << "hMetricDecoder="; + oss << loader::to_string(hMetricDecoder); oss << ", "; - oss << "pErrorStringSize="; - oss << loader::to_string(pErrorStringSize); + oss << "pCount="; + oss << loader::to_string(pCount); oss << ", "; - oss << "pErrorString="; - oss << loader::to_string(pErrorString); + oss << "phMetrics="; + oss << loader::to_string(phMetrics); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupRemoveMetricExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricTracerDecodeExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2356,22 +2316,54 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupRemoveMetricExp("; + oss << status << " (" << loader::to_string(result) << ") in zetMetricTracerDecodeExp("; - oss << "hMetricGroup="; - oss << loader::to_string(hMetricGroup); + oss << "phMetricDecoder="; + oss << loader::to_string(phMetricDecoder); oss << ", "; - oss << "hMetric="; - oss << loader::to_string(hMetric); + oss << "pRawDataSize="; + oss << loader::to_string(pRawDataSize); + + oss << ", "; + oss << "pRawData="; + oss << loader::to_string(pRawData); + + oss << ", "; + oss << "metricsCount="; + oss << loader::to_string(metricsCount); + + oss << ", "; + oss << "phMetrics="; + oss << loader::to_string(phMetrics); + + oss << ", "; + oss << "pSetCount="; + oss << loader::to_string(pSetCount); + + oss << ", "; + oss << "pMetricEntriesCountPerSet="; + oss << loader::to_string(pMetricEntriesCountPerSet); + + oss << ", "; + oss << "pMetricEntriesCount="; + oss << loader::to_string(pMetricEntriesCount); + + oss << ", "; + oss << "pMetricEntries="; + oss << loader::to_string(pMetricEntries); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupCloseExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetCommandListAppendMarkerExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2379,18 +2371,26 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupCloseExp("; + oss << status << " (" << loader::to_string(result) << ") in zetCommandListAppendMarkerExp("; + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; oss << "hMetricGroup="; oss << loader::to_string(hMetricGroup); + + oss << ", "; + oss << "value="; + oss << loader::to_string(value); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricGroupDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceEnableMetricsExp( ze_result_t result, - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2398,18 +2398,18 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricGroupDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zetDeviceEnableMetricsExp("; - oss << "hMetricGroup="; - oss << loader::to_string(hMetricGroup); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ")"; context.logger->log_trace(oss.str()); return result; } - VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetMetricDestroyExp( + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zetDeviceDisableMetricsExp( ze_result_t result, - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -2417,11 +2417,11 @@ namespace validation_layer } std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; std::ostringstream oss; - oss << status << " (" << loader::to_string(result) << ") in zetMetricDestroyExp("; + oss << status << " (" << loader::to_string(result) << ") in zetDeviceDisableMetricsExp("; - oss << "hMetric="; - oss << loader::to_string(hMetric); + oss << "hDevice="; + oss << loader::to_string(hDevice); oss << ")"; context.logger->log_trace(oss.str()); return result; @@ -4193,13 +4193,76 @@ namespace validation_layer auto pfnSetEnabled = context.zetDdiTable.TracerExp.pfnSetEnabled; - if( nullptr == pfnSetEnabled ) - return logAndPropagateResult_zetTracerExpSetEnabled(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hTracer, enable); + if( nullptr == pfnSetEnabled ) + return logAndPropagateResult_zetTracerExpSetEnabled(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hTracer, enable); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zetValidation->zetTracerExpSetEnabledPrologue( hTracer, enable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetTracerExpSetEnabledPrologue( hTracer, enable ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + } + + auto driver_result = pfnSetEnabled( hTracer, enable ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zetValidation->zetTracerExpSetEnabledEpilogue( hTracer, enable ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + } + + return logAndPropagateResult_zetTracerExpSetEnabled(driver_result, hTracer, enable); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. + ) + { + context.logger->log_trace("zetMetricGroupCalculateMultipleMetricValuesExp(hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues)"); + + auto pfnCalculateMultipleMetricValuesExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + + if( nullptr == pfnCalculateMultipleMetricValuesExp ) + return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetTracerExpSetEnabledPrologue( hTracer, enable ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMultipleMetricValuesExpPrologue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } @@ -4209,46 +4272,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetTracerExpSetEnabledPrologue( hTracer, enable ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCalculateMultipleMetricValuesExpPrologue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } - auto driver_result = pfnSetEnabled( hTracer, enable ); + auto driver_result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetTracerExpSetEnabledEpilogue( hTracer, enable ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetTracerExpSetEnabled(result, hTracer, enable); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMultipleMetricValuesExpEpilogue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } - return logAndPropagateResult_zetTracerExpSetEnabled(driver_result, hTracer, enable); + return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(driver_result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp + /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { - context.logger->log_trace("zetDeviceGetConcurrentMetricGroupsExp(hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount)"); + context.logger->log_trace("zetMetricGroupGetGlobalTimestampsExp(hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp)"); - auto pfnGetConcurrentMetricGroupsExp = context.zetDdiTable.DeviceExp.pfnGetConcurrentMetricGroupsExp; + auto pfnGetGlobalTimestampsExp = context.zetDdiTable.MetricGroupExp.pfnGetGlobalTimestampsExp; - if( nullptr == pfnGetConcurrentMetricGroupsExp ) - return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); + if( nullptr == pfnGetGlobalTimestampsExp ) + return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceGetConcurrentMetricGroupsExpPrologue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetGlobalTimestampsExpPrologue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); } @@ -4258,51 +4318,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceGetConcurrentMetricGroupsExpPrologue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupGetGlobalTimestampsExpPrologue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); } - auto driver_result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + auto driver_result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceGetConcurrentMetricGroupsExpEpilogue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetGlobalTimestampsExpEpilogue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ } - return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(driver_result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); + return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(driver_result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerCreateExp + /// @brief Intercept function for zetMetricGroupGetExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { - context.logger->log_trace("zetMetricTracerCreateExp(hContext, hDevice, metricGroupCount, phMetricGroupsLocal, desc, hNotificationEvent, phMetricTracer)"); + context.logger->log_trace("zetMetricGroupGetExportDataExp(hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData)"); - auto pfnCreateExp = context.zetDdiTable.MetricTracerExp.pfnCreateExp; + auto pfnGetExportDataExp = context.zetDdiTable.MetricGroupExp.pfnGetExportDataExp; - if( nullptr == pfnCreateExp ) - return logAndPropagateResult_zetMetricTracerCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); + if( nullptr == pfnGetExportDataExp ) + return logAndPropagateResult_zetMetricGroupGetExportDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerCreateExpPrologue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetExportDataExpPrologue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); } @@ -4312,47 +4371,65 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerCreateExpPrologue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupGetExportDataExpPrologue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); } - auto driver_result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + auto driver_result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerCreateExpEpilogue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetExportDataExpEpilogue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phMetricTracer){ - context.handleLifetime->addHandle( *phMetricTracer ); - context.handleLifetime->addDependent( hContext, *phMetricTracer ); - - } } - return logAndPropagateResult_zetMetricTracerCreateExp(driver_result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); + return logAndPropagateResult_zetMetricGroupGetExportDataExp(driver_result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDestroyExp + /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { - context.logger->log_trace("zetMetricTracerDestroyExp(hMetricTracer)"); + context.logger->log_trace("zetMetricGroupCalculateMetricExportDataExp(hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues)"); - auto pfnDestroyExp = context.zetDdiTable.MetricTracerExp.pfnDestroyExp; + auto pfnCalculateMetricExportDataExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMetricExportDataExp; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zetMetricTracerDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer); + if( nullptr == pfnCalculateMetricExportDataExp ) + return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDestroyExpPrologue( hMetricTracer ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMetricExportDataExpPrologue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } @@ -4362,43 +4439,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDestroyExpPrologue( hMetricTracer ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCalculateMetricExportDataExpPrologue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } - auto driver_result = pfnDestroyExp( hMetricTracer ); + auto driver_result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDestroyExpEpilogue( hMetricTracer ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMetricExportDataExpEpilogue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } - return logAndPropagateResult_zetMetricTracerDestroyExp(driver_result, hMetricTracer); + return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(driver_result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerEnableExp + /// @brief Intercept function for zetMetricProgrammableGetExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { - context.logger->log_trace("zetMetricTracerEnableExp(hMetricTracer, synchronous)"); + context.logger->log_trace("zetMetricProgrammableGetExp(hDevice, pCount, phMetricProgrammables)"); - auto pfnEnableExp = context.zetDdiTable.MetricTracerExp.pfnEnableExp; + auto pfnGetExp = context.zetDdiTable.MetricProgrammableExp.pfnGetExp; - if( nullptr == pfnEnableExp ) - return logAndPropagateResult_zetMetricTracerEnableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, synchronous); + if( nullptr == pfnGetExp ) + return logAndPropagateResult_zetMetricProgrammableGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, phMetricProgrammables); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerEnableExpPrologue( hMetricTracer, synchronous ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetExpPrologue( hDevice, pCount, phMetricProgrammables ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); } @@ -4408,94 +4489,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerEnableExpPrologue( hMetricTracer, synchronous ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); - } - - auto driver_result = pfnEnableExp( hMetricTracer, synchronous ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerEnableExpEpilogue( hMetricTracer, synchronous ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetExpPrologue( hDevice, pCount, phMetricProgrammables ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); } - return logAndPropagateResult_zetMetricTracerEnableExp(driver_result, hMetricTracer, synchronous); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDisableExp - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. - ) - { - context.logger->log_trace("zetMetricTracerDisableExp(hMetricTracer, synchronous)"); - - auto pfnDisableExp = context.zetDdiTable.MetricTracerExp.pfnDisableExp; - - if( nullptr == pfnDisableExp ) - return logAndPropagateResult_zetMetricTracerDisableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, synchronous); + auto driver_result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); - auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDisableExpPrologue( hMetricTracer, synchronous ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDisableExpPrologue( hMetricTracer, synchronous ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetExpEpilogue( hDevice, pCount, phMetricProgrammables ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); } - auto driver_result = pfnDisableExp( hMetricTracer, synchronous ); - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDisableExpEpilogue( hMetricTracer, synchronous ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phMetricProgrammables) && (i < *pCount); ++i){ + if (phMetricProgrammables[i]){ + context.handleLifetime->addHandle( phMetricProgrammables[i] ); + context.handleLifetime->addDependent( hDevice, phMetricProgrammables[i] ); + } + } } - - return logAndPropagateResult_zetMetricTracerDisableExp(driver_result, hMetricTracer, synchronous); + return logAndPropagateResult_zetMetricProgrammableGetExp(driver_result, hDevice, pCount, phMetricProgrammables); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerReadDataExp + /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { - context.logger->log_trace("zetMetricTracerReadDataExp(hMetricTracer, pRawDataSize, pRawData)"); + context.logger->log_trace("zetMetricProgrammableGetPropertiesExp(hMetricProgrammable, pProperties)"); - auto pfnReadDataExp = context.zetDdiTable.MetricTracerExp.pfnReadDataExp; + auto pfnGetPropertiesExp = context.zetDdiTable.MetricProgrammableExp.pfnGetPropertiesExp; - if( nullptr == pfnReadDataExp ) - return logAndPropagateResult_zetMetricTracerReadDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, pRawDataSize, pRawData); + if( nullptr == pfnGetPropertiesExp ) + return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pProperties); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerReadDataExpPrologue( hMetricTracer, pRawDataSize, pRawData ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetPropertiesExpPrologue( hMetricProgrammable, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); } @@ -4505,39 +4541,50 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerReadDataExpPrologue( hMetricTracer, pRawDataSize, pRawData ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetPropertiesExpPrologue( hMetricProgrammable, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); } - auto driver_result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + auto driver_result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerReadDataExpEpilogue( hMetricTracer, pRawDataSize, pRawData ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetPropertiesExpEpilogue( hMetricProgrammable, pProperties ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); } - return logAndPropagateResult_zetMetricTracerReadDataExp(driver_result, hMetricTracer, pRawDataSize, pRawData); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(driver_result, hMetricProgrammable, pProperties); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderCreateExp + /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { - context.logger->log_trace("zetMetricDecoderCreateExp(hMetricTracer, phMetricDecoder)"); + context.logger->log_trace("zetMetricProgrammableGetParamInfoExp(hMetricProgrammable, pParameterCount, pParameterInfo)"); - auto pfnCreateExp = context.zetDdiTable.MetricDecoderExp.pfnCreateExp; + auto pfnGetParamInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamInfoExp; - if( nullptr == pfnCreateExp ) - return logAndPropagateResult_zetMetricDecoderCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, phMetricDecoder); + if( nullptr == pfnGetParamInfoExp ) + return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pParameterCount, pParameterInfo); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderCreateExpPrologue( hMetricTracer, phMetricDecoder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamInfoExpPrologue( hMetricProgrammable, pParameterCount, pParameterInfo ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); } @@ -4547,47 +4594,51 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderCreateExpPrologue( hMetricTracer, phMetricDecoder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetParamInfoExpPrologue( hMetricProgrammable, pParameterCount, pParameterInfo ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); } - auto driver_result = pfnCreateExp( hMetricTracer, phMetricDecoder ); + auto driver_result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderCreateExpEpilogue( hMetricTracer, phMetricDecoder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamInfoExpEpilogue( hMetricProgrammable, pParameterCount, pParameterInfo ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - if (phMetricDecoder){ - context.handleLifetime->addHandle( *phMetricDecoder ); - context.handleLifetime->addDependent( hMetricTracer, *phMetricDecoder ); - - } } - return logAndPropagateResult_zetMetricDecoderCreateExp(driver_result, hMetricTracer, phMetricDecoder); + return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(driver_result, hMetricProgrammable, pParameterCount, pParameterInfo); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderDestroyExp + /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { - context.logger->log_trace("zetMetricDecoderDestroyExp(phMetricDecoder)"); + context.logger->log_trace("zetMetricProgrammableGetParamValueInfoExp(hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo)"); - auto pfnDestroyExp = context.zetDdiTable.MetricDecoderExp.pfnDestroyExp; + auto pfnGetParamValueInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamValueInfoExp; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zetMetricDecoderDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, phMetricDecoder); + if( nullptr == pfnGetParamValueInfoExp ) + return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderDestroyExpPrologue( phMetricDecoder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamValueInfoExpPrologue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); } @@ -4597,49 +4648,58 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderDestroyExpPrologue( phMetricDecoder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetParamValueInfoExpPrologue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); } - auto driver_result = pfnDestroyExp( phMetricDecoder ); + auto driver_result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderDestroyExpEpilogue( phMetricDecoder ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); + auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamValueInfoExpEpilogue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); } - return logAndPropagateResult_zetMetricDecoderDestroyExp(driver_result, phMetricDecoder); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + } + return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(driver_result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { - context.logger->log_trace("zetMetricDecoderGetDecodableMetricsExp(hMetricDecoder, pCount, phMetrics)"); + context.logger->log_trace("zetMetricCreateFromProgrammableExp2(hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles)"); - auto pfnGetDecodableMetricsExp = context.zetDdiTable.MetricDecoderExp.pfnGetDecodableMetricsExp; + auto pfnCreateFromProgrammableExp2 = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp2; - if( nullptr == pfnGetDecodableMetricsExp ) - return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricDecoder, pCount, phMetrics); + if( nullptr == pfnCreateFromProgrammableExp2 ) + return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderGetDecodableMetricsExpPrologue( hMetricDecoder, pCount, phMetrics ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); + auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExp2Prologue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); } @@ -4649,87 +4709,64 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderGetDecodableMetricsExpPrologue( hMetricDecoder, pCount, phMetrics ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricCreateFromProgrammableExp2Prologue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); } - auto driver_result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + auto driver_result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderGetDecodableMetricsExpEpilogue( hMetricDecoder, pCount, phMetrics ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); + auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExp2Epilogue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - for (size_t i = 0; ( nullptr != phMetrics) && (i < *pCount); ++i){ - if (phMetrics[i]){ - context.handleLifetime->addHandle( phMetrics[i] ); - context.handleLifetime->addDependent( hMetricDecoder, phMetrics[i] ); + for (size_t i = 0; ( nullptr != phMetricHandles) && (i < *pMetricHandleCount); ++i){ + if (phMetricHandles[i]){ + context.handleLifetime->addHandle( phMetricHandles[i] ); + context.handleLifetime->addDependent( hMetricProgrammable, phMetricHandles[i] ); } } } - return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(driver_result, hMetricDecoder, pCount, phMetrics); + return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(driver_result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDecodeExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { - context.logger->log_trace("zetMetricTracerDecodeExp(phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetricsLocal, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries)"); + context.logger->log_trace("zetMetricCreateFromProgrammableExp(hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles)"); - auto pfnDecodeExp = context.zetDdiTable.MetricTracerExp.pfnDecodeExp; + auto pfnCreateFromProgrammableExp = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp; - if( nullptr == pfnDecodeExp ) - return logAndPropagateResult_zetMetricTracerDecodeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); + if( nullptr == pfnCreateFromProgrammableExp ) + return logAndPropagateResult_zetMetricCreateFromProgrammableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDecodeExpPrologue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); + auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExpPrologue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); } @@ -4739,42 +4776,67 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDecodeExpPrologue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricCreateFromProgrammableExpPrologue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); } - auto driver_result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + auto driver_result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDecodeExpEpilogue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); + auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExpEpilogue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); } - return logAndPropagateResult_zetMetricTracerDecodeExp(driver_result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phMetricHandles) && (i < *pMetricHandleCount); ++i){ + if (phMetricHandles[i]){ + context.handleLifetime->addHandle( phMetricHandles[i] ); + context.handleLifetime->addDependent( hMetricProgrammable, phMetricHandles[i] ); + } + } + } + return logAndPropagateResult_zetMetricCreateFromProgrammableExp(driver_result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp + /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { - context.logger->log_trace("zetCommandListAppendMarkerExp(hCommandList, hMetricGroup, value)"); + context.logger->log_trace("zetDeviceCreateMetricGroupsFromMetricsExp(hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup)"); - auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; + auto pfnCreateMetricGroupsFromMetricsExp = context.zetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; - if( nullptr == pfnAppendMarkerExp ) - return logAndPropagateResult_zetCommandListAppendMarkerExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hMetricGroup, value); + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) + return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceCreateMetricGroupsFromMetricsExpPrologue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); } @@ -4784,38 +4846,55 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceCreateMetricGroupsFromMetricsExpPrologue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); } - auto driver_result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + auto driver_result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetCommandListAppendMarkerExpEpilogue( hCommandList, hMetricGroup, value ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceCreateMetricGroupsFromMetricsExpEpilogue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); } - return logAndPropagateResult_zetCommandListAppendMarkerExp(driver_result, hCommandList, hMetricGroup, value); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phMetricGroup) && (i < *pMetricGroupCount); ++i){ + if (phMetricGroup[i]){ + context.handleLifetime->addHandle( phMetricGroup[i] ); + context.handleLifetime->addDependent( hDevice, phMetricGroup[i] ); + } + } + } + return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(driver_result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp + /// @brief Intercept function for zetMetricGroupCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { - context.logger->log_trace("zetDeviceEnableMetricsExp(hDevice)"); + context.logger->log_trace("zetMetricGroupCreateExp(hDevice, pName, pDescription, samplingType, phMetricGroup)"); - auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + auto pfnCreateExp = context.zetDdiTable.MetricGroupExp.pfnCreateExp; - if( nullptr == pfnEnableMetricsExp ) - return logAndPropagateResult_zetDeviceEnableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + if( nullptr == pfnCreateExp ) + return logAndPropagateResult_zetMetricGroupCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pName, pDescription, samplingType, phMetricGroup); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceEnableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCreateExpPrologue( hDevice, pName, pDescription, samplingType, phMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); } @@ -4825,38 +4904,55 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceEnableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCreateExpPrologue( hDevice, pName, pDescription, samplingType, phMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); } - auto driver_result = pfnEnableMetricsExp( hDevice ); + auto driver_result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceEnableMetricsExpEpilogue( hDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCreateExpEpilogue( hDevice, pName, pDescription, samplingType, phMetricGroup ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); } - return logAndPropagateResult_zetDeviceEnableMetricsExp(driver_result, hDevice); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phMetricGroup){ + context.handleLifetime->addHandle( *phMetricGroup ); + context.handleLifetime->addDependent( hDevice, *phMetricGroup ); + + } + } + return logAndPropagateResult_zetMetricGroupCreateExp(driver_result, hDevice, pName, pDescription, samplingType, phMetricGroup); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceDisableMetricsExp + /// @brief Intercept function for zetMetricGroupAddMetricExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { - context.logger->log_trace("zetDeviceDisableMetricsExp(hDevice)"); + context.logger->log_trace("zetMetricGroupAddMetricExp(hMetricGroup, hMetric, pErrorStringSize, pErrorString)"); - auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; + auto pfnAddMetricExp = context.zetDdiTable.MetricGroupExp.pfnAddMetricExp; - if( nullptr == pfnDisableMetricsExp ) - return logAndPropagateResult_zetDeviceDisableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); + if( nullptr == pfnAddMetricExp ) + return logAndPropagateResult_zetMetricGroupAddMetricExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, hMetric, pErrorStringSize, pErrorString); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceDisableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupAddMetricExpPrologue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); } @@ -4866,60 +4962,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceDisableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupAddMetricExpPrologue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); } - auto driver_result = pfnDisableMetricsExp( hDevice ); + auto driver_result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceDisableMetricsExpEpilogue( hDevice ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupAddMetricExpEpilogue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); } - return logAndPropagateResult_zetDeviceDisableMetricsExp(driver_result, hDevice); + return logAndPropagateResult_zetMetricGroupAddMetricExp(driver_result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp + /// @brief Intercept function for zetMetricGroupRemoveMetricExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { - context.logger->log_trace("zetMetricGroupCalculateMultipleMetricValuesExp(hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues)"); + context.logger->log_trace("zetMetricGroupRemoveMetricExp(hMetricGroup, hMetric)"); - auto pfnCalculateMultipleMetricValuesExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + auto pfnRemoveMetricExp = context.zetDdiTable.MetricGroupExp.pfnRemoveMetricExp; - if( nullptr == pfnCalculateMultipleMetricValuesExp ) - return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + if( nullptr == pfnRemoveMetricExp ) + return logAndPropagateResult_zetMetricGroupRemoveMetricExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, hMetric); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMultipleMetricValuesExpPrologue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupRemoveMetricExpPrologue( hMetricGroup, hMetric ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); } @@ -4929,43 +5004,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCalculateMultipleMetricValuesExpPrologue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupRemoveMetricExpPrologue( hMetricGroup, hMetric ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); } - auto driver_result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + auto driver_result = pfnRemoveMetricExp( hMetricGroup, hMetric ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMultipleMetricValuesExpEpilogue( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupRemoveMetricExpEpilogue( hMetricGroup, hMetric ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); } - return logAndPropagateResult_zetMetricGroupCalculateMultipleMetricValuesExp(driver_result, hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + return logAndPropagateResult_zetMetricGroupRemoveMetricExp(driver_result, hMetricGroup, hMetric); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp + /// @brief Intercept function for zetMetricGroupCloseExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { - context.logger->log_trace("zetMetricGroupGetGlobalTimestampsExp(hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp)"); + context.logger->log_trace("zetMetricGroupCloseExp(hMetricGroup)"); - auto pfnGetGlobalTimestampsExp = context.zetDdiTable.MetricGroupExp.pfnGetGlobalTimestampsExp; + auto pfnCloseExp = context.zetDdiTable.MetricGroupExp.pfnCloseExp; - if( nullptr == pfnGetGlobalTimestampsExp ) - return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); + if( nullptr == pfnCloseExp ) + return logAndPropagateResult_zetMetricGroupCloseExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetGlobalTimestampsExpPrologue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCloseExpPrologue( hMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); } @@ -4975,50 +5045,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupGetGlobalTimestampsExpPrologue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCloseExpPrologue( hMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); } - auto driver_result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + auto driver_result = pfnCloseExp( hMetricGroup ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetGlobalTimestampsExpEpilogue( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCloseExpEpilogue( hMetricGroup ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zetMetricGroupGetGlobalTimestampsExp(driver_result, hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp); + return logAndPropagateResult_zetMetricGroupCloseExp(driver_result, hMetricGroup); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetExportDataExp + /// @brief Intercept function for zetMetricGroupDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { - context.logger->log_trace("zetMetricGroupGetExportDataExp(hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData)"); + context.logger->log_trace("zetMetricGroupDestroyExp(hMetricGroup)"); - auto pfnGetExportDataExp = context.zetDdiTable.MetricGroupExp.pfnGetExportDataExp; + auto pfnDestroyExp = context.zetDdiTable.MetricGroupExp.pfnDestroyExp; - if( nullptr == pfnGetExportDataExp ) - return logAndPropagateResult_zetMetricGroupGetExportDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zetMetricGroupDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetExportDataExpPrologue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupDestroyExpPrologue( hMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); } @@ -5028,65 +5086,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupGetExportDataExpPrologue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupDestroyExpPrologue( hMetricGroup ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); } - auto driver_result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + auto driver_result = pfnDestroyExp( hMetricGroup ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupGetExportDataExpEpilogue( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupGetExportDataExp(result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); + auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupDestroyExpEpilogue( hMetricGroup ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zetMetricGroupGetExportDataExp(driver_result, hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData); + return logAndPropagateResult_zetMetricGroupDestroyExp(driver_result, hMetricGroup); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp + /// @brief Intercept function for zetMetricDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { - context.logger->log_trace("zetMetricGroupCalculateMetricExportDataExp(hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues)"); + context.logger->log_trace("zetMetricDestroyExp(hMetric)"); - auto pfnCalculateMetricExportDataExp = context.zetDdiTable.MetricGroupExp.pfnCalculateMetricExportDataExp; + auto pfnDestroyExp = context.zetDdiTable.MetricExp.pfnDestroyExp; - if( nullptr == pfnCalculateMetricExportDataExp ) - return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zetMetricDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetric); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMetricExportDataExpPrologue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDestroyExpPrologue( hMetric ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); } @@ -5096,47 +5127,46 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCalculateMetricExportDataExpPrologue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricDestroyExpPrologue( hMetric ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); } - auto driver_result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + auto driver_result = pfnDestroyExp( hMetric ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCalculateMetricExportDataExpEpilogue( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDestroyExpEpilogue( hMetric ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); } - return logAndPropagateResult_zetMetricGroupCalculateMetricExportDataExp(driver_result, hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues); + return logAndPropagateResult_zetMetricDestroyExp(driver_result, hMetric); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetExp + /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetExp( + zetDeviceGetConcurrentMetricGroupsExp( zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { - context.logger->log_trace("zetMetricProgrammableGetExp(hDevice, pCount, phMetricProgrammables)"); + context.logger->log_trace("zetDeviceGetConcurrentMetricGroupsExp(hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount)"); - auto pfnGetExp = context.zetDdiTable.MetricProgrammableExp.pfnGetExp; + auto pfnGetConcurrentMetricGroupsExp = context.zetDdiTable.DeviceExp.pfnGetConcurrentMetricGroupsExp; - if( nullptr == pfnGetExp ) - return logAndPropagateResult_zetMetricProgrammableGetExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pCount, phMetricProgrammables); + if( nullptr == pfnGetConcurrentMetricGroupsExp ) + return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetExpPrologue( hDevice, pCount, phMetricProgrammables ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceGetConcurrentMetricGroupsExpPrologue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); } @@ -5146,49 +5176,51 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetExpPrologue( hDevice, pCount, phMetricProgrammables ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceGetConcurrentMetricGroupsExpPrologue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); } - auto driver_result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + auto driver_result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetExpEpilogue( hDevice, pCount, phMetricProgrammables ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetExp(result, hDevice, pCount, phMetricProgrammables); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceGetConcurrentMetricGroupsExpEpilogue( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - for (size_t i = 0; ( nullptr != phMetricProgrammables) && (i < *pCount); ++i){ - if (phMetricProgrammables[i]){ - context.handleLifetime->addHandle( phMetricProgrammables[i] ); - context.handleLifetime->addDependent( hDevice, phMetricProgrammables[i] ); - } - } } - return logAndPropagateResult_zetMetricProgrammableGetExp(driver_result, hDevice, pCount, phMetricProgrammables); + return logAndPropagateResult_zetDeviceGetConcurrentMetricGroupsExp(driver_result, hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp + /// @brief Intercept function for zetMetricTracerCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { - context.logger->log_trace("zetMetricProgrammableGetPropertiesExp(hMetricProgrammable, pProperties)"); + context.logger->log_trace("zetMetricTracerCreateExp(hContext, hDevice, metricGroupCount, phMetricGroupsLocal, desc, hNotificationEvent, phMetricTracer)"); - auto pfnGetPropertiesExp = context.zetDdiTable.MetricProgrammableExp.pfnGetPropertiesExp; + auto pfnCreateExp = context.zetDdiTable.MetricTracerExp.pfnCreateExp; - if( nullptr == pfnGetPropertiesExp ) - return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pProperties); + if( nullptr == pfnCreateExp ) + return logAndPropagateResult_zetMetricTracerCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetPropertiesExpPrologue( hMetricProgrammable, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerCreateExpPrologue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); } @@ -5198,50 +5230,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetPropertiesExpPrologue( hMetricProgrammable, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerCreateExpPrologue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); } - auto driver_result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + auto driver_result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetPropertiesExpEpilogue( hMetricProgrammable, pProperties ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(result, hMetricProgrammable, pProperties); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerCreateExpEpilogue( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerCreateExp(result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + if (phMetricTracer){ + context.handleLifetime->addHandle( *phMetricTracer ); + context.handleLifetime->addDependent( hContext, *phMetricTracer ); + + } } - return logAndPropagateResult_zetMetricProgrammableGetPropertiesExp(driver_result, hMetricProgrammable, pProperties); + return logAndPropagateResult_zetMetricTracerCreateExp(driver_result, hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp + /// @brief Intercept function for zetMetricTracerDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { - context.logger->log_trace("zetMetricProgrammableGetParamInfoExp(hMetricProgrammable, pParameterCount, pParameterInfo)"); + context.logger->log_trace("zetMetricTracerDestroyExp(hMetricTracer)"); - auto pfnGetParamInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamInfoExp; + auto pfnDestroyExp = context.zetDdiTable.MetricTracerExp.pfnDestroyExp; - if( nullptr == pfnGetParamInfoExp ) - return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pParameterCount, pParameterInfo); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zetMetricTracerDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamInfoExpPrologue( hMetricProgrammable, pParameterCount, pParameterInfo ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDestroyExpPrologue( hMetricTracer ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); } @@ -5251,51 +5280,43 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetParamInfoExpPrologue( hMetricProgrammable, pParameterCount, pParameterInfo ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); - } - - auto driver_result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); - - for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamInfoExpEpilogue( hMetricProgrammable, pParameterCount, pParameterInfo ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(result, hMetricProgrammable, pParameterCount, pParameterInfo); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDestroyExpPrologue( hMetricTracer ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); } + auto driver_result = pfnDestroyExp( hMetricTracer ); - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDestroyExpEpilogue( hMetricTracer ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDestroyExp(result, hMetricTracer); } - return logAndPropagateResult_zetMetricProgrammableGetParamInfoExp(driver_result, hMetricProgrammable, pParameterCount, pParameterInfo); + + return logAndPropagateResult_zetMetricTracerDestroyExp(driver_result, hMetricTracer); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp + /// @brief Intercept function for zetMetricTracerEnableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { - context.logger->log_trace("zetMetricProgrammableGetParamValueInfoExp(hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo)"); + context.logger->log_trace("zetMetricTracerEnableExp(hMetricTracer, synchronous)"); - auto pfnGetParamValueInfoExp = context.zetDdiTable.MetricProgrammableExp.pfnGetParamValueInfoExp; + auto pfnEnableExp = context.zetDdiTable.MetricTracerExp.pfnEnableExp; - if( nullptr == pfnGetParamValueInfoExp ) - return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); + if( nullptr == pfnEnableExp ) + return logAndPropagateResult_zetMetricTracerEnableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, synchronous); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamValueInfoExpPrologue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerEnableExpPrologue( hMetricTracer, synchronous ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); } @@ -5305,58 +5326,44 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricProgrammableGetParamValueInfoExpPrologue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerEnableExpPrologue( hMetricTracer, synchronous ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); } - auto driver_result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + auto driver_result = pfnEnableExp( hMetricTracer, synchronous ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricProgrammableGetParamValueInfoExpEpilogue( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerEnableExpEpilogue( hMetricTracer, synchronous ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerEnableExp(result, hMetricTracer, synchronous); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - } - return logAndPropagateResult_zetMetricProgrammableGetParamValueInfoExp(driver_result, hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo); + return logAndPropagateResult_zetMetricTracerEnableExp(driver_result, hMetricTracer, synchronous); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 + /// @brief Intercept function for zetMetricTracerDisableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { - context.logger->log_trace("zetMetricCreateFromProgrammableExp2(hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles)"); + context.logger->log_trace("zetMetricTracerDisableExp(hMetricTracer, synchronous)"); - auto pfnCreateFromProgrammableExp2 = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp2; + auto pfnDisableExp = context.zetDdiTable.MetricTracerExp.pfnDisableExp; - if( nullptr == pfnCreateFromProgrammableExp2 ) - return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); + if( nullptr == pfnDisableExp ) + return logAndPropagateResult_zetMetricTracerDisableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, synchronous); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExp2Prologue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDisableExpPrologue( hMetricTracer, synchronous ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); } @@ -5366,64 +5373,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricCreateFromProgrammableExp2Prologue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDisableExpPrologue( hMetricTracer, synchronous ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); } - auto driver_result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + auto driver_result = pfnDisableExp( hMetricTracer, synchronous ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExp2Epilogue( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDisableExpEpilogue( hMetricTracer, synchronous ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDisableExp(result, hMetricTracer, synchronous); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phMetricHandles) && (i < *pMetricHandleCount); ++i){ - if (phMetricHandles[i]){ - context.handleLifetime->addHandle( phMetricHandles[i] ); - context.handleLifetime->addDependent( hMetricProgrammable, phMetricHandles[i] ); - } - } - } - return logAndPropagateResult_zetMetricCreateFromProgrammableExp2(driver_result, hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles); + return logAndPropagateResult_zetMetricTracerDisableExp(driver_result, hMetricTracer, synchronous); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp + /// @brief Intercept function for zetMetricTracerReadDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { - context.logger->log_trace("zetMetricCreateFromProgrammableExp(hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles)"); + context.logger->log_trace("zetMetricTracerReadDataExp(hMetricTracer, pRawDataSize, pRawData)"); - auto pfnCreateFromProgrammableExp = context.zetDdiTable.MetricExp.pfnCreateFromProgrammableExp; + auto pfnReadDataExp = context.zetDdiTable.MetricTracerExp.pfnReadDataExp; - if( nullptr == pfnCreateFromProgrammableExp ) - return logAndPropagateResult_zetMetricCreateFromProgrammableExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); + if( nullptr == pfnReadDataExp ) + return logAndPropagateResult_zetMetricTracerReadDataExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, pRawDataSize, pRawData); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExpPrologue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerReadDataExpPrologue( hMetricTracer, pRawDataSize, pRawData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); } @@ -5433,67 +5423,39 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricCreateFromProgrammableExpPrologue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerReadDataExpPrologue( hMetricTracer, pRawDataSize, pRawData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); } - auto driver_result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + auto driver_result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricCreateFromProgrammableExpEpilogue( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricCreateFromProgrammableExp(result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerReadDataExpEpilogue( hMetricTracer, pRawDataSize, pRawData ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerReadDataExp(result, hMetricTracer, pRawDataSize, pRawData); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - for (size_t i = 0; ( nullptr != phMetricHandles) && (i < *pMetricHandleCount); ++i){ - if (phMetricHandles[i]){ - context.handleLifetime->addHandle( phMetricHandles[i] ); - context.handleLifetime->addDependent( hMetricProgrammable, phMetricHandles[i] ); - } - } - } - return logAndPropagateResult_zetMetricCreateFromProgrammableExp(driver_result, hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles); + return logAndPropagateResult_zetMetricTracerReadDataExp(driver_result, hMetricTracer, pRawDataSize, pRawData); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp + /// @brief Intercept function for zetMetricDecoderCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { - context.logger->log_trace("zetDeviceCreateMetricGroupsFromMetricsExp(hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup)"); + context.logger->log_trace("zetMetricDecoderCreateExp(hMetricTracer, phMetricDecoder)"); - auto pfnCreateMetricGroupsFromMetricsExp = context.zetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; + auto pfnCreateExp = context.zetDdiTable.MetricDecoderExp.pfnCreateExp; - if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) - return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); + if( nullptr == pfnCreateExp ) + return logAndPropagateResult_zetMetricDecoderCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricTracer, phMetricDecoder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceCreateMetricGroupsFromMetricsExpPrologue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderCreateExpPrologue( hMetricTracer, phMetricDecoder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); } @@ -5503,55 +5465,47 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceCreateMetricGroupsFromMetricsExpPrologue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderCreateExpPrologue( hMetricTracer, phMetricDecoder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); } - auto driver_result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + auto driver_result = pfnCreateExp( hMetricTracer, phMetricDecoder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetDeviceCreateMetricGroupsFromMetricsExpEpilogue( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderCreateExpEpilogue( hMetricTracer, phMetricDecoder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderCreateExp(result, hMetricTracer, phMetricDecoder); } if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - for (size_t i = 0; ( nullptr != phMetricGroup) && (i < *pMetricGroupCount); ++i){ - if (phMetricGroup[i]){ - context.handleLifetime->addHandle( phMetricGroup[i] ); - context.handleLifetime->addDependent( hDevice, phMetricGroup[i] ); - } + if (phMetricDecoder){ + context.handleLifetime->addHandle( *phMetricDecoder ); + context.handleLifetime->addDependent( hMetricTracer, *phMetricDecoder ); + } } - return logAndPropagateResult_zetDeviceCreateMetricGroupsFromMetricsExp(driver_result, hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup); + return logAndPropagateResult_zetMetricDecoderCreateExp(driver_result, hMetricTracer, phMetricDecoder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCreateExp + /// @brief Intercept function for zetMetricDecoderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { - context.logger->log_trace("zetMetricGroupCreateExp(hDevice, pName, pDescription, samplingType, phMetricGroup)"); + context.logger->log_trace("zetMetricDecoderDestroyExp(phMetricDecoder)"); - auto pfnCreateExp = context.zetDdiTable.MetricGroupExp.pfnCreateExp; + auto pfnDestroyExp = context.zetDdiTable.MetricDecoderExp.pfnDestroyExp; - if( nullptr == pfnCreateExp ) - return logAndPropagateResult_zetMetricGroupCreateExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pName, pDescription, samplingType, phMetricGroup); + if( nullptr == pfnDestroyExp ) + return logAndPropagateResult_zetMetricDecoderDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, phMetricDecoder); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCreateExpPrologue( hDevice, pName, pDescription, samplingType, phMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderDestroyExpPrologue( phMetricDecoder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); } @@ -5561,55 +5515,49 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCreateExpPrologue( hDevice, pName, pDescription, samplingType, phMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderDestroyExpPrologue( phMetricDecoder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); } - auto driver_result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + auto driver_result = pfnDestroyExp( phMetricDecoder ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCreateExpEpilogue( hDevice, pName, pDescription, samplingType, phMetricGroup ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCreateExp(result, hDevice, pName, pDescription, samplingType, phMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderDestroyExpEpilogue( phMetricDecoder ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderDestroyExp(result, phMetricDecoder); } - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phMetricGroup){ - context.handleLifetime->addHandle( *phMetricGroup ); - context.handleLifetime->addDependent( hDevice, *phMetricGroup ); - - } - } - return logAndPropagateResult_zetMetricGroupCreateExp(driver_result, hDevice, pName, pDescription, samplingType, phMetricGroup); + return logAndPropagateResult_zetMetricDecoderDestroyExp(driver_result, phMetricDecoder); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupAddMetricExp + /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { - context.logger->log_trace("zetMetricGroupAddMetricExp(hMetricGroup, hMetric, pErrorStringSize, pErrorString)"); + context.logger->log_trace("zetMetricDecoderGetDecodableMetricsExp(hMetricDecoder, pCount, phMetrics)"); - auto pfnAddMetricExp = context.zetDdiTable.MetricGroupExp.pfnAddMetricExp; + auto pfnGetDecodableMetricsExp = context.zetDdiTable.MetricDecoderExp.pfnGetDecodableMetricsExp; - if( nullptr == pfnAddMetricExp ) - return logAndPropagateResult_zetMetricGroupAddMetricExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, hMetric, pErrorStringSize, pErrorString); + if( nullptr == pfnGetDecodableMetricsExp ) + return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricDecoder, pCount, phMetrics); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupAddMetricExpPrologue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderGetDecodableMetricsExpPrologue( hMetricDecoder, pCount, phMetrics ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); } @@ -5619,39 +5567,87 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupAddMetricExpPrologue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricDecoderGetDecodableMetricsExpPrologue( hMetricDecoder, pCount, phMetrics ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); } - auto driver_result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + auto driver_result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupAddMetricExpEpilogue( hMetricGroup, hMetric, pErrorStringSize, pErrorString ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupAddMetricExp(result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); + auto result = context.validationHandlers[i]->zetValidation->zetMetricDecoderGetDecodableMetricsExpEpilogue( hMetricDecoder, pCount, phMetrics ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(result, hMetricDecoder, pCount, phMetrics); } - return logAndPropagateResult_zetMetricGroupAddMetricExp(driver_result, hMetricGroup, hMetric, pErrorStringSize, pErrorString); + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + for (size_t i = 0; ( nullptr != phMetrics) && (i < *pCount); ++i){ + if (phMetrics[i]){ + context.handleLifetime->addHandle( phMetrics[i] ); + context.handleLifetime->addDependent( hMetricDecoder, phMetrics[i] ); + } + } + } + return logAndPropagateResult_zetMetricDecoderGetDecodableMetricsExp(driver_result, hMetricDecoder, pCount, phMetrics); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupRemoveMetricExp + /// @brief Intercept function for zetMetricTracerDecodeExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { - context.logger->log_trace("zetMetricGroupRemoveMetricExp(hMetricGroup, hMetric)"); + context.logger->log_trace("zetMetricTracerDecodeExp(phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetricsLocal, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries)"); - auto pfnRemoveMetricExp = context.zetDdiTable.MetricGroupExp.pfnRemoveMetricExp; + auto pfnDecodeExp = context.zetDdiTable.MetricTracerExp.pfnDecodeExp; - if( nullptr == pfnRemoveMetricExp ) - return logAndPropagateResult_zetMetricGroupRemoveMetricExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup, hMetric); + if( nullptr == pfnDecodeExp ) + return logAndPropagateResult_zetMetricTracerDecodeExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupRemoveMetricExpPrologue( hMetricGroup, hMetric ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDecodeExpPrologue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); } @@ -5661,38 +5657,42 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupRemoveMetricExpPrologue( hMetricGroup, hMetric ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); + auto result = context.handleLifetime->zetHandleLifetime.zetMetricTracerDecodeExpPrologue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); } - auto driver_result = pfnRemoveMetricExp( hMetricGroup, hMetric ); + auto driver_result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupRemoveMetricExpEpilogue( hMetricGroup, hMetric ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupRemoveMetricExp(result, hMetricGroup, hMetric); + auto result = context.validationHandlers[i]->zetValidation->zetMetricTracerDecodeExpEpilogue( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricTracerDecodeExp(result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); } - return logAndPropagateResult_zetMetricGroupRemoveMetricExp(driver_result, hMetricGroup, hMetric); + return logAndPropagateResult_zetMetricTracerDecodeExp(driver_result, phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCloseExp + /// @brief Intercept function for zetCommandListAppendMarkerExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { - context.logger->log_trace("zetMetricGroupCloseExp(hMetricGroup)"); + context.logger->log_trace("zetCommandListAppendMarkerExp(hCommandList, hMetricGroup, value)"); - auto pfnCloseExp = context.zetDdiTable.MetricGroupExp.pfnCloseExp; + auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; - if( nullptr == pfnCloseExp ) - return logAndPropagateResult_zetMetricGroupCloseExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup); + if( nullptr == pfnAppendMarkerExp ) + return logAndPropagateResult_zetCommandListAppendMarkerExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, hMetricGroup, value); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCloseExpPrologue( hMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); } @@ -5702,38 +5702,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupCloseExpPrologue( hMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); + auto result = context.handleLifetime->zetHandleLifetime.zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); } - auto driver_result = pfnCloseExp( hMetricGroup ); + auto driver_result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupCloseExpEpilogue( hMetricGroup ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupCloseExp(result, hMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetCommandListAppendMarkerExpEpilogue( hCommandList, hMetricGroup, value ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetCommandListAppendMarkerExp(result, hCommandList, hMetricGroup, value); } - return logAndPropagateResult_zetMetricGroupCloseExp(driver_result, hMetricGroup); + return logAndPropagateResult_zetCommandListAppendMarkerExp(driver_result, hCommandList, hMetricGroup, value); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupDestroyExp + /// @brief Intercept function for zetDeviceEnableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { - context.logger->log_trace("zetMetricGroupDestroyExp(hMetricGroup)"); + context.logger->log_trace("zetDeviceEnableMetricsExp(hDevice)"); - auto pfnDestroyExp = context.zetDdiTable.MetricGroupExp.pfnDestroyExp; + auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zetMetricGroupDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetricGroup); + if( nullptr == pfnEnableMetricsExp ) + return logAndPropagateResult_zetDeviceEnableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupDestroyExpPrologue( hMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceEnableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); } @@ -5743,38 +5743,38 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricGroupDestroyExpPrologue( hMetricGroup ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceEnableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); } - auto driver_result = pfnDestroyExp( hMetricGroup ); + auto driver_result = pfnEnableMetricsExp( hDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricGroupDestroyExpEpilogue( hMetricGroup ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricGroupDestroyExp(result, hMetricGroup); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceEnableMetricsExpEpilogue( hDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceEnableMetricsExp(result, hDevice); } - return logAndPropagateResult_zetMetricGroupDestroyExp(driver_result, hMetricGroup); + return logAndPropagateResult_zetDeviceEnableMetricsExp(driver_result, hDevice); } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDestroyExp + /// @brief Intercept function for zetDeviceDisableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { - context.logger->log_trace("zetMetricDestroyExp(hMetric)"); + context.logger->log_trace("zetDeviceDisableMetricsExp(hDevice)"); - auto pfnDestroyExp = context.zetDdiTable.MetricExp.pfnDestroyExp; + auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; - if( nullptr == pfnDestroyExp ) - return logAndPropagateResult_zetMetricDestroyExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hMetric); + if( nullptr == pfnDisableMetricsExp ) + return logAndPropagateResult_zetDeviceDisableMetricsExp(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice); auto numValHandlers = context.validationHandlers.size(); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDestroyExpPrologue( hMetric ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceDisableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); } @@ -5784,18 +5784,18 @@ namespace validation_layer if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetMetricDestroyExpPrologue( hMetric ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceDisableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); } - auto driver_result = pfnDestroyExp( hMetric ); + auto driver_result = pfnDisableMetricsExp( hDevice ); for (size_t i = 0; i < numValHandlers; i++) { - auto result = context.validationHandlers[i]->zetValidation->zetMetricDestroyExpEpilogue( hMetric ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetMetricDestroyExp(result, hMetric); + auto result = context.validationHandlers[i]->zetValidation->zetDeviceDisableMetricsExpEpilogue( hDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zetDeviceDisableMetricsExp(result, hDevice); } - return logAndPropagateResult_zetMetricDestroyExp(driver_result, hMetric); + return logAndPropagateResult_zetDeviceDisableMetricsExp(driver_result, hDevice); } } // namespace validation_layer diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index 1796d71f..e036567c 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -12709,14 +12709,15 @@ zeKernelSetGlobalOffsetExp( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel binary program data (ISA GEN format). +/// @brief Reserve Cache on Device /// /// @details -/// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data -/// for kernel handle. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The application may call this function but may not be successful as +/// some other application may have reserve prior +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12733,15 +12734,15 @@ zeKernelSetGlobalOffsetExp( /// - ::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 == pSize` -/// + `nullptr == pKernelBinary` +/// + `nullptr == hDevice` ze_result_t ZE_APICALL -zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. +zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12749,42 +12750,40 @@ zeKernelGetBinaryExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp = [&result] { - auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) { + static const ze_pfnDeviceReserveCacheExt_t pfnReserveCacheExt = [&result] { + auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBinaryExp; + return pfnReserveCacheExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) { + auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Import an external semaphore +/// @brief Assign VA section to use reserved section /// /// @details -/// - Imports an external semaphore. -/// - This function may be called from simultaneous threads with the same -/// device handle. -/// - The implementation of this function should be lock-free. +/// - The application may call this function to assign VA to particular +/// reservartion region /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12803,16 +12802,16 @@ zeKernelGetBinaryExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phSemaphore` +/// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1ff < desc->flags` +/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. +zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12820,43 +12819,52 @@ zeDeviceImportExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt = [&result] { - auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) { + static const ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt = [&result] { + auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImportExternalSemaphoreExt; + return pfnSetCacheAdviceExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) { + auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Release an external semaphore +/// @brief Query event timestamps for a device or sub-device. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the semaphore before it is released. -/// - The application must **not** call this function from simultaneous -/// threads with the same semaphore handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12873,11 +12881,22 @@ zeDeviceImportExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hSemaphore` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. +zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12885,43 +12904,46 @@ zeDeviceReleaseExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt = [&result] { - auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) { + static const ze_pfnEventQueryTimestampsExp_t pfnQueryTimestampsExp = [&result] { + auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReleaseExternalSemaphoreExt; + return pfnQueryTimestampsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReleaseExternalSemaphoreExt( hSemaphore ); + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) { + auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReleaseExternalSemaphoreExt( hSemaphore ); + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Signal an external semaphore +/// @brief Query image memory properties. /// /// @details -/// - Signals an external semaphore. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - 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. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -12929,6 +12951,7 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::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 @@ -12937,30 +12960,13 @@ zeDeviceReleaseExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == signalParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == signalParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list +/// + `nullptr == pMemoryProperties` ze_result_t ZE_APICALL -zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -12968,43 +12974,53 @@ zeCommandListAppendSignalExternalSemaphoreExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt = [&result] { - auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { + static const ze_pfnImageGetMemoryPropertiesExp_t pfnGetMemoryPropertiesExp = [&result] { + auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalExternalSemaphoreExt; + return pfnGetMemoryPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { + auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Wait on external semaphores +/// @brief Create image view on the context. /// /// @details -/// - Waits on external semaphores. -/// - This function must only be used with an immediate command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXT_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13012,6 +13028,7 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::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 @@ -13020,72 +13037,80 @@ zeCommandListAppendSignalExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSemaphores` -/// + `nullptr == waitParams` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` -/// + `(nullptr == waitParams) && (0 < numSemaphores)` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Commandlist handle does not correspond to an immediate command list +/// + `nullptr == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ze_result_t ZE_APICALL -zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ) -{ - #ifdef L0_STATIC_LOADER_BUILD - ze_result_t result = ZE_RESULT_SUCCESS; - if(ze_lib::destruction) { +zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt = [&result] { - auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { + static const ze_pfnImageViewCreateExt_t pfnViewCreateExt = [&result] { + auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitExternalSemaphoreExt; + return pfnViewCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { + auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Create image view on the context. /// /// @details +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXP_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// - Note: This function is deprecated and replaced by +/// ::zeImageViewCreateExt. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13102,18 +13127,24 @@ zeCommandListAppendWaitExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` +/// + `nullptr == desc` +/// + `nullptr == phImageView` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ze_result_t ZE_APICALL -zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object +zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13121,40 +13152,47 @@ zeRTASBuilderCreateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + static const ze_pfnImageViewCreateExp_t pfnViewCreateExp = [&result] { + auto pfnViewCreateExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnViewCreateExp; + if( nullptr == pfnViewCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnViewCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnViewCreateExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnViewCreateExp; + if( nullptr == pfnViewCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief Provide kernel scheduling hints that may improve performance /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The scheduling hints may improve performance only and are not required +/// for correctness. +/// - If a specified scheduling hint is unsupported it will be silently +/// ignored. +/// - If two conflicting scheduling hints are specified there is no defined behavior; +/// the hints may be ignored or one hint may be chosen arbitrarily. +/// - The application must not call this function from simultaneous threads +/// with the same kernel handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13171,20 +13209,16 @@ zeRTASBuilderCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` +/// + `nullptr == pHint` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// + `0x7 < pHint->flags` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties +zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13192,42 +13226,47 @@ zeRTASBuilderGetBuildPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { - auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + static const ze_pfnKernelSchedulingHintExp_t pfnSchedulingHintExp = [&result] { + auto pfnSchedulingHintExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSchedulingHintExp; + if( nullptr == pfnSchedulingHintExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExt; + return pfnSchedulingHintExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnSchedulingHintExp( hKernel, pHint ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + auto pfnSchedulingHintExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSchedulingHintExp; + if( nullptr == pfnSchedulingHintExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnSchedulingHintExp( hKernel, pHint ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @brief Get PCI properties - address, max speed /// /// @details /// - 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. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns +/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -13241,20 +13280,13 @@ zeRTASBuilderGetBuildPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pPciProperties` ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B +zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13262,83 +13294,66 @@ zeDriverRTASFormatCompatibilityCheckExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { - auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + static const ze_pfnDevicePciGetPropertiesExt_t pfnPciGetPropertiesExt = [&result] { + auto pfnPciGetPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnPciGetPropertiesExt; + if( nullptr == pfnPciGetPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExt; + return pfnPciGetPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnPciGetPropertiesExt( hDevice, pPciProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + auto pfnPciGetPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnPciGetPropertiesExt; + if( nullptr == pfnPciGetPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnPciGetPropertiesExt( hDevice, pPciProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Copies from an image to device or shared memory. /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. -/// - 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. -/// - 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. -/// - 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. -/// - 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. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - 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. -/// - A successfully constructed acceleration structure is generally -/// non-copyable. It can only get copied from host to device using the -/// special ::zeRTASBuilderCommandListAppendCopyExt function. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." +/// - The application must ensure the memory pointed to by dstptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the source +/// image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, 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. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueReadImage /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13355,37 +13370,28 @@ zeDriverRTASFormatCompatibilityCheckExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hCommandList` +/// + `nullptr == hSrcImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes +zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13393,56 +13399,67 @@ zeRTASBuilderBuildExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { - auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) { + static const ze_pfnCommandListAppendImageCopyToMemoryExt_t pfnAppendImageCopyToMemoryExt = [&result] { + auto pfnAppendImageCopyToMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemoryExt; + if( nullptr == pfnAppendImageCopyToMemoryExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExt; + return pfnAppendImageCopyToMemoryExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) { + auto pfnAppendImageCopyToMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemoryExt; + if( nullptr == pfnAppendImageCopyToMemoryExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device -/// memory. +/// @brief Copies to an image from device or shared memory. /// /// @details -/// - The memory pointed to by srcptr must be host memory containing a valid -/// ray tracing acceleration structure. -/// - The number of bytes to copy must be larger or equal to the size of the -/// ray tracing acceleration structure. -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. -/// - 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, -/// and the memory was allocated, on the same context. +/// - The application must ensure the memory pointed to by srcptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by srcptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the +/// destination image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, 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. /// +/// @remarks +/// _Analogues_ +/// - clEnqueueWriteImage +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -13459,20 +13476,22 @@ zeRTASBuilderBuildExt( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` +/// + `nullptr == hDstImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` /// + `nullptr == srcptr` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeRTASBuilderCommandListAppendCopyExt( +zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -13485,43 +13504,39 @@ zeRTASBuilderCommandListAppendCopyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { - auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + static const ze_pfnCommandListAppendImageCopyFromMemoryExt_t pfnAppendImageCopyFromMemoryExt = [&result] { + auto pfnAppendImageCopyFromMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemoryExt; + if( nullptr == pfnAppendImageCopyFromMemoryExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCommandListAppendCopyExt; + return pfnAppendImageCopyFromMemoryExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + auto pfnAppendImageCopyFromMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemoryExt; + if( nullptr == pfnAppendImageCopyFromMemoryExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Retrieves attributes of an image allocation /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. -/// - The implementation of this function must be thread-safe. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13538,11 +13553,15 @@ zeRTASBuilderCommandListAppendCopyExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pImageAllocProperties` ze_result_t ZE_APICALL -zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy +zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13550,42 +13569,44 @@ zeRTASBuilderDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnImageGetAllocPropertiesExt_t pfnGetAllocPropertiesExt = [&result] { + auto pfnGetAllocPropertiesExt = ze_lib::context->zeDdiTable.load()->Image.pfnGetAllocPropertiesExt; + if( nullptr == pfnGetAllocPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnGetAllocPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hBuilder ); + return pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetAllocPropertiesExt = ze_lib::context->zeDdiTable.load()->Image.pfnGetAllocPropertiesExt; + if( nullptr == pfnGetAllocPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hBuilder ); + return pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object +/// @brief List Imports & Exports /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. +/// - List all the import & unresolveable import dependencies & exports of a +/// set of modules +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13601,14 +13622,21 @@ zeRTASBuilderDestroyExt( /// - ::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 == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` +/// + `nullptr == pInspectDesc` +/// + `nullptr == phModules` +/// + `nullptr == phLog` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < pInspectDesc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object +zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13616,45 +13644,44 @@ zeRTASParallelOperationCreateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt = [&result] { - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + static const ze_pfnModuleInspectLinkageExt_t pfnInspectLinkageExt = [&result] { + auto pfnInspectLinkageExt = ze_lib::context->zeDdiTable.load()->Module.pfnInspectLinkageExt; + if( nullptr == pfnInspectLinkageExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnInspectLinkageExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hDriver, phParallelOperation ); + return pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnInspectLinkageExt = ze_lib::context->zeDdiTable.load()->Module.pfnInspectLinkageExt; + if( nullptr == pfnInspectLinkageExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt( hDriver, phParallelOperation ); + return pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. +/// - 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. +/// - The application must **not** call this function from simultaneous +/// threads with the same pointer. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -13672,13 +13699,18 @@ zeRTASParallelOperationCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == pMemFreeDesc` +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < pMemFreeDesc->freePolicy` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties +zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13686,40 +13718,42 @@ zeRTASParallelOperationGetPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt = [&result] { - auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) { + static const ze_pfnMemFreeExt_t pfnFreeExt = [&result] { + auto pfnFreeExt = ze_lib::context->zeDdiTable.load()->Mem.pfnFreeExt; + if( nullptr == pfnFreeExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExt; + return pfnFreeExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExt( hParallelOperation, pProperties ); + return pfnFreeExt( hContext, pMemFreeDesc, ptr ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) { + auto pfnFreeExt = ze_lib::context->zeDdiTable.load()->Mem.pfnFreeExt; + if( nullptr == pfnFreeExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExt( hParallelOperation, pProperties ); + return pfnFreeExt( hContext, pMemFreeDesc, ptr ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Retrieves fabric vertices within a driver /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13736,10 +13770,21 @@ zeRTASParallelOperationGetPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object +zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13747,45 +13792,44 @@ zeRTASParallelOperationJoinExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt = [&result] { - auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) { + static const ze_pfnFabricVertexGetExp_t pfnGetExp = [&result] { + auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetExp; + if( nullptr == pfnGetExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExt; + return pfnGetExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnJoinExt( hParallelOperation ); + return pfnGetExp( hDriver, pCount, phVertices ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) { + auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetExp; + if( nullptr == pfnGetExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExt( hParallelOperation ); + return pfnGetExp( hDriver, pCount, phVertices ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Retrieves a fabric sub-vertex from a fabric vertex /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. -/// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. -/// - The implementation of this function must be thread-safe. +/// - Multiple calls to this function will return identical fabric vertex +/// handles, in the same order. +/// - The number of handles returned from this function is affected by the +/// `ZE_AFFINITY_MASK` environment variable. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13802,10 +13846,21 @@ zeRTASParallelOperationJoinExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13813,46 +13868,38 @@ zeRTASParallelOperationDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnFabricVertexGetSubVerticesExp_t pfnGetSubVerticesExp = [&result] { + auto pfnGetSubVerticesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetSubVerticesExp; + if( nullptr == pfnGetSubVerticesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnGetSubVerticesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hParallelOperation ); + return pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetSubVerticesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetSubVerticesExp; + if( nullptr == pfnGetSubVerticesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hParallelOperation ); + return pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves the vector width properties of the device. +/// @brief Retrieves properties of the fabric vertex. /// /// @details -/// - Properties are reported for each vector width supported by the device. -/// - Multiple calls to this function will return properties in the same -/// order. -/// - The number of vector width properties is reported thru the pCount -/// parameter which is updated by the driver given pCount == 0. -/// - The application may provide a buffer that is larger than the number of -/// properties, but the application must set pCount to the number of -/// properties to retrieve. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -13871,21 +13918,13 @@ zeRTASParallelOperationDestroyExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hVertex` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == pVertexProperties` ze_result_t ZE_APICALL -zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. +zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13893,42 +13932,40 @@ zeDeviceGetVectorWidthPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt = [&result] { - auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) { + static const ze_pfnFabricVertexGetPropertiesExp_t pfnGetPropertiesExp = [&result] { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVectorWidthPropertiesExt; + return pfnGetPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + return pfnGetPropertiesExp( hVertex, pVertexProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + return pfnGetPropertiesExp( hVertex, pVertexProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves kernel allocation properties. +/// @brief Returns device handle from fabric vertex handle. /// /// @details -/// - A valid kernel handle must be created with ::zeKernelCreate. -/// - Returns array of kernel allocation properties for kernel handle. /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -13945,22 +13982,17 @@ zeDeviceGetVectorWidthPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` +/// + `nullptr == hVertex` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == phDevice` +/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE +/// + Provided fabric vertex handle does not correspond to a device or subdevice. +/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE +/// + Provided fabric vertex handle corresponds to remote device or subdevice. ze_result_t ZE_APICALL -zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. +zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { #ifdef L0_STATIC_LOADER_BUILD @@ -13968,53 +14000,40 @@ zeKernelGetAllocationPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelGetAllocationPropertiesExp_t pfnGetAllocationPropertiesExp = [&result] { - auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) { + static const ze_pfnFabricVertexGetDeviceExp_t pfnGetDeviceExp = [&result] { + auto pfnGetDeviceExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetDeviceExp; + if( nullptr == pfnGetDeviceExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocationPropertiesExp; + return pfnGetDeviceExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + return pfnGetDeviceExp( hVertex, phDevice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) { + auto pfnGetDeviceExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetDeviceExp; + if( nullptr == pfnGetDeviceExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + return pfnGetDeviceExp( hVertex, phDevice ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an IPC memory handle for the specified allocation with -/// properties for the requested handle. +/// @brief Returns fabric vertex handle from device 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. /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14031,16 +14050,15 @@ zeKernelGetAllocationPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// + `nullptr == pIpcHandle` +/// + `nullptr == phVertex` +/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX +/// + Provided device handle does not correspond to a fabric vertex. ze_result_t ZE_APICALL -zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle +zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14048,43 +14066,42 @@ zeMemGetIpcHandleWithProperties( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetIpcHandleWithProperties_t pfnGetIpcHandleWithProperties = [&result] { - auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) { + static const ze_pfnDeviceGetFabricVertexExp_t pfnGetFabricVertexExp = [&result] { + auto pfnGetFabricVertexExp = ze_lib::context->zeDdiTable.load()->DeviceExp.pfnGetFabricVertexExp; + if( nullptr == pfnGetFabricVertexExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleWithProperties; + return pfnGetFabricVertexExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + return pfnGetFabricVertexExp( hDevice, phVertex ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) { + auto pfnGetFabricVertexExp = ze_lib::context->zeDdiTable.load()->DeviceExp.pfnGetFabricVertexExp; + if( nullptr == pfnGetFabricVertexExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + return pfnGetFabricVertexExp( hDevice, phVertex ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a new graph object. +/// @brief Retrieves all fabric edges between provided pair of fabric vertices /// /// @details -/// - A newly created graph is an empty container for captured operations. -/// - The application may instantiate executable graph objects from a -/// recorded graph using ::zeGraphInstantiateExt. -/// - The application may begin capturing into an empty graph using -/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - A fabric edge represents one or more physical links between two fabric +/// vertices. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14101,121 +14118,66 @@ zeMemGetIpcHandleWithProperties( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hVertexA` +/// + `nullptr == hVertexB` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created - ) -{ - #ifdef L0_STATIC_LOADER_BUILD - ze_result_t result = ZE_RESULT_SUCCESS; - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - static const ze_pfnGraphCreateExt_t pfnCreateExt = [&result] { - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; - if( nullptr == pfnCreateExt ) { +zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnFabricEdgeGetExp_t pfnGetExp = [&result] { + auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetExp; + if( nullptr == pfnGetExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnGetExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hContext, pNext, phGraph ); + return pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetExp; + if( nullptr == pfnGetExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt( hContext, pNext, phGraph ); + return pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Begins recording asynchronous append operations into a new graph -/// associated with an immediate command list. +/// @brief Retrieves fabric vertices connected by a fabric edge /// /// @details -/// - Graph capture is intended for asynchronous append operations only; -/// synchronous operations are not supported while capture is active and -/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. -/// - The application must call this function only with an immediate command -/// list. -/// - The application must not call this function with a synchronous -/// immediate command list. -/// - After this call succeeds, append operations issued to the command list -/// are recorded into a graph and are not submitted to the device. Events -/// used by these operations are not signaled until capture ends and the -/// graph is instantiated and executed. -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while -/// capture is active, calling -/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command -/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is -/// active, calling ::zeCommandListAppendGraphExt on the capturing command -/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). -/// - While capture is active, host-side synchronization operations on -/// recorded work, such as ::zeCommandListHostSynchronize or -/// ::zeEventHostSynchronize, return -/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. -/// - While capture is active, internal counter-based events (i.e. without -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph -/// cannot be used outside the graph; such use returns an error -/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). -/// - The command list on which capture starts is called the primary command -/// list for a given capture session. -/// - If an event signaled by a captured command list is used in the wait -/// list of another immediate command list, that command list also enters -/// graph capture mode. This creates a fork. The command list from which -/// the fork originated is called the parent, and the forked command list -/// is called the child. A child command list may itself be used to create -/// additional forks, resulting in a tree of command lists participating -/// in the same graph capture. -/// - Subsequent signals from the parent command list to a child command -/// list are allowed and do not create additional forks or capture -/// sessions; the child command list remains in the same capture session -/// as the parent command list. -/// - Each fork must be joined by signaling on the child command list and by -/// waiting on the parent command list. -/// - A child command list may signal multiple times back to the parent -/// command list, but only the last signal on the child command list may -/// become part of the join operation. -/// - Child command lists continue recording as long as the primary command -/// list is in capture mode. -/// - Commands that append work (for example, compute kernels or data -/// transfers) to a recording child command list after the intended join -/// operation are treated as unjoined work, and the graph is considered -/// invalid. Commands that do not append work (for example, event signal -/// and wait operations) are allowed after the join operation and do not -/// invalidate the graph. -/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt -/// apply to recording child command lists as well. -/// - It is invalid to merge two separate graph capture sessions (i.e. with -/// different primary command lists) by waiting on an event associated -/// with a different graph (operation will return -/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). -/// - If the device does not support -/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event -/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error -/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append -/// operations. +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices via a fabric edge. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14232,12 +14194,15 @@ zeGraphCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hEdge` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phVertexA` +/// + `nullptr == phVertexB` ze_result_t ZE_APICALL -zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14245,45 +14210,40 @@ zeCommandListBeginGraphCaptureExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListBeginGraphCaptureExt_t pfnBeginGraphCaptureExt = [&result] { - auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnBeginGraphCaptureExt ) { + static const ze_pfnFabricEdgeGetVerticesExp_t pfnGetVerticesExp = [&result] { + auto pfnGetVerticesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetVerticesExp; + if( nullptr == pfnGetVerticesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBeginGraphCaptureExt; + return pfnGetVerticesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBeginGraphCaptureExt( hCommandList, pNext ); + return pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnBeginGraphCaptureExt ) { + auto pfnGetVerticesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetVerticesExp; + if( nullptr == pfnGetVerticesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBeginGraphCaptureExt( hCommandList, pNext ); + return pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Begins recording asynchronous append operations into an existing -/// graph. +/// @brief Retrieves properties of the fabric edge. /// /// @details -/// - The graph must be created with ::zeGraphCreateExt before calling this -/// function. -/// - The graph must be empty when capture begins. -/// - After this call succeeds, the command list enters graph capture mode -/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt -/// apply. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14300,14 +14260,13 @@ zeCommandListBeginGraphCaptureExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hGraph` +/// + `nullptr == hEdge` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pEdgeProperties` ze_result_t ZE_APICALL -zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14315,42 +14274,58 @@ zeCommandListBeginCaptureIntoGraphExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListBeginCaptureIntoGraphExt_t pfnBeginCaptureIntoGraphExt = [&result] { - auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnBeginCaptureIntoGraphExt ) { + static const ze_pfnFabricEdgeGetPropertiesExp_t pfnGetPropertiesExp = [&result] { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBeginCaptureIntoGraphExt; + return pfnGetPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + return pfnGetPropertiesExp( hEdge, pEdgeProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnBeginCaptureIntoGraphExt ) { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + return pfnGetPropertiesExp( hEdge, pEdgeProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries whether a command list is in graph capture mode. +/// @brief Query an event's timestamp value on the host, with domain preference. /// /// @details -/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is -/// in graph capture mode. -/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is -/// not in graph capture mode. +/// - For collecting *only* kernel timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. +/// - For collecting synchronized timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps +/// are also available from this type of event pool, but there is a +/// performance cost. +/// - The destination memory will be unmodified if the event has not been +/// signaled. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14367,10 +14342,29 @@ zeCommandListBeginCaptureIntoGraphExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list +zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14378,57 +14372,41 @@ zeCommandListIsGraphCaptureEnabledExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListIsGraphCaptureEnabledExt_t pfnIsGraphCaptureEnabledExt = [&result] { - auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnIsGraphCaptureEnabledExt ) { + static const ze_pfnEventQueryKernelTimestampsExt_t pfnQueryKernelTimestampsExt = [&result] { + auto pfnQueryKernelTimestampsExt = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestampsExt; + if( nullptr == pfnQueryKernelTimestampsExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsGraphCaptureEnabledExt; + return pfnQueryKernelTimestampsExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnIsGraphCaptureEnabledExt( hCommandList ); + return pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnIsGraphCaptureEnabledExt ) { + auto pfnQueryKernelTimestampsExt = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestampsExt; + if( nullptr == pfnQueryKernelTimestampsExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsGraphCaptureEnabledExt( hCommandList ); + return pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Ends graph capture on the primary command list and returns the -/// recorded graph. +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details -/// - This function may only be called on the primary command list used with -/// ::zeCommandListBeginGraphCaptureExt or -/// ::zeCommandListBeginCaptureIntoGraphExt. -/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, -/// the returned graph handle is the same graph handle that was provided -/// when capture began. -/// - The returned graph must be instantiated before execution. -/// - This call ends graph capture mode on all command lists participating -/// in the same graph capture (including forks). -/// - After this call succeeds, subsequent append operations submit work to -/// the device normally. -/// - If capture mode is not active on the command list, an error is -/// returned. -/// - After this call succeeds, events signaled by previously captured -/// commands do not create new forks. -/// - After this call succeeds, internal counter-based events (i.e. without -/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the -/// application and don't interfere with recorded state. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14445,19 +14423,18 @@ zeCommandListIsGraphCaptureEnabledExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS -/// + if graph contains unjoined forks -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING -/// + if command list is not in graph capture mode +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle +zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14465,46 +14442,40 @@ zeCommandListEndGraphCaptureExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListEndGraphCaptureExt_t pfnEndGraphCaptureExt = [&result] { - auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnEndGraphCaptureExt ) { + static const ze_pfnRTASBuilderCreateExp_t pfnCreateExp = [&result] { + auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEndGraphCaptureExt; + return pfnCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + return pfnCreateExp( hDriver, pDescriptor, phBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnEndGraphCaptureExt ) { + auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + return pfnCreateExp( hDriver, pDescriptor, phBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the graph associated with a command list that is in graph -/// capture mode. +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - This function may only be called while the command list is in graph -/// capture mode. -/// - The returned graph handle cannot be instantiated until capture is -/// ended by ::zeCommandListEndGraphCaptureExt. -/// - This function does not transfer ownership of the graph handle. -/// - If the command list is not in graph capture mode, an error is returned -/// and `*phGraph` is set to null. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14521,15 +14492,20 @@ zeCommandListEndGraphCaptureExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING -/// + if command list is not in graph capture mode +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list +zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14537,46 +14513,42 @@ zeCommandListGetGraphExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListGetGraphExt_t pfnGetGraphExt = [&result] { - auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; - if( nullptr == pfnGetGraphExt ) { + static const ze_pfnRTASBuilderGetBuildPropertiesExp_t pfnGetBuildPropertiesExp = [&result] { + auto pfnGetBuildPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnGetBuildPropertiesExp; + if( nullptr == pfnGetBuildPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGraphExt; + return pfnGetBuildPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetGraphExt( hCommandList, phGraph ); + return pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; - if( nullptr == pfnGetGraphExt ) { + auto pfnGetBuildPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnGetBuildPropertiesExp; + if( nullptr == pfnGetBuildPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGraphExt( hCommandList, phGraph ); + return pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the primary command list associated with a graph capture -/// session. +/// @brief Checks ray tracing acceleration structure format compatibility /// /// @details -/// - The returned command list is the command list that initiated capture -/// for the graph during its recording stage. -/// - This function can be called while the graph is being recorded and -/// after capture has ended. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -14590,14 +14562,20 @@ zeCommandListGetGraphExt( /// - ::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 == phCommandList` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. ze_result_t ZE_APICALL -zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph +zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14605,44 +14583,83 @@ zeGraphGetPrimaryCommandListExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt = [&result] { - auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnGetPrimaryCommandListExt ) { + static const ze_pfnDriverRTASFormatCompatibilityCheckExp_t pfnRTASFormatCompatibilityCheckExp = [&result] { + auto pfnRTASFormatCompatibilityCheckExp = ze_lib::context->zeDdiTable.load()->DriverExp.pfnRTASFormatCompatibilityCheckExp; + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPrimaryCommandListExt; + return pfnRTASFormatCompatibilityCheckExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + return pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnGetPrimaryCommandListExt ) { + auto pfnRTASFormatCompatibilityCheckExp = ze_lib::context->zeDdiTable.load()->DriverExp.pfnRTASFormatCompatibilityCheckExp; + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + return pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Registers a host callback that is invoked when a graph is destroyed. +/// @brief Build ray tracing acceleration structure /// /// @details -/// - Callbacks may be registered while a graph is being recorded or after -/// executable graph instances have been created from it. -/// - Multiple callbacks may be registered for the same graph. -/// - All registered callbacks are invoked when the graph is destroyed. -/// - The callback must not call Level Zero APIs that use the graph being -/// destroyed. +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - It is the user's responsibility to manage the acceleration structure +/// buffer allocation, de-allocation, and potential prefetching to the +/// device memory. The required size of the acceleration structure buffer +/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. +/// The acceleration structure buffer must be a shared USM allocation and +/// should be present on the host at build time. The referenced scene data +/// (index- and vertex- buffers) can be standard host allocations, and +/// will not be referenced into by the build acceleration structure. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes based on a query for the estimated size properties. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. +/// - When using the "expected" size for the acceleration structure buffer, +/// the acceleration structure construction may fail with +/// ::ZE_RESULT_EXP_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. +/// - 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. +/// - All provided data buffers must be host-accessible. +/// - The acceleration structure buffer must be a USM allocation. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - Acceleration structure construction may be parallelized by passing a +/// valid handle to a parallel operation object and joining that parallel +/// operation using ::zeRTASParallelOperationJoinExp with user-provided +/// worker threads. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14659,14 +14676,37 @@ zeGraphGetPrimaryCommandListExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. ze_result_t ZE_APICALL -zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14674,58 +14714,43 @@ zeGraphSetDestructionCallbackExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt = [&result] { - auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnSetDestructionCallbackExt ) { + static const ze_pfnRTASBuilderBuildExp_t pfnBuildExp = [&result] { + auto pfnBuildExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnBuildExp; + if( nullptr == pfnBuildExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetDestructionCallbackExt; + return pfnBuildExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + return pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnSetDestructionCallbackExt ) { + auto pfnBuildExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnBuildExp; + if( nullptr == pfnBuildExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + return pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an executable graph object from a recorded graph. +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @details -/// - Multiple executable graph objects may be created from a single -/// recorded graph. -/// - 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. +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14742,15 +14767,11 @@ zeGraphSetDestructionCallbackExt( /// - ::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 == phExecutableGraph` +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph +zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14758,53 +14779,42 @@ zeGraphInstantiateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphInstantiateExt_t pfnInstantiateExt = [&result] { - auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; - if( nullptr == pfnInstantiateExt ) { + static const ze_pfnRTASBuilderDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnInstantiateExt; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + return pfnDestroyExp( hBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; - if( nullptr == pfnInstantiateExt ) { + auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + return pfnDestroyExp( hBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends execution of an executable graph to a command list. +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - The destination command list must match the type and execution -/// characteristics of the command list used to initiate recording, -/// including the queue group ordinal and immediate mode configuration. -/// - Only one execution of the same executable graph object may run at a -/// time; concurrent graph execution requires multiple executable graph -/// instances. -/// - If this function is called while the executable graph is already -/// running, the new execution is scheduled after the current execution -/// completes. -/// - Graph execution obeys the implicit in-order dependency semantics of -/// the destination command list. -/// - If `hSignalEvent` is provided, it is signaled after all recorded -/// append operations on all recorded queues complete. -/// - If wait events are provided, graph execution does not begin until all -/// wait events are satisfied. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14821,19 +14831,13 @@ zeGraphInstantiateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hGraph` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` ze_result_t ZE_APICALL -zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14841,36 +14845,46 @@ zeCommandListAppendGraphExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendGraphExt_t pfnAppendGraphExt = [&result] { - auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; - if( nullptr == pfnAppendGraphExt ) { + static const ze_pfnRTASParallelOperationCreateExp_t pfnCreateExp = [&result] { + auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendGraphExt; + return pfnCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnCreateExp( hDriver, phParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; - if( nullptr == pfnAppendGraphExt ) { + auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnCreateExp( hDriver, phParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns the recorded graph used to instantiate an executable graph. +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties +/// +/// @details +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14887,13 +14901,13 @@ zeCommandListAppendGraphExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hParallelOperation` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phSourceGraph` +/// + `nullptr == pProperties` ze_result_t ZE_APICALL -zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle +zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14901,44 +14915,40 @@ zeExecutableGraphGetSourceGraphExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt = [&result] { - auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetSourceGraphExt ) { + static const ze_pfnRTASParallelOperationGetPropertiesExp_t pfnGetPropertiesExp = [&result] { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSourceGraphExt; + return pfnGetPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetSourceGraphExt( hGraph, phSourceGraph ); + return pfnGetPropertiesExp( hParallelOperation, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetSourceGraphExt ) { + auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSourceGraphExt( hGraph, phSourceGraph ); + return pfnGetPropertiesExp( hParallelOperation, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Queries whether a graph is empty. +/// @brief Joins a parallel build operation /// /// @details -/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no -/// operations. -/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains -/// recorded operations. -/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded -/// graph is invalid. +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -14955,10 +14965,10 @@ zeExecutableGraphGetSourceGraphExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph +zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -14966,42 +14976,45 @@ zeGraphIsEmptyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt = [&result] { - auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; - if( nullptr == pfnIsEmptyExt ) { + static const ze_pfnRTASParallelOperationJoinExp_t pfnJoinExp = [&result] { + auto pfnJoinExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnJoinExp; + if( nullptr == pfnJoinExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsEmptyExt; + return pfnJoinExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnIsEmptyExt( hGraph ); + return pfnJoinExp( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; - if( nullptr == pfnIsEmptyExt ) { + auto pfnJoinExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnJoinExp; + if( nullptr == pfnJoinExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsEmptyExt( hGraph ); + return pfnJoinExp( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Writes a DOT description of a recorded graph to disk. +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - The generated DOT output captures the graph structure and recorded -/// append operations. -/// - Kernel node output includes kernel names, argument lists, and argument -/// types and values. +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15018,15 +15031,10 @@ zeGraphIsEmptyExt( /// - ::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 == filePath` +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) +zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15034,42 +15042,46 @@ zeGraphDumpContentsExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt = [&result] { - auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; - if( nullptr == pfnDumpContentsExt ) { + static const ze_pfnRTASParallelOperationDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDumpContentsExt; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDumpContentsExt( hGraph, filePath, pNext ); + return pfnDestroyExp( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; - if( nullptr == pfnDumpContentsExt ) { + auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDumpContentsExt( hGraph, filePath, pNext ); + return pfnDestroyExp( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys an executable graph object. +/// @brief Retrieves pitch information that can be used to allocate USM memory +/// for a given image. /// /// @details -/// - The executable graph must not be in use or executing on any command -/// list when it is destroyed. -/// - After destruction, the handle becomes invalid and must not be used in -/// further API calls. +/// - Retrieves pitch for 2D image given the width, height and size in bytes +/// - The memory is then allocated using ::zeMemAllocDevice by providing +/// input size calculated as the returned pitch value multiplied by image height +/// - 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. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15086,10 +15098,16 @@ zeGraphDumpContentsExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` ze_result_t ZE_APICALL -zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy +zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15097,42 +15115,43 @@ zeExecutableGraphDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnMemGetPitchFor2dImage_t pfnGetPitchFor2dImage = [&result] { + auto pfnGetPitchFor2dImage = ze_lib::context->zeDdiTable.load()->Mem.pfnGetPitchFor2dImage; + if( nullptr == pfnGetPitchFor2dImage ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnGetPitchFor2dImage; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hGraph ); + return pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetPitchFor2dImage = ze_lib::context->zeDdiTable.load()->Mem.pfnGetPitchFor2dImage; + if( nullptr == pfnGetPitchFor2dImage ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hGraph ); + return pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a recorded graph object. +/// @brief Get bindless device offset for image /// /// @details -/// - All executable graph instances created from the recorded graph must be -/// destroyed before this function is called. -/// - After destruction, the handle becomes invalid and must not be used in -/// further API calls. +/// - 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. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME +/// extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15149,10 +15168,13 @@ zeExecutableGraphDestroyExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hGraph` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pDeviceOffset` ze_result_t ZE_APICALL -zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy +zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15160,54 +15182,52 @@ zeGraphDestroyExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnGraphDestroyExt_t pfnDestroyExt = [&result] { - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + static const ze_pfnImageGetDeviceOffsetExp_t pfnGetDeviceOffsetExp = [&result] { + auto pfnGetDeviceOffsetExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetDeviceOffsetExp; + if( nullptr == pfnGetDeviceOffsetExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt; + return pfnGetDeviceOffsetExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExt( hGraph ); + return pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetDeviceOffsetExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetDeviceOffsetExp; + if( nullptr == pfnGetDeviceOffsetExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExt( hGraph ); + return pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a host function call into a command list. +/// @brief Creates a command list as the clone of another command list. /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - The host function will be executed on the host when the command list -/// reaches this point during execution. -/// - The host function callback must be of type -/// ::ze_host_function_callback_t. -/// - The host function must **not** call any Level Zero API functions. -/// - The host function may access USM shared and USM host allocations. -/// - The runtime invokes the host function asynchronously to API calls. -/// - Device may wait for preceding commands to finish before invoking the -/// callback (i.e. callbacks may introduce implicit synchronization point -/// on the device). -/// - Device will wait for all phWaitEvents to be signaled before executing -/// the host function. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - @deprecated since 1.17 +/// - The source command list must be created with the +/// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. +/// - The source command list must be closed prior to cloning. +/// - The source command list may be cloned while it is running on the +/// device. +/// - The cloned command list inherits all properties of the source command +/// list. +/// - The cloned command list must be destroyed prior to the source command +/// list. +/// - The application must only use the command list for the device, or its +/// sub-devices, which was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15216,6 +15236,7 @@ zeGraphDestroyExt( /// - ::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 @@ -15224,24 +15245,12 @@ zeGraphDestroyExt( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phClonedCommandList` 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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15249,44 +15258,47 @@ zeCommandListAppendHostFunction( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendHostFunction_t pfnAppendHostFunction = [&result] { - auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; - if( nullptr == pfnAppendHostFunction ) { + static const ze_pfnCommandListCreateCloneExp_t pfnCreateCloneExp = [&result] { + auto pfnCreateCloneExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnCreateCloneExp; + if( nullptr == pfnCreateCloneExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendHostFunction; + return pfnCreateCloneExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnCreateCloneExp( hCommandList, phClonedCommandList ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; - if( nullptr == pfnAppendHostFunction ) { + auto pfnCreateCloneExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnCreateCloneExp; + if( nullptr == pfnCreateCloneExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnCreateCloneExp( hCommandList, phClonedCommandList ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief Appends command lists to dispatch from an immediate command list. /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @remarks -/// _Analogues_ -/// - None +/// - @deprecated since 1.16. Please use +/// ::zeCommandListImmediateAppendCommandListsWithParameters. +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The command lists passed to this function in the `phCommandLists` +/// argument must be regular command lists (i.e. not immediate command +/// lists). +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15303,15 +15315,23 @@ zeCommandListAppendHostFunction( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hCommandListImmediate` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phCommandLists` ze_result_t ZE_APICALL -zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation +zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15319,40 +15339,46 @@ zeDeviceReserveCacheExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceReserveCacheExt_t pfnReserveCacheExt = [&result] { - auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + static const ze_pfnCommandListImmediateAppendCommandListsExp_t pfnImmediateAppendCommandListsExp = [&result] { + auto pfnImmediateAppendCommandListsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnImmediateAppendCommandListsExp; + if( nullptr == pfnImmediateAppendCommandListsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserveCacheExt; + return pfnImmediateAppendCommandListsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + auto pfnImmediateAppendCommandListsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnImmediateAppendCommandListsExp; + if( nullptr == pfnImmediateAppendCommandListsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Appends command lists to dispatch from an immediate command list with +/// additional parameters. /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The command lists passed to this function in the `phCommandLists` +/// argument must be regular command lists (i.e. not immediate command +/// lists). +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15361,7 +15387,6 @@ zeDeviceReserveCacheExt( /// - ::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 @@ -15369,18 +15394,26 @@ zeDeviceReserveCacheExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hCommandListImmediate` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phCommandLists` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region +zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15388,52 +15421,44 @@ zeDeviceSetCacheAdviceExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt = [&result] { - auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + static const ze_pfnCommandListImmediateAppendCommandListsWithParameters_t pfnImmediateAppendCommandListsWithParameters = [&result] { + auto pfnImmediateAppendCommandListsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateAppendCommandListsWithParameters; + if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheAdviceExt; + return pfnImmediateAppendCommandListsWithParameters; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + auto pfnImmediateAppendCommandListsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateAppendCommandListsWithParameters; + if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// extension. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15450,22 +15475,18 @@ zeDeviceSetCacheAdviceExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. +zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15473,46 +15494,46 @@ zeEventQueryTimestampsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventQueryTimestampsExp_t pfnQueryTimestampsExp = [&result] { - auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) { + static const ze_pfnCommandListGetNextCommandIdExp_t pfnGetNextCommandIdExp = [&result] { + auto pfnGetNextCommandIdExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdExp; + if( nullptr == pfnGetNextCommandIdExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryTimestampsExp; + return pfnGetNextCommandIdExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) { + auto pfnGetNextCommandIdExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdExp; + if( nullptr == pfnGetNextCommandIdExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. Provides possible kernel handles for +/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION +/// flag is present. /// /// @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. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15529,13 +15550,22 @@ zeEventQueryTimestampsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemoryProperties` +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. +zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15543,53 +15573,46 @@ zeImageGetMemoryPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageGetMemoryPropertiesExp_t pfnGetMemoryPropertiesExp = [&result] { - auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) { + static const ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp = [&result] { + auto pfnGetNextCommandIdWithKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdWithKernelsExp; + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetMemoryPropertiesExp; + return pfnGetNextCommandIdWithKernelsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) { + auto pfnGetNextCommandIdWithKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdWithKernelsExp; + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Updates mutable commands. /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_IMAGE_VIEW_EXT_NAME extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - This function may only be called for a mutable command list. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15597,7 +15620,6 @@ zeImageGetMemoryPropertiesExp( /// - ::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 @@ -15606,24 +15628,16 @@ zeImageGetMemoryPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Invalid kernel argument or not matching update descriptor provided ze_result_t ZE_APICALL -zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view +zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15631,55 +15645,41 @@ zeImageViewCreateExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageViewCreateExt_t pfnViewCreateExt = [&result] { - auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) { + static const ze_pfnCommandListUpdateMutableCommandsExp_t pfnUpdateMutableCommandsExp = [&result] { + auto pfnUpdateMutableCommandsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandsExp; + if( nullptr == pfnUpdateMutableCommandsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExt; + return pfnUpdateMutableCommandsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnUpdateMutableCommandsExp( hCommandList, desc ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) { + auto pfnUpdateMutableCommandsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandsExp; + if( nullptr == pfnUpdateMutableCommandsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnUpdateMutableCommandsExp( hCommandList, desc ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Query whether a command list was created with the mutable command list +/// extension. /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_IMAGE_VIEW_EXP_NAME extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// - Note: This function is deprecated and replaced by -/// ::zeImageViewCreateExt. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -15696,24 +15696,14 @@ zeImageViewCreateExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// + `nullptr == pIsMutable` ze_result_t ZE_APICALL -zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view +zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15721,46 +15711,48 @@ zeImageViewCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageViewCreateExp_t pfnViewCreateExp = [&result] { - auto pfnViewCreateExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnViewCreateExp; - if( nullptr == pfnViewCreateExp ) { + static const ze_pfnCommandListIsMutableExp_t pfnIsMutableExp = [&result] { + auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExp; + return pfnIsMutableExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + return pfnIsMutableExp( hCommandList, pIsMutable ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnViewCreateExp; - if( nullptr == pfnViewCreateExp ) { + auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + return pfnIsMutableExp( hCommandList, pIsMutable ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Provide kernel scheduling hints that may improve performance +/// @brief Updates the signal event for a mutable command in a mutable command +/// list. /// /// @details -/// - The scheduling hints may improve performance only and are not required -/// for correctness. -/// - If a specified scheduling hint is unsupported it will be silently -/// ignored. -/// - If two conflicting scheduling hints are specified there is no defined behavior; -/// the hints may be ignored or one hint may be chosen arbitrarily. -/// - The application must not call this function from simultaneous threads -/// with the same kernel handle. +/// - This function may only be called for a mutable command list. +/// - The type, scope and flags of the signal event must match those of the +/// source command. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. /// - The implementation of this function should be lock-free. /// /// @returns @@ -15778,16 +15770,12 @@ zeImageViewCreateExp( /// - ::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 == pHint` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pHint->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hCommandList` ze_result_t ZE_APICALL -zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor +zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15795,45 +15783,55 @@ zeKernelSchedulingHintExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnKernelSchedulingHintExp_t pfnSchedulingHintExp = [&result] { - auto pfnSchedulingHintExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSchedulingHintExp; - if( nullptr == pfnSchedulingHintExp ) { + static const ze_pfnCommandListUpdateMutableCommandSignalEventExp_t pfnUpdateMutableCommandSignalEventExp = [&result] { + auto pfnUpdateMutableCommandSignalEventExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandSignalEventExp; + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSchedulingHintExp; + return pfnUpdateMutableCommandSignalEventExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSchedulingHintExp( hKernel, pHint ); + return pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSchedulingHintExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnSchedulingHintExp; - if( nullptr == pfnSchedulingHintExp ) { + auto pfnUpdateMutableCommandSignalEventExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandSignalEventExp; + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSchedulingHintExp( hKernel, pHint ); + return pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get PCI properties - address, max speed +/// @brief Updates the wait events for a mutable command in a mutable command +/// list. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - This function may only be called for a mutable command list. +/// - The number of wait events must match that of the source command. +/// - The type, scope and flags of the wait events must match those of the +/// source command. +/// - Passing `nullptr` as the wait events will update the command to not +/// wait on any events prior to dispatch. +/// - Passing `nullptr` as an event on event wait list will remove event +/// dependency from this wait list slot. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - None -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -15849,13 +15847,16 @@ zeKernelSchedulingHintExp( /// - ::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 == pPciProperties` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + The `numWaitEvents` parameter does not match that of the original command. ze_result_t ZE_APICALL -zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. +zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15863,67 +15864,50 @@ zeDevicePciGetPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDevicePciGetPropertiesExt_t pfnPciGetPropertiesExt = [&result] { - auto pfnPciGetPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnPciGetPropertiesExt; - if( nullptr == pfnPciGetPropertiesExt ) { + static const ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp = [&result] { + auto pfnUpdateMutableCommandWaitEventsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPciGetPropertiesExt; + return pfnUpdateMutableCommandWaitEventsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnPciGetPropertiesExt( hDevice, pPciProperties ); + return pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnPciGetPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnPciGetPropertiesExt; - if( nullptr == pfnPciGetPropertiesExt ) { + auto pfnUpdateMutableCommandWaitEventsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnPciGetPropertiesExt( hDevice, pPciProperties ); + return pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies from an image to device or shared memory. +/// @brief Updates the kernel for a mutable command in a mutable command list. /// /// @details -/// - The application must ensure the memory pointed to by dstptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the source -/// image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - This function may only be called for a mutable command list. +/// - The kernel handle must be from the provided list for given command id. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - This function must be called before updating kernel arguments and +/// dispatch parameters, when kernel is mutated. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - clEnqueueReadImage -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -15940,27 +15924,18 @@ zeDevicePciGetPropertiesExt( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// + `nullptr == hSrcImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pCommandId` +/// + `nullptr == phKernels` +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE +/// + Invalid kernel handle provided for the mutation kernel instruction operation. ze_result_t ZE_APICALL -zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { #ifdef L0_STATIC_LOADER_BUILD @@ -15968,66 +15943,43 @@ zeCommandListAppendImageCopyToMemoryExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopyToMemoryExt_t pfnAppendImageCopyToMemoryExt = [&result] { - auto pfnAppendImageCopyToMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnAppendImageCopyToMemoryExt ) { + static const ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp = [&result] { + auto pfnUpdateMutableCommandKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandKernelsExp; + if( nullptr == pfnUpdateMutableCommandKernelsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyToMemoryExt; + return pfnUpdateMutableCommandKernelsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyToMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnAppendImageCopyToMemoryExt ) { + auto pfnUpdateMutableCommandKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandKernelsExp; + if( nullptr == pfnUpdateMutableCommandKernelsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies to an image from device or shared memory. +/// @brief Retrieves kernel binary program data (ISA GEN format). /// /// @details -/// - The application must ensure the memory pointed to by srcptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by srcptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the -/// destination image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, 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. -/// -/// @remarks -/// _Analogues_ -/// - clEnqueueWriteImage +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data +/// for kernel handle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16044,28 +15996,15 @@ zeCommandListAppendImageCopyToMemoryExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pSize` +/// + `nullptr == pKernelBinary` ze_result_t ZE_APICALL -zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16073,39 +16012,42 @@ zeCommandListAppendImageCopyFromMemoryExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListAppendImageCopyFromMemoryExt_t pfnAppendImageCopyFromMemoryExt = [&result] { - auto pfnAppendImageCopyFromMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnAppendImageCopyFromMemoryExt ) { + static const ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp = [&result] { + auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyFromMemoryExt; + return pfnGetBinaryExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyFromMemoryExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnAppendImageCopyFromMemoryExt ) { + auto pfnGetBinaryExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves attributes of an image allocation +/// @brief Import an external semaphore /// /// @details -/// - The application may call this function from simultaneous threads. +/// - Imports an external semaphore. +/// - This function may be called from simultaneous threads with the same +/// device handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16122,15 +16064,18 @@ zeCommandListAppendImageCopyFromMemoryExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hImage` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pImageAllocProperties` +/// + `nullptr == desc` +/// + `nullptr == phSemaphore` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1ff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties +zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16138,44 +16083,43 @@ zeImageGetAllocPropertiesExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageGetAllocPropertiesExt_t pfnGetAllocPropertiesExt = [&result] { - auto pfnGetAllocPropertiesExt = ze_lib::context->zeDdiTable.load()->Image.pfnGetAllocPropertiesExt; - if( nullptr == pfnGetAllocPropertiesExt ) { + static const ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt = [&result] { + auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocPropertiesExt; + return pfnImportExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocPropertiesExt = ze_lib::context->zeDdiTable.load()->Image.pfnGetAllocPropertiesExt; - if( nullptr == pfnGetAllocPropertiesExt ) { + auto pfnImportExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + return pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief List Imports & Exports +/// @brief Release an external semaphore /// /// @details -/// - List all the import & unresolveable import dependencies & exports of a -/// set of modules -/// -/// @remarks -/// _Analogues_ -/// - None +/// - The application must ensure the device is not currently referencing +/// the semaphore before it is released. +/// - The application must **not** call this function from simultaneous +/// threads with the same semaphore handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16191,21 +16135,12 @@ zeImageGetAllocPropertiesExt( /// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pInspectDesc` -/// + `nullptr == phModules` -/// + `nullptr == phLog` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pInspectDesc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hSemaphore` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. +zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16213,45 +16148,43 @@ zeModuleInspectLinkageExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnModuleInspectLinkageExt_t pfnInspectLinkageExt = [&result] { - auto pfnInspectLinkageExt = ze_lib::context->zeDdiTable.load()->Module.pfnInspectLinkageExt; - if( nullptr == pfnInspectLinkageExt ) { + static const ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt = [&result] { + auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnInspectLinkageExt; + return pfnReleaseExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + return pfnReleaseExternalSemaphoreExt( hSemaphore ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnInspectLinkageExt = ze_lib::context->zeDdiTable.load()->Module.pfnInspectLinkageExt; - if( nullptr == pfnInspectLinkageExt ) { + auto pfnReleaseExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->Device.pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + return pfnReleaseExternalSemaphoreExt( hSemaphore ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory on the -/// context using the specified free policy. +/// @brief Signal an external semaphore /// /// @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. -/// - The application must **not** call this function from simultaneous -/// threads with the same pointer. -/// - The implementation of this function must be thread-safe. +/// - Signals an external semaphore. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16259,7 +16192,6 @@ zeModuleInspectLinkageExt( /// - ::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 @@ -16268,18 +16200,30 @@ zeModuleInspectLinkageExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemFreeDesc` -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < pMemFreeDesc->freePolicy` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phSemaphores` +/// + `nullptr == signalParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == signalParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free +zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16287,42 +16231,43 @@ zeMemFreeExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemFreeExt_t pfnFreeExt = [&result] { - auto pfnFreeExt = ze_lib::context->zeDdiTable.load()->Mem.pfnFreeExt; - if( nullptr == pfnFreeExt ) { + static const ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt = [&result] { + auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFreeExt; + return pfnAppendSignalExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnFreeExt( hContext, pMemFreeDesc, ptr ); + return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnFreeExt = ze_lib::context->zeDdiTable.load()->Mem.pfnFreeExt; - if( nullptr == pfnFreeExt ) { + auto pfnAppendSignalExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnFreeExt( hContext, pMemFreeDesc, ptr ); + return pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices within a driver +/// @brief Wait on external semaphores /// /// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - Waits on external semaphores. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16330,7 +16275,6 @@ zeMemFreeExt( /// - ::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 @@ -16339,21 +16283,30 @@ zeMemFreeExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == phSemaphores` +/// + `nullptr == waitParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == waitParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list ze_result_t ZE_APICALL -zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. +zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16361,44 +16314,41 @@ zeFabricVertexGetExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricVertexGetExp_t pfnGetExp = [&result] { - auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + static const ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt = [&result] { + auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp; + return pfnAppendWaitExternalSemaphoreExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetExp( hDriver, pCount, phVertices ); + return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnAppendWaitExternalSemaphoreExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp( hDriver, pCount, phVertices ); + return pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves a fabric sub-vertex from a fabric vertex +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details -/// - Multiple calls to this function will return identical fabric vertex -/// handles, in the same order. -/// - The number of handles returned from this function is affected by the -/// `ZE_AFFINITY_MASK` environment variable. /// - 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. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16415,21 +16365,18 @@ zeFabricVertexGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. +zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16437,40 +16384,40 @@ zeFabricVertexGetSubVerticesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricVertexGetSubVerticesExp_t pfnGetSubVerticesExp = [&result] { - auto pfnGetSubVerticesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr == pfnGetSubVerticesExp ) { + static const ze_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSubVerticesExp; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSubVerticesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr == pfnGetSubVerticesExp ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric vertex. +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details /// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16487,13 +16434,20 @@ zeFabricVertexGetSubVerticesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pVertexProperties` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties +zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16501,43 +16455,42 @@ zeFabricVertexGetPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricVertexGetPropertiesExp_t pfnGetPropertiesExp = [&result] { - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + static const ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp; + return pfnGetBuildPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExp( hVertex, pVertexProperties ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp( hVertex, pVertexProperties ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns device handle from fabric vertex handle. +/// @brief Checks ray tracing acceleration structure format compatibility /// /// @details /// - 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. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -16551,17 +16504,20 @@ zeFabricVertexGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phDevice` -/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE -/// + Provided fabric vertex handle does not correspond to a device or subdevice. -/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE -/// + Provided fabric vertex handle corresponds to remote device or subdevice. +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. ze_result_t ZE_APICALL -zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex +zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16569,40 +16525,83 @@ zeFabricVertexGetDeviceExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricVertexGetDeviceExp_t pfnGetDeviceExp = [&result] { - auto pfnGetDeviceExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetDeviceExp; - if( nullptr == pfnGetDeviceExp ) { + static const ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDeviceExp; + return pfnRTASFormatCompatibilityCheckExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetDeviceExp( hVertex, phDevice ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDeviceExp = ze_lib::context->zeDdiTable.load()->FabricVertexExp.pfnGetDeviceExp; - if( nullptr == pfnGetDeviceExp ) { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDeviceExp( hVertex, phDevice ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns fabric vertex handle from device handle. +/// @brief Build ray tracing acceleration structure /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. +/// - 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. +/// - 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. +/// - 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. +/// - 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. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - 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. +/// - A successfully constructed acceleration structure is generally +/// non-copyable. It can only get copied from host to device using the +/// special ::zeRTASBuilderCommandListAppendCopyExt function. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16619,15 +16618,37 @@ zeFabricVertexGetDeviceExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phVertex` -/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX -/// + Provided device handle does not correspond to a fabric vertex. +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. ze_result_t ZE_APICALL -zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device +zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16635,42 +16656,55 @@ zeDeviceGetFabricVertexExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDeviceGetFabricVertexExp_t pfnGetFabricVertexExp = [&result] { - auto pfnGetFabricVertexExp = ze_lib::context->zeDdiTable.load()->DeviceExp.pfnGetFabricVertexExp; - if( nullptr == pfnGetFabricVertexExp ) { + static const ze_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFabricVertexExp; + return pfnBuildExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetFabricVertexExp( hDevice, phVertex ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetFabricVertexExp = ze_lib::context->zeDdiTable.load()->DeviceExp.pfnGetFabricVertexExp; - if( nullptr == pfnGetFabricVertexExp ) { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetFabricVertexExp( hDevice, phVertex ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves all fabric edges between provided pair of fabric vertices +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. /// /// @details -/// - A fabric edge represents one or more physical links between two fabric -/// vertices. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The memory pointed to by srcptr must be host memory containing a valid +/// ray tracing acceleration structure. +/// - The number of bytes to copy must be larger or equal to the size of the +/// ray tracing acceleration structure. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - 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, +/// and the memory was allocated, 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16687,23 +16721,26 @@ zeDeviceGetFabricVertexExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertexA` -/// + `nullptr == hVertexB` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ze_result_t ZE_APICALL -zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. +zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16711,41 +16748,42 @@ zeFabricEdgeGetExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricEdgeGetExp_t pfnGetExp = [&result] { - auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + static const ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp; + return pfnCommandListAppendCopyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices connected by a fabric edge -/// -/// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices via a fabric edge. -/// - The application may call this function from simultaneous threads. +/// @brief Destroys a ray tracing acceleration structure builder object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -16763,15 +16801,11 @@ zeFabricEdgeGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phVertexA` -/// + `nullptr == phVertexB` +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ze_result_t ZE_APICALL -zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16779,40 +16813,42 @@ zeFabricEdgeGetVerticesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricEdgeGetVerticesExp_t pfnGetVerticesExp = [&result] { - auto pfnGetVerticesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetVerticesExp; - if( nullptr == pfnGetVerticesExp ) { + static const ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVerticesExp; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + return pfnDestroyExt( hBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetVerticesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetVerticesExp; - if( nullptr == pfnGetVerticesExp ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + return pfnDestroyExt( hBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric edge. +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details /// - 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. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16829,13 +16865,13 @@ zeFabricEdgeGetVerticesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pEdgeProperties` +/// + `nullptr == phParallelOperation` ze_result_t ZE_APICALL -zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties +zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16843,58 +16879,46 @@ zeFabricEdgeGetPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnFabricEdgeGetPropertiesExp_t pfnGetPropertiesExp = [&result] { - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + static const ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExp( hEdge, pEdgeProperties ); + return pfnCreateExt( hDriver, phParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp( hEdge, pEdgeProperties ); + return pfnCreateExt( hDriver, phParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query an event's timestamp value on the host, with domain preference. +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties /// /// @details -/// - For collecting *only* kernel timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. -/// - For collecting synchronized timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps -/// are also available from this type of event pool, but there is a -/// performance cost. -/// - The destination memory will be unmodified if the event has not been -/// signaled. +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling +/// this function. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16911,29 +16935,13 @@ zeFabricEdgeGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` +/// + `nullptr == hParallelOperation` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == pProperties` ze_result_t ZE_APICALL -zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. +zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { #ifdef L0_STATIC_LOADER_BUILD @@ -16941,41 +16949,40 @@ zeEventQueryKernelTimestampsExt( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnEventQueryKernelTimestampsExt_t pfnQueryKernelTimestampsExt = [&result] { - auto pfnQueryKernelTimestampsExt = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestampsExt; - if( nullptr == pfnQueryKernelTimestampsExt ) { + static const ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt = [&result] { + auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryKernelTimestampsExt; + return pfnGetPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + return pfnGetPropertiesExt( hParallelOperation, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryKernelTimestampsExt = ze_lib::context->zeDdiTable.load()->Event.pfnQueryKernelTimestampsExt; - if( nullptr == pfnQueryKernelTimestampsExt ) { + auto pfnGetPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + return pfnGetPropertiesExt( hParallelOperation, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Joins a parallel build operation /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -16992,18 +16999,10 @@ zeEventQueryKernelTimestampsExt( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17011,39 +17010,44 @@ zeRTASBuilderCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderCreateExp_t pfnCreateExp = [&result] { - auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + static const ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt = [&result] { + auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp; + return pfnJoinExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExp( hDriver, pDescriptor, phBuilder ); + return pfnJoinExt( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnJoinExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp( hDriver, pDescriptor, phBuilder ); + return pfnJoinExt( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - The application may call this function from simultaneous threads. +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -17061,20 +17065,10 @@ zeRTASBuilderCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hParallelOperation` ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17082,42 +17076,51 @@ zeRTASBuilderGetBuildPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderGetBuildPropertiesExp_t pfnGetBuildPropertiesExp = [&result] { - auto pfnGetBuildPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr == pfnGetBuildPropertiesExp ) { + static const ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExp; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnDestroyExt( hParallelOperation ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr == pfnGetBuildPropertiesExp ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnDestroyExt( hParallelOperation ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @brief Retrieves the vector width properties of the device. /// /// @details +/// - Properties are reported for each vector width supported by the device. +/// - Multiple calls to this function will return properties in the same +/// order. +/// - The number of vector width properties is reported thru the pCount +/// parameter which is updated by the driver given pCount == 0. +/// - The application may provide a buffer that is larger than the number of +/// properties, but the application must set pCount to the number of +/// properties to retrieve. /// - 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. /// /// @returns +/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY @@ -17131,20 +17134,21 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B +zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17152,83 +17156,42 @@ zeDriverRTASFormatCompatibilityCheckExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnDriverRTASFormatCompatibilityCheckExp_t pfnRTASFormatCompatibilityCheckExp = [&result] { - auto pfnRTASFormatCompatibilityCheckExp = ze_lib::context->zeDdiTable.load()->DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { + static const ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt = [&result] { + auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExp; + return pfnGetVectorWidthPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExp = ze_lib::context->zeDdiTable.load()->DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { + auto pfnGetVectorWidthPropertiesExt = ze_lib::context->zeDdiTable.load()->Device.pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Retrieves kernel allocation properties. /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - It is the user's responsibility to manage the acceleration structure -/// buffer allocation, de-allocation, and potential prefetching to the -/// device memory. The required size of the acceleration structure buffer -/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. -/// The acceleration structure buffer must be a shared USM allocation and -/// should be present on the host at build time. The referenced scene data -/// (index- and vertex- buffers) can be standard host allocations, and -/// will not be referenced into by the build acceleration structure. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes based on a query for the estimated size properties. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. -/// - When using the "expected" size for the acceleration structure buffer, -/// the acceleration structure construction may fail with -/// ::ZE_RESULT_EXP_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. -/// - 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. -/// - All provided data buffers must be host-accessible. -/// - The acceleration structure buffer must be a USM allocation. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - Acceleration structure construction may be parallelized by passing a -/// valid handle to a parallel operation object and joining that parallel -/// operation using ::zeRTASParallelOperationJoinExp with user-provided -/// worker threads. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns array of kernel allocation properties for kernel handle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17245,37 +17208,22 @@ zeDriverRTASFormatCompatibilityCheckExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes +zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17283,42 +17231,52 @@ zeRTASBuilderBuildExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderBuildExp_t pfnBuildExp = [&result] { - auto pfnBuildExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnBuildExp; - if( nullptr == pfnBuildExp ) { + static const ze_pfnKernelGetAllocationPropertiesExp_t pfnGetAllocationPropertiesExp = [&result] { + auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExp; + return pfnGetAllocationPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnBuildExp; - if( nullptr == pfnBuildExp ) { + auto pfnGetAllocationPropertiesExp = ze_lib::context->zeDdiTable.load()->KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Creates an IPC memory handle for the specified allocation with +/// properties for the requested handle. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. +/// - 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. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -17336,11 +17294,16 @@ zeRTASBuilderBuildExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == pIpcHandle` ze_result_t ZE_APICALL -zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy +zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17348,42 +17311,43 @@ zeRTASBuilderDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASBuilderDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const ze_pfnMemGetIpcHandleWithProperties_t pfnGetIpcHandleWithProperties = [&result] { + auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnGetIpcHandleWithProperties; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( hBuilder ); + return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASBuilderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetIpcHandleWithProperties = ze_lib::context->zeDdiTable.load()->Mem.pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( hBuilder ); + return pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Creates a new graph object. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. +/// - A newly created graph is an empty container for captured operations. +/// - The application may instantiate executable graph objects from a +/// recorded graph using ::zeGraphInstantiateExt. +/// - The application may begin capturing into an empty graph using +/// ::zeCommandListBeginCaptureIntoGraphExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17400,13 +17364,15 @@ zeRTASBuilderDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` +/// + `nullptr == phGraph` ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object +zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17414,46 +17380,105 @@ zeRTASParallelOperationCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationCreateExp_t pfnCreateExp = [&result] { - auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + static const ze_pfnGraphCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExp( hDriver, phParallelOperation ); + return pfnCreateExt( hContext, pNext, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp( hDriver, phParallelOperation ); + return pfnCreateExt( hContext, pNext, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties +/// @brief Begins recording asynchronous append operations into a new graph +/// associated with an immediate command list. /// /// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - Graph capture is intended for asynchronous append operations only; +/// synchronous operations are not supported while capture is active and +/// return ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - The application must call this function only with an immediate command +/// list. +/// - The application must not call this function with a synchronous +/// immediate command list. +/// - After this call succeeds, append operations issued to the command list +/// are recorded into a graph and are not submitted to the device. Events +/// used by these operations are not signaled until capture ends and the +/// graph is instantiated and executed. +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_APPEND_COMMANDLIST, then while +/// capture is active, calling +/// ::zeCommandListImmediateAppendCommandListsExp on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_SUBGRAPHS, then while capture is +/// active, calling ::zeCommandListAppendGraphExt on the capturing command +/// list returns an error (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED). +/// - While capture is active, host-side synchronization operations on +/// recorded work, such as ::zeCommandListHostSynchronize or +/// ::zeEventHostSynchronize, return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED. +/// - While capture is active, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) captured in the graph +/// cannot be used outside the graph; such use returns an error +/// (::ZE_RESULT_ERROR_GRAPH_INTERNAL_EVENT). +/// - The command list on which capture starts is called the primary command +/// list for a given capture session. +/// - If an event signaled by a captured command list is used in the wait +/// list of another immediate command list, that command list also enters +/// graph capture mode. This creates a fork. The command list from which +/// the fork originated is called the parent, and the forked command list +/// is called the child. A child command list may itself be used to create +/// additional forks, resulting in a tree of command lists participating +/// in the same graph capture. +/// - Subsequent signals from the parent command list to a child command +/// list are allowed and do not create additional forks or capture +/// sessions; the child command list remains in the same capture session +/// as the parent command list. +/// - Each fork must be joined by signaling on the child command list and by +/// waiting on the parent command list. +/// - A child command list may signal multiple times back to the parent +/// command list, but only the last signal on the child command list may +/// become part of the join operation. +/// - Child command lists continue recording as long as the primary command +/// list is in capture mode. +/// - Commands that append work (for example, compute kernels or data +/// transfers) to a recording child command list after the intended join +/// operation are treated as unjoined work, and the graph is considered +/// invalid. Commands that do not append work (for example, event signal +/// and wait operations) are allowed after the join operation and do not +/// invalidate the graph. +/// - All restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply to recording child command lists as well. +/// - It is invalid to merge two separate graph capture sessions (i.e. with +/// different primary command lists) by waiting on an event associated +/// with a different graph (operation will return +/// ::ZE_RESULT_ERROR_GRAPH_CAPTURE_MERGE_ATTEMPT). +/// - If the device does not support +/// ::ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_CB_EXTERNAL_IPC, then using an event +/// that was created with both ZEX_COUNTER_BASED_EVENT_FLAG_IPC and +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL returns an error +/// (::ZE_RESULT_ERROR_GRAPH_CAPTURE_UNSUPPORTED) during append +/// operations. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17470,13 +17495,12 @@ zeRTASParallelOperationCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == hCommandList` ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties +zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17484,40 +17508,45 @@ zeRTASParallelOperationGetPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationGetPropertiesExp_t pfnGetPropertiesExp = [&result] { - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + static const ze_pfnCommandListBeginGraphCaptureExt_t pfnBeginGraphCaptureExt = [&result] { + auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp; + return pfnBeginGraphCaptureExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExp( hParallelOperation, pProperties ); + return pfnBeginGraphCaptureExt( hCommandList, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnBeginGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp( hParallelOperation, pProperties ); + return pfnBeginGraphCaptureExt( hCommandList, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Begins recording asynchronous append operations into an existing +/// graph. /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion +/// - The graph must be created with ::zeGraphCreateExt before calling this +/// function. +/// - The graph must be empty when capture begins. +/// - After this call succeeds, the command list enters graph capture mode +/// and all restrictions described for ::zeCommandListBeginGraphCaptureExt +/// apply. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17534,10 +17563,14 @@ zeRTASParallelOperationGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object +zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17545,45 +17578,42 @@ zeRTASParallelOperationJoinExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationJoinExp_t pfnJoinExp = [&result] { - auto pfnJoinExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnJoinExp; - if( nullptr == pfnJoinExp ) { + static const ze_pfnCommandListBeginCaptureIntoGraphExt_t pfnBeginCaptureIntoGraphExt = [&result] { + auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExp; + return pfnBeginCaptureIntoGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnJoinExp( hParallelOperation ); + return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnJoinExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnJoinExp; - if( nullptr == pfnJoinExp ) { + auto pfnBeginCaptureIntoGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnJoinExp( hParallelOperation ); + return pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Queries whether a command list is in graph capture mode. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. -/// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. -/// - The implementation of this function must be thread-safe. +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the command list is +/// in graph capture mode. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the command list is +/// not in graph capture mode. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17600,10 +17630,10 @@ zeRTASParallelOperationJoinExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17611,46 +17641,57 @@ zeRTASParallelOperationDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnRTASParallelOperationDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const ze_pfnCommandListIsGraphCaptureEnabledExt_t pfnIsGraphCaptureEnabledExt = [&result] { + auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnIsGraphCaptureEnabledExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( hParallelOperation ); + return pfnIsGraphCaptureEnabledExt( hCommandList ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zeDdiTable.load()->RTASParallelOperationExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnIsGraphCaptureEnabledExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( hParallelOperation ); + return pfnIsGraphCaptureEnabledExt( hCommandList ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves pitch information that can be used to allocate USM memory -/// for a given image. +/// @brief Ends graph capture on the primary command list and returns the +/// recorded graph. /// /// @details -/// - Retrieves pitch for 2D image given the width, height and size in bytes -/// - The memory is then allocated using ::zeMemAllocDevice by providing -/// input size calculated as the returned pitch value multiplied by image height -/// - 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. -/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension. +/// - This function may only be called on the primary command list used with +/// ::zeCommandListBeginGraphCaptureExt or +/// ::zeCommandListBeginCaptureIntoGraphExt. +/// - If capture was started with ::zeCommandListBeginCaptureIntoGraphExt, +/// the returned graph handle is the same graph handle that was provided +/// when capture began. +/// - The returned graph must be instantiated before execution. +/// - This call ends graph capture mode on all command lists participating +/// in the same graph capture (including forks). +/// - After this call succeeds, subsequent append operations submit work to +/// the device normally. +/// - If capture mode is not active on the command list, an error is +/// returned. +/// - After this call succeeds, events signaled by previously captured +/// commands do not create new forks. +/// - After this call succeeds, internal counter-based events (i.e. without +/// ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) can be reused by the +/// application and don't interfere with recorded state. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17667,16 +17708,19 @@ zeRTASParallelOperationDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// + if graph contains unjoined forks +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ze_result_t ZE_APICALL -zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch +zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17684,43 +17728,46 @@ zeMemGetPitchFor2dImage( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnMemGetPitchFor2dImage_t pfnGetPitchFor2dImage = [&result] { - auto pfnGetPitchFor2dImage = ze_lib::context->zeDdiTable.load()->Mem.pfnGetPitchFor2dImage; - if( nullptr == pfnGetPitchFor2dImage ) { + static const ze_pfnCommandListEndGraphCaptureExt_t pfnEndGraphCaptureExt = [&result] { + auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPitchFor2dImage; + return pfnEndGraphCaptureExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPitchFor2dImage = ze_lib::context->zeDdiTable.load()->Mem.pfnGetPitchFor2dImage; - if( nullptr == pfnGetPitchFor2dImage ) { + auto pfnEndGraphCaptureExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + return pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get bindless device offset for image +/// @brief Returns the graph associated with a command list that is in graph +/// capture mode. /// /// @details -/// - 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. -/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME -/// extension. +/// - This function may only be called while the command list is in graph +/// capture mode. +/// - The returned graph handle cannot be instantiated until capture is +/// ended by ::zeCommandListEndGraphCaptureExt. +/// - This function does not transfer ownership of the graph handle. +/// - If the command list is not in graph capture mode, an error is returned +/// and `*phGraph` is set to null. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17737,13 +17784,15 @@ zeMemGetPitchFor2dImage( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDeviceOffset` +/// + `nullptr == phGraph` +/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + if command list is not in graph capture mode ze_result_t ZE_APICALL -zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image +zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17751,52 +17800,43 @@ zeImageGetDeviceOffsetExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnImageGetDeviceOffsetExp_t pfnGetDeviceOffsetExp = [&result] { - auto pfnGetDeviceOffsetExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetDeviceOffsetExp; - if( nullptr == pfnGetDeviceOffsetExp ) { + static const ze_pfnCommandListGetGraphExt_t pfnGetGraphExt = [&result] { + auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDeviceOffsetExp; + return pfnGetGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + return pfnGetGraphExt( hCommandList, phGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDeviceOffsetExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetDeviceOffsetExp; - if( nullptr == pfnGetDeviceOffsetExp ) { + auto pfnGetGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + return pfnGetGraphExt( hCommandList, phGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a command list as the clone of another command list. +/// @brief Returns the primary command list associated with a graph capture +/// session. /// /// @details -/// - @deprecated since 1.17 -/// - The source command list must be created with the -/// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. -/// - The source command list must be closed prior to cloning. -/// - The source command list may be cloned while it is running on the -/// device. -/// - The cloned command list inherits all properties of the source command -/// list. -/// - The cloned command list must be destroyed prior to the source command -/// list. -/// - The application must only use the command list for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The returned command list is the command list that initiated capture +/// for the graph during its recording stage. +/// - This function can be called while the graph is being recorded and +/// after capture has ended. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17813,13 +17853,14 @@ zeImageGetDeviceOffsetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phClonedCommandList` +/// + `nullptr == phCommandList` ze_result_t ZE_APICALL -zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list +zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17827,47 +17868,44 @@ zeCommandListCreateCloneExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListCreateCloneExp_t pfnCreateCloneExp = [&result] { - auto pfnCreateCloneExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnCreateCloneExp; - if( nullptr == pfnCreateCloneExp ) { + static const ze_pfnGraphGetPrimaryCommandListExt_t pfnGetPrimaryCommandListExt = [&result] { + auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateCloneExp; + return pfnGetPrimaryCommandListExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateCloneExp( hCommandList, phClonedCommandList ); + return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateCloneExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnCreateCloneExp; - if( nullptr == pfnCreateCloneExp ) { + auto pfnGetPrimaryCommandListExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateCloneExp( hCommandList, phClonedCommandList ); + return pfnGetPrimaryCommandListExt( hGraph, phCommandList ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends command lists to dispatch from an immediate command list. +/// @brief Registers a host callback that is invoked when a graph is destroyed. /// /// @details -/// - @deprecated since 1.16. Please use -/// ::zeCommandListImmediateAppendCommandListsWithParameters. -/// - The application must call this function only with command lists -/// created with ::zeCommandListCreateImmediate. -/// - The command lists passed to this function in the `phCommandLists` -/// argument must be regular command lists (i.e. not immediate command -/// lists). -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - Callbacks may be registered while a graph is being recorded or after +/// executable graph instances have been created from it. +/// - Multiple callbacks may be registered for the same graph. +/// - All registered callbacks are invoked when the graph is destroyed. +/// - The callback must not call Level Zero APIs that use the graph being +/// destroyed. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17884,23 +17922,14 @@ zeCommandListCreateCloneExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandListImmediate` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phCommandLists` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) +zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17908,46 +17937,58 @@ zeCommandListImmediateAppendCommandListsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListImmediateAppendCommandListsExp_t pfnImmediateAppendCommandListsExp = [&result] { - auto pfnImmediateAppendCommandListsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr == pfnImmediateAppendCommandListsExp ) { + static const ze_pfnGraphSetDestructionCallbackExt_t pfnSetDestructionCallbackExt = [&result] { + auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImmediateAppendCommandListsExp; + return pfnSetDestructionCallbackExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImmediateAppendCommandListsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr == pfnImmediateAppendCommandListsExp ) { + auto pfnSetDestructionCallbackExt = ze_lib::context->zeDdiTable.load()->Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends command lists to dispatch from an immediate command list with -/// additional parameters. +/// @brief Creates an executable graph object from a recorded graph. /// /// @details -/// - The application must call this function only with command lists -/// created with ::zeCommandListCreateImmediate. -/// - The command lists passed to this function in the `phCommandLists` -/// argument must be regular command lists (i.e. not immediate command -/// lists). -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - Multiple executable graph objects may be created from a single +/// recorded graph. +/// - 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. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17956,6 +17997,7 @@ zeCommandListImmediateAppendCommandListsExp( /// - ::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 @@ -17963,26 +18005,15 @@ zeCommandListImmediateAppendCommandListsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandListImmediate` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phCommandLists` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + an extension passed via pNext is not supported +/// + `nullptr == phExecutableGraph` ze_result_t ZE_APICALL -zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) +zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -17990,44 +18021,53 @@ zeCommandListImmediateAppendCommandListsWithParameters( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListImmediateAppendCommandListsWithParameters_t pfnImmediateAppendCommandListsWithParameters = [&result] { - auto pfnImmediateAppendCommandListsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { + static const ze_pfnGraphInstantiateExt_t pfnInstantiateExt = [&result] { + auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImmediateAppendCommandListsWithParameters; + return pfnInstantiateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImmediateAppendCommandListsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { + auto pfnInstantiateExt = ze_lib::context->zeDdiTable.load()->Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns a unique command identifier for the next command to be -/// appended to a command list. +/// @brief Appends execution of an executable graph to a command list. /// /// @details -/// - This function may only be called for a mutable command list. -/// - This function may not be called on a closed command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// - The destination command list must match the type and execution +/// characteristics of the command list used to initiate recording, +/// including the queue group ordinal and immediate mode configuration. +/// - Only one execution of the same executable graph object may run at a +/// time; concurrent graph execution requires multiple executable graph +/// instances. +/// - If this function is called while the executable graph is already +/// running, the new execution is scheduled after the current execution +/// completes. +/// - Graph execution obeys the implicit in-order dependency semantics of +/// the destination command list. +/// - If `hSignalEvent` is provided, it is signaled after all recorded +/// append operations on all recorded queues complete. +/// - If wait events are provided, graph execution does not begin until all +/// wait events are satisfied. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18045,17 +18085,18 @@ zeCommandListImmediateAppendCommandListsWithParameters( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == pCommandId` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written +zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18063,46 +18104,36 @@ zeCommandListGetNextCommandIdExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListGetNextCommandIdExp_t pfnGetNextCommandIdExp = [&result] { - auto pfnGetNextCommandIdExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdExp; - if( nullptr == pfnGetNextCommandIdExp ) { + static const ze_pfnCommandListAppendGraphExt_t pfnAppendGraphExt = [&result] { + auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNextCommandIdExp; + return pfnAppendGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetNextCommandIdExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdExp; - if( nullptr == pfnGetNextCommandIdExp ) { + auto pfnAppendGraphExt = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + return pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns a unique command identifier for the next command to be -/// appended to a command list. Provides possible kernel handles for -/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION -/// flag is present. -/// -/// @details -/// - This function may only be called for a mutable command list. -/// - This function may not be called on a closed command list. -/// - This function may be called from simultaneous threads with the same -/// command list handle. -/// - The implementation of this function should be lock-free. +/// @brief Returns the recorded graph used to instantiate an executable graph. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18119,22 +18150,13 @@ zeCommandListGetNextCommandIdExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == pCommandId` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xff < desc->flags` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phSourceGraph` ze_result_t ZE_APICALL -zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written +zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18142,46 +18164,44 @@ zeCommandListGetNextCommandIdWithKernelsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp = [&result] { - auto pfnGetNextCommandIdWithKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { + static const ze_pfnExecutableGraphGetSourceGraphExt_t pfnGetSourceGraphExt = [&result] { + auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNextCommandIdWithKernelsExp; + return pfnGetSourceGraphExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + return pfnGetSourceGraphExt( hGraph, phSourceGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetNextCommandIdWithKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { + auto pfnGetSourceGraphExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + return pfnGetSourceGraphExt( hGraph, phSourceGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates mutable commands. +/// @brief Queries whether a graph is empty. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - The function returns `ZE_RESULT_QUERY_TRUE` when the graph contains no +/// operations. +/// - The function returns `ZE_RESULT_QUERY_FALSE` when the graph contains +/// recorded operations. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18189,6 +18209,7 @@ zeCommandListGetNextCommandIdWithKernelsExp( /// - ::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 @@ -18197,16 +18218,10 @@ zeCommandListGetNextCommandIdWithKernelsExp( /// - ::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 == desc` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Invalid kernel argument or not matching update descriptor provided +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member +zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18214,41 +18229,42 @@ zeCommandListUpdateMutableCommandsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListUpdateMutableCommandsExp_t pfnUpdateMutableCommandsExp = [&result] { - auto pfnUpdateMutableCommandsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr == pfnUpdateMutableCommandsExp ) { + static const ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt = [&result] { + auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandsExp; + return pfnIsEmptyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnUpdateMutableCommandsExp( hCommandList, desc ); + return pfnIsEmptyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr == pfnUpdateMutableCommandsExp ) { + auto pfnIsEmptyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandsExp( hCommandList, desc ); + return pfnIsEmptyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query whether a command list was created with the mutable command list -/// extension. +/// @brief Writes a DOT description of a recorded graph to disk. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The generated DOT output captures the graph structure and recorded +/// append operations. +/// - Kernel node output includes kernel names, argument lists, and argument +/// types and values. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18265,14 +18281,15 @@ zeCommandListUpdateMutableCommandsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pIsMutable` +/// + `nullptr == filePath` ze_result_t ZE_APICALL -zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension +zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18280,49 +18297,42 @@ zeCommandListIsMutableExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListIsMutableExp_t pfnIsMutableExp = [&result] { - auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; - if( nullptr == pfnIsMutableExp ) { + static const ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt = [&result] { + auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsMutableExp; + return pfnDumpContentsExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnIsMutableExp( hCommandList, pIsMutable ); + return pfnDumpContentsExt( hGraph, filePath, pNext ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsMutableExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnIsMutableExp; - if( nullptr == pfnIsMutableExp ) { + auto pfnDumpContentsExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnIsMutableExp( hCommandList, pIsMutable ); + return pfnDumpContentsExt( hGraph, filePath, pNext ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the signal event for a mutable command in a mutable command -/// list. +/// @brief Destroys an executable graph object. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The type, scope and flags of the signal event must match those of the -/// source command. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - The executable graph must not be in use or executing on any command +/// list when it is destroyed. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18339,12 +18349,10 @@ zeCommandListIsMutableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion +zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18352,54 +18360,42 @@ zeCommandListUpdateMutableCommandSignalEventExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListUpdateMutableCommandSignalEventExp_t pfnUpdateMutableCommandSignalEventExp = [&result] { - auto pfnUpdateMutableCommandSignalEventExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { + static const ze_pfnExecutableGraphDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandSignalEventExp; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); + return pfnDestroyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandSignalEventExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); + return pfnDestroyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the wait events for a mutable command in a mutable command -/// list. +/// @brief Destroys a recorded graph object. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The number of wait events must match that of the source command. -/// - The type, scope and flags of the wait events must match those of the -/// source command. -/// - Passing `nullptr` as the wait events will update the command to not -/// wait on any events prior to dispatch. -/// - Passing `nullptr` as an event on event wait list will remove event -/// dependency from this wait list slot. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - The implementation of this function should be lock-free. +/// - All executable graph instances created from the recorded graph must be +/// destroyed before this function is called. +/// - After destruction, the handle becomes invalid and must not be used in +/// further API calls. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18416,16 +18412,10 @@ zeCommandListUpdateMutableCommandSignalEventExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + The `numWaitEvents` parameter does not match that of the original command. +/// + `nullptr == hGraph` ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18433,49 +18423,54 @@ zeCommandListUpdateMutableCommandWaitEventsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp = [&result] { - auto pfnUpdateMutableCommandWaitEventsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { + static const ze_pfnGraphDestroyExt_t pfnDestroyExt = [&result] { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandWaitEventsExp; + return pfnDestroyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + return pfnDestroyExt( hGraph ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandWaitEventsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { + auto pfnDestroyExt = ze_lib::context->zeDdiTable.load()->Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + return pfnDestroyExt( hGraph ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Updates the kernel for a mutable command in a mutable command list. +/// @brief Appends a host function call into a command list. /// /// @details -/// - This function may only be called for a mutable command list. -/// - The kernel handle must be from the provided list for given command id. -/// - The application must synchronize mutable command list execution before -/// calling this function. -/// - The application must close a mutable command list after completing all -/// updates. -/// - This function must not be called from simultaneous threads with the -/// same command list handle. -/// - This function must be called before updating kernel arguments and -/// dispatch parameters, when kernel is mutated. -/// - 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. +/// - The host function will be executed on the host when the command list +/// reaches this point during execution. +/// - The host function callback must be of type +/// ::ze_host_function_callback_t. +/// - The host function must **not** call any Level Zero API functions. +/// - The host function may access USM shared and USM host allocations. +/// - The runtime invokes the host function asynchronously to API calls. +/// - Device may wait for preceding commands to finish before invoking the +/// callback (i.e. callbacks may introduce implicit synchronization point +/// on the device). +/// - Device will wait for all phWaitEvents to be signaled before executing +/// the host function. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18484,7 +18479,6 @@ zeCommandListUpdateMutableCommandWaitEventsExp( /// - ::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 @@ -18493,18 +18487,24 @@ zeCommandListUpdateMutableCommandWaitEventsExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCommandId` -/// + `nullptr == phKernels` -/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE -/// + Invalid kernel handle provided for the mutation kernel instruction operation. +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported ze_result_t ZE_APICALL -zeCommandListUpdateMutableCommandKernelsExp( +zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { #ifdef L0_STATIC_LOADER_BUILD @@ -18512,31 +18512,31 @@ zeCommandListUpdateMutableCommandKernelsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp = [&result] { - auto pfnUpdateMutableCommandKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnUpdateMutableCommandKernelsExp ) { + static const ze_pfnCommandListAppendHostFunction_t pfnAppendHostFunction = [&result] { + auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandKernelsExp; + return pfnAppendHostFunction; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandKernelsExp = ze_lib::context->zeDdiTable.load()->CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnUpdateMutableCommandKernelsExp ) { + auto pfnAppendHostFunction = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + return pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index 55ae2fa8..32dd9451 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -32,40 +32,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeInitDrivers") ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGetExecutableGraphProcAddrTable") ); - getTableWithCheck(getTable, version, &initialzeDdiTable.ExecutableGraph ); - initialzeDdiTable.ExecutableGraph.pfnGetSourceGraphExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeExecutableGraphGetSourceGraphExt") ); - initialzeDdiTable.ExecutableGraph.pfnDestroyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeExecutableGraphDestroyExt") ); - } - - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGetGraphProcAddrTable") ); - getTableWithCheck(getTable, version, &initialzeDdiTable.Graph ); - initialzeDdiTable.Graph.pfnCreateExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphCreateExt") ); - initialzeDdiTable.Graph.pfnGetPrimaryCommandListExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphGetPrimaryCommandListExt") ); - initialzeDdiTable.Graph.pfnSetDestructionCallbackExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphSetDestructionCallbackExt") ); - initialzeDdiTable.Graph.pfnInstantiateExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphInstantiateExt") ); - initialzeDdiTable.Graph.pfnIsEmptyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphIsEmptyExt") ); - initialzeDdiTable.Graph.pfnDumpContentsExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphDumpContentsExt") ); - initialzeDdiTable.Graph.pfnDestroyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGraphDestroyExt") ); - } - if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -756,28 +722,50 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeFabricVertexGetDeviceExp") ); } - return result; - } -#else - __zedlllocal ze_result_t context_t::zeDdiTableInit(ze_api_version_t version) - { - ze_result_t result = ZE_RESULT_SUCCESS; - if( ZE_RESULT_SUCCESS == result ) { - result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetExecutableGraphProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.ExecutableGraph ); + initialzeDdiTable.ExecutableGraph.pfnGetSourceGraphExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeExecutableGraphGetSourceGraphExt") ); + initialzeDdiTable.ExecutableGraph.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeExecutableGraphDestroyExt") ); } if( ZE_RESULT_SUCCESS == result ) { // Optional - zeGetExecutableGraphProcAddrTable( version, &initialzeDdiTable.ExecutableGraph ); + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetGraphProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.Graph ); + initialzeDdiTable.Graph.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphCreateExt") ); + initialzeDdiTable.Graph.pfnGetPrimaryCommandListExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphGetPrimaryCommandListExt") ); + initialzeDdiTable.Graph.pfnSetDestructionCallbackExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphSetDestructionCallbackExt") ); + initialzeDdiTable.Graph.pfnInstantiateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphInstantiateExt") ); + initialzeDdiTable.Graph.pfnIsEmptyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphIsEmptyExt") ); + initialzeDdiTable.Graph.pfnDumpContentsExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphDumpContentsExt") ); + initialzeDdiTable.Graph.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphDestroyExt") ); } + return result; + } +#else + __zedlllocal ze_result_t context_t::zeDdiTableInit(ze_api_version_t version) + { + ze_result_t result = ZE_RESULT_SUCCESS; + if( ZE_RESULT_SUCCESS == result ) { - // Optional - zeGetGraphProcAddrTable( version, &initialzeDdiTable.Graph ); + result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); } if( ZE_RESULT_SUCCESS == result ) @@ -938,6 +926,18 @@ namespace ze_lib zeGetFabricVertexExpProcAddrTable( version, &initialzeDdiTable.FabricVertexExp ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetExecutableGraphProcAddrTable( version, &initialzeDdiTable.ExecutableGraph ); + } + + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetGraphProcAddrTable( version, &initialzeDdiTable.Graph ); + } + return result; } #endif diff --git a/source/lib/ze_tracing_register_cb_libapi.cpp b/source/lib/ze_tracing_register_cb_libapi.cpp index c302c210..2ad49f94 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -4294,10 +4294,10 @@ zelTracerKernelSetGlobalOffsetExpRegisterCallback( ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetBinaryExpRegisterCallback( +zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb + ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4305,24 +4305,24 @@ zelTracerKernelGetBinaryExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb + ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelGetBinaryExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReserveCacheExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetBinaryExpCb); + return func(hTracer, callback_type, pfnReserveCacheExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( +zelTracerDeviceSetCacheAdviceExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb + ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4330,24 +4330,24 @@ zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb + ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceImportExternalSemaphoreExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceSetCacheAdviceExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnImportExternalSemaphoreExtCb); + return func(hTracer, callback_type, pfnSetCacheAdviceExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( +zelTracerEventQueryTimestampsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb + ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4355,24 +4355,24 @@ zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb + ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryTimestampsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnReleaseExternalSemaphoreExtCb); + return func(hTracer, callback_type, pfnQueryTimestampsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( +zelTracerImageGetMemoryPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb + ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4380,24 +4380,24 @@ zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb + ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetMemoryPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendSignalExternalSemaphoreExtCb); + return func(hTracer, callback_type, pfnGetMemoryPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( +zelTracerImageViewCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb + ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4405,24 +4405,24 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb + ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendWaitExternalSemaphoreExtCb); + return func(hTracer, callback_type, pfnViewCreateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( +zelTracerImageViewCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4430,24 +4430,24 @@ zelTracerRTASBuilderCreateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateExtCb); + return func(hTracer, callback_type, pfnViewCreateExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( +zelTracerKernelSchedulingHintExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4455,24 +4455,24 @@ zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelSchedulingHintExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetBuildPropertiesExtCb); + return func(hTracer, callback_type, pfnSchedulingHintExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( +zelTracerDevicePciGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4480,24 +4480,24 @@ zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDevicePciGetPropertiesExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExtCb); + return func(hTracer, callback_type, pfnPciGetPropertiesExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( +zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4505,24 +4505,24 @@ zelTracerRTASBuilderBuildExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnBuildExtCb); + return func(hTracer, callback_type, pfnAppendImageCopyToMemoryExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( +zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4530,24 +4530,24 @@ zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCommandListAppendCopyExtCb); + return func(hTracer, callback_type, pfnAppendImageCopyFromMemoryExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( +zelTracerImageGetAllocPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4555,24 +4555,24 @@ zelTracerRTASBuilderDestroyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetAllocPropertiesExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); + return func(hTracer, callback_type, pfnGetAllocPropertiesExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( +zelTracerModuleInspectLinkageExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4580,24 +4580,24 @@ zelTracerRTASParallelOperationCreateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerModuleInspectLinkageExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateExtCb); + return func(hTracer, callback_type, pfnInspectLinkageExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( +zelTracerMemFreeExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ze_pfnMemFreeExtCb_t pfnFreeExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4605,24 +4605,24 @@ zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ze_pfnMemFreeExtCb_t pfnFreeExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemFreeExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPropertiesExtCb); + return func(hTracer, callback_type, pfnFreeExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( +zelTracerFabricVertexGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ze_pfnFabricVertexGetExpCb_t pfnGetExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4630,24 +4630,24 @@ zelTracerRTASParallelOperationJoinExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ze_pfnFabricVertexGetExpCb_t pfnGetExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnJoinExtCb); + return func(hTracer, callback_type, pfnGetExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( +zelTracerFabricVertexGetSubVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4655,24 +4655,24 @@ zelTracerRTASParallelOperationDestroyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetSubVerticesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); + return func(hTracer, callback_type, pfnGetSubVerticesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( +zelTracerFabricVertexGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4680,24 +4680,24 @@ zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetVectorWidthPropertiesExtCb); + return func(hTracer, callback_type, pfnGetPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelGetAllocationPropertiesExpRegisterCallback( +zelTracerFabricVertexGetDeviceExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb + ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4705,24 +4705,24 @@ zelTracerKernelGetAllocationPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb + ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelGetAllocationPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetDeviceExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetAllocationPropertiesExpCb); + return func(hTracer, callback_type, pfnGetDeviceExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( +zelTracerDeviceGetFabricVertexExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb + ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4730,24 +4730,24 @@ zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb + ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemGetIpcHandleWithPropertiesRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetFabricVertexExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetIpcHandleWithPropertiesCb); + return func(hTracer, callback_type, pfnGetFabricVertexExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphCreateExtRegisterCallback( +zelTracerFabricEdgeGetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4755,24 +4755,24 @@ zelTracerGraphCreateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphCreateExtCb_t pfnCreateExtCb + ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphCreateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateExtCb); + return func(hTracer, callback_type, pfnGetExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginGraphCaptureExtRegisterCallback( +zelTracerFabricEdgeGetVerticesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4780,24 +4780,24 @@ zelTracerCommandListBeginGraphCaptureExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb + ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginGraphCaptureExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetVerticesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnBeginGraphCaptureExtCb); + return func(hTracer, callback_type, pfnGetVerticesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( +zelTracerFabricEdgeGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4805,24 +4805,24 @@ zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb + ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnBeginCaptureIntoGraphExtCb); + return func(hTracer, callback_type, pfnGetPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( +zelTracerEventQueryKernelTimestampsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb ) { if(!ze_lib::context->tracing_lib) @@ -4830,24 +4830,24 @@ zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb + ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryKernelTimestampsExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnIsGraphCaptureEnabledExtCb); + return func(hTracer, callback_type, pfnQueryKernelTimestampsExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListEndGraphCaptureExtRegisterCallback( +zelTracerRTASBuilderCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4855,24 +4855,24 @@ zelTracerCommandListEndGraphCaptureExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb + ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListEndGraphCaptureExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnEndGraphCaptureExtCb); + return func(hTracer, callback_type, pfnCreateExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetGraphExtRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4880,24 +4880,24 @@ zelTracerCommandListGetGraphExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb + ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetGraphExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetGraphExtCb); + return func(hTracer, callback_type, pfnGetBuildPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphGetPrimaryCommandListExtRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4905,24 +4905,24 @@ zelTracerGraphGetPrimaryCommandListExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb + ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphGetPrimaryCommandListExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPrimaryCommandListExtCb); + return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphSetDestructionCallbackExtRegisterCallback( +zelTracerRTASBuilderBuildExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4930,24 +4930,24 @@ zelTracerGraphSetDestructionCallbackExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb + ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphSetDestructionCallbackExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnSetDestructionCallbackExtCb); + return func(hTracer, callback_type, pfnBuildExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphInstantiateExtRegisterCallback( +zelTracerRTASBuilderDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4955,24 +4955,24 @@ zelTracerGraphInstantiateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb + ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphInstantiateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnInstantiateExtCb); + return func(hTracer, callback_type, pfnDestroyExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendGraphExtRegisterCallback( +zelTracerRTASParallelOperationCreateExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb ) { if(!ze_lib::context->tracing_lib) @@ -4980,24 +4980,24 @@ zelTracerCommandListAppendGraphExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb + ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendGraphExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendGraphExtCb); + return func(hTracer, callback_type, pfnCreateExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5005,24 +5005,24 @@ zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb + ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphGetSourceGraphExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetSourceGraphExtCb); + return func(hTracer, callback_type, pfnGetPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphIsEmptyExtRegisterCallback( +zelTracerRTASParallelOperationJoinExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5030,24 +5030,24 @@ zelTracerGraphIsEmptyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb + ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphIsEmptyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnIsEmptyExtCb); + return func(hTracer, callback_type, pfnJoinExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphDumpContentsExtRegisterCallback( +zelTracerRTASParallelOperationDestroyExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5055,24 +5055,24 @@ zelTracerGraphDumpContentsExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb + ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDumpContentsExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDumpContentsExtCb); + return func(hTracer, callback_type, pfnDestroyExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerExecutableGraphDestroyExtRegisterCallback( +zelTracerMemGetPitchFor2dImageRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb ) { if(!ze_lib::context->tracing_lib) @@ -5080,24 +5080,24 @@ zelTracerExecutableGraphDestroyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphDestroyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemGetPitchFor2dImageRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); + return func(hTracer, callback_type, pfnGetPitchFor2dImageCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerGraphDestroyExtRegisterCallback( +zelTracerImageGetDeviceOffsetExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5105,24 +5105,24 @@ zelTracerGraphDestroyExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb + ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDestroyExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetDeviceOffsetExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); + return func(hTracer, callback_type, pfnGetDeviceOffsetExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendHostFunctionRegisterCallback( +zelTracerCommandListCreateCloneExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5130,24 +5130,24 @@ zelTracerCommandListAppendHostFunctionRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb + ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendHostFunctionRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListCreateCloneExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendHostFunctionCb); + return func(hTracer, callback_type, pfnCreateCloneExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceReserveCacheExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5155,24 +5155,24 @@ zelTracerDeviceReserveCacheExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb + ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReserveCacheExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnReserveCacheExtCb); + return func(hTracer, callback_type, pfnImmediateAppendCommandListsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceSetCacheAdviceExtRegisterCallback( +zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb ) { if(!ze_lib::context->tracing_lib) @@ -5180,24 +5180,24 @@ zelTracerDeviceSetCacheAdviceExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb + ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceSetCacheAdviceExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnSetCacheAdviceExtCb); + return func(hTracer, callback_type, pfnImmediateAppendCommandListsWithParametersCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryTimestampsExpRegisterCallback( +zelTracerCommandListGetNextCommandIdExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5205,24 +5205,24 @@ zelTracerEventQueryTimestampsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryTimestampsExpCb_t pfnQueryTimestampsExpCb + ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryTimestampsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetNextCommandIdExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnQueryTimestampsExpCb); + return func(hTracer, callback_type, pfnGetNextCommandIdExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetMemoryPropertiesExpRegisterCallback( +zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5230,24 +5230,24 @@ zelTracerImageGetMemoryPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetMemoryPropertiesExpCb_t pfnGetMemoryPropertiesExpCb + ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetMemoryPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetMemoryPropertiesExpCb); + return func(hTracer, callback_type, pfnGetNextCommandIdWithKernelsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5255,24 +5255,24 @@ zelTracerImageViewCreateExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExtCb_t pfnViewCreateExtCb + ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnViewCreateExtCb); + return func(hTracer, callback_type, pfnUpdateMutableCommandsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageViewCreateExpRegisterCallback( +zelTracerCommandListIsMutableExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5280,24 +5280,24 @@ zelTracerImageViewCreateExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageViewCreateExpCb_t pfnViewCreateExpCb + ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageViewCreateExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsMutableExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnViewCreateExpCb); + return func(hTracer, callback_type, pfnIsMutableExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerKernelSchedulingHintExpRegisterCallback( +zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5305,24 +5305,24 @@ zelTracerKernelSchedulingHintExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb + ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelSchedulingHintExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnSchedulingHintExpCb); + return func(hTracer, callback_type, pfnUpdateMutableCommandSignalEventExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDevicePciGetPropertiesExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5330,24 +5330,24 @@ zelTracerDevicePciGetPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb + ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDevicePciGetPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnPciGetPropertiesExtCb); + return func(hTracer, callback_type, pfnUpdateMutableCommandWaitEventsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( +zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5355,24 +5355,24 @@ zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyToMemoryExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendImageCopyToMemoryExtCb); + return func(hTracer, callback_type, pfnUpdateMutableCommandKernelsExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( +zelTracerKernelGetBinaryExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5380,24 +5380,24 @@ zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb + ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendImageCopyFromMemoryExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelGetBinaryExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnAppendImageCopyFromMemoryExtCb); + return func(hTracer, callback_type, pfnGetBinaryExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetAllocPropertiesExtRegisterCallback( +zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5405,24 +5405,24 @@ zelTracerImageGetAllocPropertiesExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetAllocPropertiesExtCb_t pfnGetAllocPropertiesExtCb + ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetAllocPropertiesExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceImportExternalSemaphoreExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetAllocPropertiesExtCb); + return func(hTracer, callback_type, pfnImportExternalSemaphoreExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerModuleInspectLinkageExtRegisterCallback( +zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5430,24 +5430,24 @@ zelTracerModuleInspectLinkageExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb + ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerModuleInspectLinkageExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnInspectLinkageExtCb); + return func(hTracer, callback_type, pfnReleaseExternalSemaphoreExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemFreeExtRegisterCallback( +zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5455,24 +5455,24 @@ zelTracerMemFreeExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemFreeExtCb_t pfnFreeExtCb + ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemFreeExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnFreeExtCb); + return func(hTracer, callback_type, pfnAppendSignalExternalSemaphoreExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetExpRegisterCallback( +zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5480,24 +5480,24 @@ zelTracerFabricVertexGetExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetExpCb_t pfnGetExpCb + ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetExpCb); + return func(hTracer, callback_type, pfnAppendWaitExternalSemaphoreExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetSubVerticesExpRegisterCallback( +zelTracerRTASBuilderCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5505,24 +5505,24 @@ zelTracerFabricVertexGetSubVerticesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetSubVerticesExpCb_t pfnGetSubVerticesExpCb + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetSubVerticesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetSubVerticesExpCb); + return func(hTracer, callback_type, pfnCreateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetPropertiesExpRegisterCallback( +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5530,24 +5530,24 @@ zelTracerFabricVertexGetPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPropertiesExpCb); + return func(hTracer, callback_type, pfnGetBuildPropertiesExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricVertexGetDeviceExpRegisterCallback( +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5555,24 +5555,24 @@ zelTracerFabricVertexGetDeviceExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricVertexGetDeviceExpCb_t pfnGetDeviceExpCb + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricVertexGetDeviceExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetDeviceExpCb); + return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetFabricVertexExpRegisterCallback( +zelTracerRTASBuilderBuildExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5580,24 +5580,24 @@ zelTracerDeviceGetFabricVertexExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDeviceGetFabricVertexExpCb_t pfnGetFabricVertexExpCb + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetFabricVertexExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetFabricVertexExpCb); + return func(hTracer, callback_type, pfnBuildExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetExpRegisterCallback( +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5605,24 +5605,24 @@ zelTracerFabricEdgeGetExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetExpCb_t pfnGetExpCb + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetExpCb); + return func(hTracer, callback_type, pfnCommandListAppendCopyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetVerticesExpRegisterCallback( +zelTracerRTASBuilderDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5630,24 +5630,24 @@ zelTracerFabricEdgeGetVerticesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetVerticesExpCb_t pfnGetVerticesExpCb + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetVerticesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetVerticesExpCb); + return func(hTracer, callback_type, pfnDestroyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerFabricEdgeGetPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5655,24 +5655,24 @@ zelTracerFabricEdgeGetPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnFabricEdgeGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerFabricEdgeGetPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPropertiesExpCb); + return func(hTracer, callback_type, pfnCreateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerEventQueryKernelTimestampsExtRegisterCallback( +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5680,24 +5680,24 @@ zelTracerEventQueryKernelTimestampsExtRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnEventQueryKernelTimestampsExtCb_t pfnQueryKernelTimestampsExtCb + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerEventQueryKernelTimestampsExtRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnQueryKernelTimestampsExtCb); + return func(hTracer, callback_type, pfnGetPropertiesExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExpRegisterCallback( +zelTracerRTASParallelOperationJoinExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5705,24 +5705,24 @@ zelTracerRTASBuilderCreateExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateExpCb); + return func(hTracer, callback_type, pfnJoinExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( +zelTracerRTASParallelOperationDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5730,24 +5730,24 @@ zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetBuildPropertiesExpCb); + return func(hTracer, callback_type, pfnDestroyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5755,24 +5755,24 @@ zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExpCb); + return func(hTracer, callback_type, pfnGetVectorWidthPropertiesExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExpRegisterCallback( +zelTracerKernelGetAllocationPropertiesExpRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb + ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb ) { if(!ze_lib::context->tracing_lib) @@ -5780,24 +5780,24 @@ zelTracerRTASBuilderBuildExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb + ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelGetAllocationPropertiesExpRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnBuildExpCb); + return func(hTracer, callback_type, pfnGetAllocationPropertiesExpCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExpRegisterCallback( +zelTracerMemGetIpcHandleWithPropertiesRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb + ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb ) { if(!ze_lib::context->tracing_lib) @@ -5805,24 +5805,24 @@ zelTracerRTASBuilderDestroyExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExpCb_t pfnDestroyExpCb + ze_pfnMemGetIpcHandleWithPropertiesCb_t pfnGetIpcHandleWithPropertiesCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemGetIpcHandleWithPropertiesRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExpCb); + return func(hTracer, callback_type, pfnGetIpcHandleWithPropertiesCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExpRegisterCallback( +zelTracerGraphCreateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5830,24 +5830,24 @@ zelTracerRTASParallelOperationCreateExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb + ze_pfnGraphCreateExtCb_t pfnCreateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphCreateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateExpCb); + return func(hTracer, callback_type, pfnCreateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( +zelTracerCommandListBeginGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5855,24 +5855,24 @@ zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb + ze_pfnCommandListBeginGraphCaptureExtCb_t pfnBeginGraphCaptureExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginGraphCaptureExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPropertiesExpCb); + return func(hTracer, callback_type, pfnBeginGraphCaptureExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExpRegisterCallback( +zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5880,24 +5880,24 @@ zelTracerRTASParallelOperationJoinExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb + ze_pfnCommandListBeginCaptureIntoGraphExtCb_t pfnBeginCaptureIntoGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListBeginCaptureIntoGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnJoinExpCb); + return func(hTracer, callback_type, pfnBeginCaptureIntoGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExpRegisterCallback( +zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5905,24 +5905,24 @@ zelTracerRTASParallelOperationDestroyExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExpCb_t pfnDestroyExpCb + ze_pfnCommandListIsGraphCaptureEnabledExtCb_t pfnIsGraphCaptureEnabledExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsGraphCaptureEnabledExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnDestroyExpCb); + return func(hTracer, callback_type, pfnIsGraphCaptureEnabledExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerMemGetPitchFor2dImageRegisterCallback( +zelTracerCommandListEndGraphCaptureExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5930,24 +5930,24 @@ zelTracerMemGetPitchFor2dImageRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnMemGetPitchFor2dImageCb_t pfnGetPitchFor2dImageCb + ze_pfnCommandListEndGraphCaptureExtCb_t pfnEndGraphCaptureExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerMemGetPitchFor2dImageRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListEndGraphCaptureExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetPitchFor2dImageCb); + return func(hTracer, callback_type, pfnEndGraphCaptureExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerImageGetDeviceOffsetExpRegisterCallback( +zelTracerCommandListGetGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5955,24 +5955,24 @@ zelTracerImageGetDeviceOffsetExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnImageGetDeviceOffsetExpCb_t pfnGetDeviceOffsetExpCb + ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerImageGetDeviceOffsetExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetDeviceOffsetExpCb); + return func(hTracer, callback_type, pfnGetGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListCreateCloneExpRegisterCallback( +zelTracerGraphGetPrimaryCommandListExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ) { if(!ze_lib::context->tracing_lib) @@ -5980,24 +5980,24 @@ zelTracerCommandListCreateCloneExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListCreateCloneExpCb_t pfnCreateCloneExpCb + ze_pfnGraphGetPrimaryCommandListExtCb_t pfnGetPrimaryCommandListExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListCreateCloneExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphGetPrimaryCommandListExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnCreateCloneExpCb); + return func(hTracer, callback_type, pfnGetPrimaryCommandListExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( +zelTracerGraphSetDestructionCallbackExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6005,24 +6005,24 @@ zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsExpCb_t pfnImmediateAppendCommandListsExpCb + ze_pfnGraphSetDestructionCallbackExtCb_t pfnSetDestructionCallbackExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateAppendCommandListsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphSetDestructionCallbackExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnImmediateAppendCommandListsExpCb); + return func(hTracer, callback_type, pfnSetDestructionCallbackExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( +zelTracerGraphInstantiateExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6030,24 +6030,24 @@ zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListImmediateAppendCommandListsWithParametersCb_t pfnImmediateAppendCommandListsWithParametersCb + ze_pfnGraphInstantiateExtCb_t pfnInstantiateExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListImmediateAppendCommandListsWithParametersRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphInstantiateExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnImmediateAppendCommandListsWithParametersCb); + return func(hTracer, callback_type, pfnInstantiateExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdExpRegisterCallback( +zelTracerCommandListAppendGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6055,24 +6055,24 @@ zelTracerCommandListGetNextCommandIdExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdExpCb_t pfnGetNextCommandIdExpCb + ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetNextCommandIdExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetNextCommandIdExpCb); + return func(hTracer, callback_type, pfnAppendGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( +zelTracerExecutableGraphGetSourceGraphExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6080,24 +6080,24 @@ zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb + ze_pfnExecutableGraphGetSourceGraphExtCb_t pfnGetSourceGraphExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphGetSourceGraphExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnGetNextCommandIdWithKernelsExpCb); + return func(hTracer, callback_type, pfnGetSourceGraphExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( +zelTracerGraphIsEmptyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6105,24 +6105,24 @@ zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandsExpCb_t pfnUpdateMutableCommandsExpCb + ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphIsEmptyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnUpdateMutableCommandsExpCb); + return func(hTracer, callback_type, pfnIsEmptyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListIsMutableExpRegisterCallback( +zelTracerGraphDumpContentsExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6130,24 +6130,24 @@ zelTracerCommandListIsMutableExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListIsMutableExpCb_t pfnIsMutableExpCb + ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListIsMutableExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDumpContentsExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnIsMutableExpCb); + return func(hTracer, callback_type, pfnDumpContentsExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( +zelTracerExecutableGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6155,24 +6155,24 @@ zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandSignalEventExpCb_t pfnUpdateMutableCommandSignalEventExpCb + ze_pfnExecutableGraphDestroyExtCb_t pfnDestroyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandSignalEventExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerExecutableGraphDestroyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnUpdateMutableCommandSignalEventExpCb); + return func(hTracer, callback_type, pfnDestroyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( +zelTracerGraphDestroyExtRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb ) { if(!ze_lib::context->tracing_lib) @@ -6180,24 +6180,24 @@ zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb + ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphDestroyExtRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnUpdateMutableCommandWaitEventsExpCb); + return func(hTracer, callback_type, pfnDestroyExtCb); return ZE_RESULT_ERROR_UNINITIALIZED; } ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( +zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb ) { if(!ze_lib::context->tracing_lib) @@ -6205,14 +6205,14 @@ zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( zel_tracer_handle_t hTracer, zel_tracer_reg_t callback_type, - ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb + ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb ); auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback") ); + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendHostFunctionRegisterCallback") ); if(func) - return func(hTracer, callback_type, pfnUpdateMutableCommandKernelsExpCb); + return func(hTracer, callback_type, pfnAppendHostFunctionCb); return ZE_RESULT_ERROR_UNINITIALIZED; } diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index 05257272..13cc9ac5 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -9032,74 +9032,6 @@ zesTemperatureGetState( #endif } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Update PCI Link Speed (Downgrade or Upgrade (restore to its default -/// speed)) -/// -/// @details -/// - This function allows updating the PCI link speed to downgrade or -/// upgrade (restore to its default speed) the connection. -/// -/// @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_NULL_POINTER -/// + `nullptr == pendingAction` -/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS -/// + User does not have permissions to perform this operation. -ze_result_t ZE_APICALL -zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) -{ - #ifdef L0_STATIC_LOADER_BUILD - ze_result_t result = ZE_RESULT_SUCCESS; - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - static const zes_pfnDevicePciLinkSpeedUpdateExt_t pfnPciLinkSpeedUpdateExt = [&result] { - auto pfnPciLinkSpeedUpdateExt = ze_lib::context->zesDdiTable.load()->Device.pfnPciLinkSpeedUpdateExt; - if( nullptr == pfnPciLinkSpeedUpdateExt ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnPciLinkSpeedUpdateExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - auto pfnPciLinkSpeedUpdateExt = ze_lib::context->zesDdiTable.load()->Device.pfnPciLinkSpeedUpdateExt; - if( nullptr == pfnPciLinkSpeedUpdateExt ) { - if(!ze_lib::context->isInitialized) - return ZE_RESULT_ERROR_UNINITIALIZED; - else - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - - return pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - #endif -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Get power limits /// @@ -10964,4 +10896,72 @@ zesVFManagementGetVFCapabilitiesExp2( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Update PCI Link Speed (Downgrade or Upgrade (restore to its default +/// speed)) +/// +/// @details +/// - This function allows updating the PCI link speed to downgrade or +/// upgrade (restore to its default speed) the connection. +/// +/// @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_NULL_POINTER +/// + `nullptr == pendingAction` +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to perform this operation. +ze_result_t ZE_APICALL +zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnDevicePciLinkSpeedUpdateExt_t pfnPciLinkSpeedUpdateExt = [&result] { + auto pfnPciLinkSpeedUpdateExt = ze_lib::context->zesDdiTable.load()->Device.pfnPciLinkSpeedUpdateExt; + if( nullptr == pfnPciLinkSpeedUpdateExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnPciLinkSpeedUpdateExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnPciLinkSpeedUpdateExt = ze_lib::context->zesDdiTable.load()->Device.pfnPciLinkSpeedUpdateExt; + if( nullptr == pfnPciLinkSpeedUpdateExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + #endif +} + } // extern "C" diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index 3ab25ad7..94bb0c8b 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -2690,11 +2690,18 @@ zetTracerExpSetEnabled( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get sets of metric groups which could be collected concurrently. +/// @brief Calculate one or more sets of metric values from raw data. /// /// @details -/// - Re-arrange the input metric groups to provide sets of concurrent -/// metric groups. +/// - This function is similar to ::zetMetricGroupCalculateMetricValues +/// except it may calculate more than one set of metric values from a +/// single data buffer. There may be one set of metric values for each +/// sub-device, for example. +/// - Each set of metric values may consist of a different number of metric +/// values, returned as the metric value count. +/// - All metric values are calculated into a single buffer; use the metric +/// counts to determine which metric values belong to which set. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2711,18 +2718,39 @@ zetTracerExpSetEnabled( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawData` +/// + `nullptr == pSetCount` +/// + `nullptr == pTotalMetricValueCount` ze_result_t ZE_APICALL -zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. +zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -2730,50 +2758,40 @@ zetDeviceGetConcurrentMetricGroupsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp = [&result] { - auto pfnGetConcurrentMetricGroupsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnGetConcurrentMetricGroupsExp; - if( nullptr == pfnGetConcurrentMetricGroupsExp ) { + static const zet_pfnMetricGroupCalculateMultipleMetricValuesExp_t pfnCalculateMultipleMetricValuesExp = [&result] { + auto pfnCalculateMultipleMetricValuesExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + if( nullptr == pfnCalculateMultipleMetricValuesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetConcurrentMetricGroupsExp; + return pfnCalculateMultipleMetricValuesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + return pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetConcurrentMetricGroupsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnGetConcurrentMetricGroupsExp; - if( nullptr == pfnGetConcurrentMetricGroupsExp ) { + auto pfnCalculateMultipleMetricValuesExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + if( nullptr == pfnCalculateMultipleMetricValuesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + return pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create a metric tracer for a device. +/// @brief Returns metric timestamps synchronized with either host or device +/// timestamps at the time of invoking the function /// /// @details -/// - The notification event must have been created from an event pool that -/// was created using ::ZE_EVENT_POOL_FLAG_HOST_VISIBLE flag. -/// - The duration of the signal event created from an event pool that was -/// created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. -/// However, for consistency and orthogonality the event will report -/// correctly as signaled when used by other event API functionality. -/// - The application must **not** call this function from simultaneous -/// threads with the same device handle. -/// - The metric tracer is created in disabled state -/// - Metric groups must support sampling type -/// ZET_METRIC_SAMPLING_TYPE_EXP_FLAG_TRACER_BASED -/// - All metric groups must be first activated +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2790,25 +2808,18 @@ zetDeviceGetConcurrentMetricGroupsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phMetricGroups` -/// + `nullptr == desc` -/// + `nullptr == phMetricTracer` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// + `nullptr == globalTimestamp` +/// + `nullptr == metricTimestamp` ze_result_t ZE_APICALL -zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer +zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -2816,40 +2827,45 @@ zetMetricTracerCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerCreateExp_t pfnCreateExp = [&result] { - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + static const zet_pfnMetricGroupGetGlobalTimestampsExp_t pfnGetGlobalTimestampsExp = [&result] { + auto pfnGetGlobalTimestampsExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetGlobalTimestampsExp; + if( nullptr == pfnGetGlobalTimestampsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp; + return pfnGetGlobalTimestampsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + return pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnGetGlobalTimestampsExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetGlobalTimestampsExp; + if( nullptr == pfnGetGlobalTimestampsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + return pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric tracer. +/// @brief Export Metrics Data for system independent calculation. /// /// @details -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. +/// - This function exports raw data and necessary information to perform +/// metrics calculation of collected data in a different system than where +/// data was collected, which may or may not have accelerators. +/// - Implementations can choose to describe the data arrangement of the +/// exported data, using any mechanism which allows users to read and +/// process them. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2866,10 +2882,21 @@ zetMetricTracerCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawData` +/// + `nullptr == pExportDataSize` ze_result_t ZE_APICALL -zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer +zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -2877,43 +2904,46 @@ zetMetricTracerDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const zet_pfnMetricGroupGetExportDataExp_t pfnGetExportDataExp = [&result] { + auto pfnGetExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetExportDataExp; + if( nullptr == pfnGetExportDataExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnGetExportDataExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( hMetricTracer ); + return pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetExportDataExp; + if( nullptr == pfnGetExportDataExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( hMetricTracer ); + return pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Start events collection +/// @brief Calculate one or more sets of metric values from exported raw data. /// /// @details -/// - Driver implementations must make this API call have as minimal -/// overhead as possible, to allow applications start/stop event -/// collection at any point during execution -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. +/// - Calculate metrics values using exported data returned by +/// ::zetMetricGroupGetExportDataExp. +/// - This function is similar to +/// ::zetMetricGroupCalculateMultipleMetricValuesExp except it would +/// calculate from exported metric data. +/// - This function could be used to calculate metrics on a system different +/// from where the metric raw data was collected. +/// - The application may call this function from simultaneous threads. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2930,15 +2960,41 @@ zetMetricTracerDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pExportData` +/// + `nullptr == pCalculateDescriptor` +/// + `nullptr == pSetCount` +/// + `nullptr == pTotalMetricValueCount` ze_result_t ZE_APICALL -zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. +zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -2946,44 +3002,42 @@ zetMetricTracerEnableExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerEnableExp_t pfnEnableExp = [&result] { - auto pfnEnableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnEnableExp; - if( nullptr == pfnEnableExp ) { + static const zet_pfnMetricGroupCalculateMetricExportDataExp_t pfnCalculateMetricExportDataExp = [&result] { + auto pfnCalculateMetricExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMetricExportDataExp; + if( nullptr == pfnCalculateMetricExportDataExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEnableExp; + return pfnCalculateMetricExportDataExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnEnableExp( hMetricTracer, synchronous ); + return pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEnableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnEnableExp; - if( nullptr == pfnEnableExp ) { + auto pfnCalculateMetricExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMetricExportDataExp; + if( nullptr == pfnCalculateMetricExportDataExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEnableExp( hMetricTracer, synchronous ); + return pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Stop events collection +/// @brief Query and get the available metric programmable handles. /// /// @details -/// - Driver implementations must make this API call have as minimal -/// overhead as possible, to allow applications start/stop event -/// collection at any point during execution -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. -/// +/// - Query the available programmable handles using *pCount = 0. +/// - Returns all programmable metric handles available in the device. +/// - The application may call this function from simultaneous threads. +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -2999,16 +3053,21 @@ zetMetricTracerEnableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` ze_result_t ZE_APICALL -zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. +zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3016,42 +3075,39 @@ zetMetricTracerDisableExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerDisableExp_t pfnDisableExp = [&result] { - auto pfnDisableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDisableExp; - if( nullptr == pfnDisableExp ) { + static const zet_pfnMetricProgrammableGetExp_t pfnGetExp = [&result] { + auto pfnGetExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetExp; + if( nullptr == pfnGetExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDisableExp; + return pfnGetExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDisableExp( hMetricTracer, synchronous ); + return pfnGetExp( hDevice, pCount, phMetricProgrammables ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDisableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDisableExp; - if( nullptr == pfnDisableExp ) { + auto pfnGetExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetExp; + if( nullptr == pfnGetExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDisableExp( hMetricTracer, synchronous ); + return pfnGetExp( hDevice, pCount, phMetricProgrammables ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Read data from the metric tracer +/// @brief Get the properties of the metric programmable. /// /// @details -/// - The application must **not** call this function from simultaneous -/// threads with the same metric tracer handle. -/// - Data can be retrieved after tracer is disabled. When buffers are -/// drained ::ZE_RESULT_NOT_READY will be returned +/// - Returns the properties of the metric programmable. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3068,25 +3124,13 @@ zetMetricTracerDisableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hMetricProgrammable` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawDataSize` -/// - ::ZE_RESULT_WARNING_DROPPED_DATA -/// + Metric tracer data may have been dropped. -/// - ::ZE_RESULT_NOT_READY -/// + Metric tracer is disabled and no data is available to read. +/// + `nullptr == pProperties` ze_result_t ZE_APICALL -zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format +zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3094,36 +3138,40 @@ zetMetricTracerReadDataExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerReadDataExp_t pfnReadDataExp = [&result] { - auto pfnReadDataExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnReadDataExp; - if( nullptr == pfnReadDataExp ) { + static const zet_pfnMetricProgrammableGetPropertiesExp_t pfnGetPropertiesExp = [&result] { + auto pfnGetPropertiesExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReadDataExp; + return pfnGetPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + return pfnGetPropertiesExp( hMetricProgrammable, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReadDataExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnReadDataExp; - if( nullptr == pfnReadDataExp ) { + auto pfnGetPropertiesExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + return pfnGetPropertiesExp( hMetricProgrammable, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create a metric decoder for a given metric tracer. +/// @brief Get the information about the parameters of the metric programmable. +/// +/// @details +/// - Returns information about the parameters of the metric programmable +/// handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3140,13 +3188,21 @@ zetMetricTracerReadDataExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricTracer` +/// + `nullptr == hMetricProgrammable` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phMetricDecoder` +/// + `nullptr == pParameterCount` +/// + `nullptr == pParameterInfo` ze_result_t ZE_APICALL -zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object +zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3154,36 +3210,41 @@ zetMetricDecoderCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricDecoderCreateExp_t pfnCreateExp = [&result] { - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + static const zet_pfnMetricProgrammableGetParamInfoExp_t pfnGetParamInfoExp = [&result] { + auto pfnGetParamInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamInfoExp; + if( nullptr == pfnGetParamInfoExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp; + return pfnGetParamInfoExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExp( hMetricTracer, phMetricDecoder ); + return pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnGetParamInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamInfoExp; + if( nullptr == pfnGetParamInfoExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp( hMetricTracer, phMetricDecoder ); + return pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric decoder. +/// @brief Get the information about the parameter value of the metric +/// programmable. +/// +/// @details +/// - Returns the value-information about the parameter at the specific +/// ordinal of the metric programmable handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3200,10 +3261,22 @@ zetMetricDecoderCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == phMetricDecoder` +/// + `nullptr == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pValueInfoCount` +/// + `nullptr == pValueInfo` ze_result_t ZE_APICALL -zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object +zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3211,44 +3284,48 @@ zetMetricDecoderDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricDecoderDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const zet_pfnMetricProgrammableGetParamValueInfoExp_t pfnGetParamValueInfoExp = [&result] { + auto pfnGetParamValueInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamValueInfoExp; + if( nullptr == pfnGetParamValueInfoExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnGetParamValueInfoExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( phMetricDecoder ); + return pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetParamValueInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamValueInfoExp; + if( nullptr == pfnGetParamValueInfoExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( phMetricDecoder ); + return pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Return the list of the decodable metrics from the decoder. +/// @brief Create metric handles by applying parameter values on the metric +/// programmable handle. /// /// @details -/// - The decodable metrics handles returned by this API are defined by the -/// metric groups in the tracer on which the decoder was created. -/// - The decodable metrics handles returned by this API are only valid to -/// decode metrics raw data with ::zetMetricTracerDecodeExp(). Decodable -/// metric handles are not valid to compare with metrics handles included -/// in metric groups. +/// - Multiple parameter values could be used to prepare a metric. +/// - If parameterCount = 0, the default value of the metric programmable +/// would be used for all parameters. +/// - The implementation can post-fix a C string to the metric name and +/// description, based on the parameter values chosen. +/// - ::zetMetricProgrammableGetParamInfoExp() returns a list of parameters +/// in a defined order. +/// - Therefore, the list of values passed in to the API should respect the +/// same order such that the desired parameter is set with expected value /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3265,24 +3342,31 @@ zetMetricDecoderDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricDecoder` +/// + `nullptr == hMetricProgrammable` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -/// + `nullptr == phMetrics` +/// + `nullptr == pParameterValues` +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == pMetricHandleCount` ze_result_t ZE_APICALL -zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. +zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3290,36 +3374,41 @@ zetMetricDecoderGetDecodableMetricsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricDecoderGetDecodableMetricsExp_t pfnGetDecodableMetricsExp = [&result] { - auto pfnGetDecodableMetricsExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnGetDecodableMetricsExp; - if( nullptr == pfnGetDecodableMetricsExp ) { + static const zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2 = [&result] { + auto pfnCreateFromProgrammableExp2 = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp2; + if( nullptr == pfnCreateFromProgrammableExp2 ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDecodableMetricsExp; + return pfnCreateFromProgrammableExp2; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + return pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDecodableMetricsExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnGetDecodableMetricsExp; - if( nullptr == pfnGetDecodableMetricsExp ) { + auto pfnCreateFromProgrammableExp2 = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp2; + if( nullptr == pfnCreateFromProgrammableExp2 ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + return pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Decode raw events collected from a tracer. +/// @brief Create metric handles by applying parameter values on the metric +/// programmable handle. +/// +/// @details +/// - This API is deprecated. Please use +/// ::zetMetricCreateFromProgrammableExp2() /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3336,54 +3425,31 @@ zetMetricDecoderGetDecodableMetricsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == phMetricDecoder` +/// + `nullptr == hMetricProgrammable` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawDataSize` -/// + `nullptr == phMetrics` -/// + `nullptr == pSetCount` -/// + `nullptr == pMetricEntriesCount` +/// + `nullptr == pParameterValues` +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == pMetricHandleCount` ze_result_t ZE_APICALL -zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries +zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3391,41 +3457,45 @@ zetMetricTracerDecodeExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricTracerDecodeExp_t pfnDecodeExp = [&result] { - auto pfnDecodeExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDecodeExp; - if( nullptr == pfnDecodeExp ) { + static const zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp = [&result] { + auto pfnCreateFromProgrammableExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp; + if( nullptr == pfnCreateFromProgrammableExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDecodeExp; + return pfnCreateFromProgrammableExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + return pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDecodeExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDecodeExp; - if( nullptr == pfnDecodeExp ) { + auto pfnCreateFromProgrammableExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp; + if( nullptr == pfnCreateFromProgrammableExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + return pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Append a Marker based on the Metric source of the Metric Group, to a -/// Command List. +/// @brief Create multiple metric group handles from metric handles. /// /// @details -/// - This function appends a Marker based on the Metric source of the -/// Metric Group, to Command List. +/// - Creates multiple metric groups from metrics which were created using +/// ::zetMetricCreateFromProgrammableExp2(). +/// - Metrics whose Hardware resources do not overlap are added to same +/// metric group. +/// - The metric groups created using this API are managed by the +/// application and cannot be retrieved using ::zetMetricGroupGet(). +/// - The created metric groups are ready for activation and collection. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3433,7 +3503,6 @@ zetMetricTracerDecodeExp( /// - ::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 @@ -3442,15 +3511,31 @@ zetMetricTracerDecodeExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hMetricGroup` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + metricGroupCount is lesser than the number of metric group handles that could be created. ze_result_t ZE_APICALL -zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value +zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3458,49 +3543,40 @@ zetCommandListAppendMarkerExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp = [&result] { - auto pfnAppendMarkerExp = ze_lib::context->zetDdiTable.load()->CommandListExp.pfnAppendMarkerExp; - if( nullptr == pfnAppendMarkerExp ) { + static const zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp = [&result] { + auto pfnCreateMetricGroupsFromMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnCreateMetricGroupsFromMetricsExp; + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMarkerExp; + return pfnCreateMetricGroupsFromMetricsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + return pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMarkerExp = ze_lib::context->zetDdiTable.load()->CommandListExp.pfnAppendMarkerExp; - if( nullptr == pfnAppendMarkerExp ) { + auto pfnCreateMetricGroupsFromMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnCreateMetricGroupsFromMetricsExp; + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + return pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Enable Metrics collection during runtime. +/// @brief Create metric group handle. /// /// @details -/// - This API enables metric collection for a device/sub-device if not -/// already enabled. -/// - if ZET_ENABLE_METRICS=1 was already set, then calling this api would -/// be a NOP. -/// - This api should be called after calling zeInit(). -/// - If device is a root-device handle, then its sub-devices are also -/// enabled. -/// - ::zetDeviceDisableMetricsExp need not be called if if this api returns -/// error. -/// - This API can be used as runtime alternative to setting -/// ZET_ENABLE_METRICS=1. +/// - This API is deprecated. Please use +/// ::zetDeviceCreateMetricGroupsFromMetricsExp /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3518,9 +3594,23 @@ zetCommandListAppendMarkerExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == phMetricGroup` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < samplingType` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL -zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. +zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3528,46 +3618,48 @@ zetDeviceEnableMetricsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp = [&result] { - auto pfnEnableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnEnableMetricsExp; - if( nullptr == pfnEnableMetricsExp ) { + static const zet_pfnMetricGroupCreateExp_t pfnCreateExp = [&result] { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEnableMetricsExp; + return pfnCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnEnableMetricsExp( hDevice ); + return pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEnableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnEnableMetricsExp; - if( nullptr == pfnEnableMetricsExp ) { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnEnableMetricsExp( hDevice ); + return pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// @brief Add a metric handle to the metric group handle created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - This API disables metrics collection for a device/sub-device, if it -/// was previously enabled. -/// - If device is a root-device handle, then its sub-devices are also -/// disabled. -/// - The application has to ensure that all metric operations are complete -/// and all metric resources are released before this API is called. -/// - If there are metric operations in progress or metric resources are not -/// released, then ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE is returned. +/// - Reasons for failing to add the metric could be queried using +/// pErrorString +/// - Multiple additions of same metric would add the metric only once to +/// the hMetricGroup +/// - Metric handles from multiple domains may be used in a single metric +/// group. +/// - Metric handles from different sourceIds (refer +/// ::zet_metric_programmable_exp_properties_t) are not allowed in a +/// single metric group. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3575,7 +3667,6 @@ zetDeviceEnableMetricsExp( /// - ::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 @@ -3584,10 +3675,23 @@ zetDeviceEnableMetricsExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hMetricGroup` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If a Metric handle from a pre-defined metric group is requested to be added. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated. ze_result_t ZE_APICALL -zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled +zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3595,47 +3699,40 @@ zetDeviceDisableMetricsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp = [&result] { - auto pfnDisableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnDisableMetricsExp; - if( nullptr == pfnDisableMetricsExp ) { + static const zet_pfnMetricGroupAddMetricExp_t pfnAddMetricExp = [&result] { + auto pfnAddMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnAddMetricExp; + if( nullptr == pfnAddMetricExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDisableMetricsExp; + return pfnAddMetricExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDisableMetricsExp( hDevice ); + return pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDisableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnDisableMetricsExp; - if( nullptr == pfnDisableMetricsExp ) { + auto pfnAddMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnAddMetricExp; + if( nullptr == pfnAddMetricExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDisableMetricsExp( hDevice ); + return pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Calculate one or more sets of metric values from raw data. +/// @brief Remove a metric from the metric group handle created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - This function is similar to ::zetMetricGroupCalculateMetricValues -/// except it may calculate more than one set of metric values from a -/// single data buffer. There may be one set of metric values for each -/// sub-device, for example. -/// - Each set of metric values may consist of a different number of metric -/// values, returned as the metric value count. -/// - All metric values are calculated into a single buffer; use the metric -/// counts to determine which metric values belong to which set. -/// - The application may call this function from simultaneous threads. +/// - Remove an already added metric handle from the metric group. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3643,7 +3740,6 @@ zetDeviceDisableMetricsExp( /// - ::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 @@ -3653,38 +3749,16 @@ zetDeviceDisableMetricsExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawData` -/// + `nullptr == pSetCount` -/// + `nullptr == pTotalMetricValueCount` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to remove a metric not previously added to the metric group +/// + If the input metric group is a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated ze_result_t ZE_APICALL -zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. +zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3692,40 +3766,52 @@ zetMetricGroupCalculateMultipleMetricValuesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupCalculateMultipleMetricValuesExp_t pfnCalculateMultipleMetricValuesExp = [&result] { - auto pfnCalculateMultipleMetricValuesExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMultipleMetricValuesExp; - if( nullptr == pfnCalculateMultipleMetricValuesExp ) { + static const zet_pfnMetricGroupRemoveMetricExp_t pfnRemoveMetricExp = [&result] { + auto pfnRemoveMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnRemoveMetricExp; + if( nullptr == pfnRemoveMetricExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCalculateMultipleMetricValuesExp; + return pfnRemoveMetricExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return pfnRemoveMetricExp( hMetricGroup, hMetric ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCalculateMultipleMetricValuesExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMultipleMetricValuesExp; - if( nullptr == pfnCalculateMultipleMetricValuesExp ) { + auto pfnRemoveMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnRemoveMetricExp; + if( nullptr == pfnRemoveMetricExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return pfnRemoveMetricExp( hMetricGroup, hMetric ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns metric timestamps synchronized with either host or device -/// timestamps at the time of invoking the function +/// @brief Closes a created metric group using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp, so that it can be +/// activated. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - Finalizes the ::zetMetricGroupAddMetricExp and +/// ::zetMetricGroupRemoveMetricExp operations on the metric group. +/// - This is a necessary step before activation of the created metric +/// group. +/// - Add / Remove of metrics is possible after ::zetMetricGroupCloseExp. +/// However, a call to ::zetMetricGroupCloseExp is necessary after +/// modifying the metric group. +/// - Implementations could choose to add new metrics to the group during +/// ::zetMetricGroupCloseExp, which are related and might add value to the +/// metrics already added by the application +/// - Applications can query the list of metrics in the metric group using +/// ::zetMetricGet /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3733,7 +3819,6 @@ zetMetricGroupCalculateMultipleMetricValuesExp( /// - ::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 @@ -3743,17 +3828,13 @@ zetMetricGroupCalculateMultipleMetricValuesExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == globalTimestamp` -/// + `nullptr == metricTimestamp` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If the input metric group is a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If the metric group is currently activated ze_result_t ZE_APICALL -zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. +zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3761,45 +3842,46 @@ zetMetricGroupGetGlobalTimestampsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupGetGlobalTimestampsExp_t pfnGetGlobalTimestampsExp = [&result] { - auto pfnGetGlobalTimestampsExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetGlobalTimestampsExp; - if( nullptr == pfnGetGlobalTimestampsExp ) { + static const zet_pfnMetricGroupCloseExp_t pfnCloseExp = [&result] { + auto pfnCloseExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCloseExp; + if( nullptr == pfnCloseExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGlobalTimestampsExp; + return pfnCloseExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + return pfnCloseExp( hMetricGroup ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetGlobalTimestampsExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetGlobalTimestampsExp; - if( nullptr == pfnGetGlobalTimestampsExp ) { + auto pfnCloseExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCloseExp; + if( nullptr == pfnCloseExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + return pfnCloseExp( hMetricGroup ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Export Metrics Data for system independent calculation. +/// @brief Destroy a metric group created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - This function exports raw data and necessary information to perform -/// metrics calculation of collected data in a different system than where -/// data was collected, which may or may not have accelerators. -/// - Implementations can choose to describe the data arrangement of the -/// exported data, using any mechanism which allows users to read and -/// process them. -/// - The application may call this function from simultaneous threads. +/// - Metric handles created using ::zetMetricCreateFromProgrammableExp2 and +/// are part of the metricGroup are not destroyed. +/// - It is necessary to call ::zetMetricDestroyExp for each of the metric +/// handles (created from ::zetMetricCreateFromProgrammableExp2) to +/// destroy them. +/// - It is not necessary to remove the metrics in the metricGroup before +/// destroying it. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3807,7 +3889,6 @@ zetMetricGroupGetGlobalTimestampsExp( /// - ::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 @@ -3817,20 +3898,13 @@ zetMetricGroupGetGlobalTimestampsExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRawData` -/// + `nullptr == pExportDataSize` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to destroy a pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If trying to destroy an activated metric group ze_result_t ZE_APICALL -zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. +zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3838,46 +3912,40 @@ zetMetricGroupGetExportDataExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupGetExportDataExp_t pfnGetExportDataExp = [&result] { - auto pfnGetExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetExportDataExp; - if( nullptr == pfnGetExportDataExp ) { + static const zet_pfnMetricGroupDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExportDataExp; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + return pfnDestroyExp( hMetricGroup ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnGetExportDataExp; - if( nullptr == pfnGetExportDataExp ) { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + return pfnDestroyExp( hMetricGroup ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Calculate one or more sets of metric values from exported raw data. +/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp2. /// /// @details -/// - Calculate metrics values using exported data returned by -/// ::zetMetricGroupGetExportDataExp. -/// - This function is similar to -/// ::zetMetricGroupCalculateMultipleMetricValuesExp except it would -/// calculate from exported metric data. -/// - This function could be used to calculate metrics on a system different -/// from where the metric raw data was collected. -/// - The application may call this function from simultaneous threads. +/// - If a metric is added to a metric group, the metric has to be removed +/// using ::zetMetricGroupRemoveMetricExp before it can be destroyed. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3885,7 +3953,6 @@ zetMetricGroupGetExportDataExp( /// - ::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 @@ -3894,41 +3961,14 @@ zetMetricGroupGetExportDataExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES < type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pExportData` -/// + `nullptr == pCalculateDescriptor` -/// + `nullptr == pSetCount` -/// + `nullptr == pTotalMetricValueCount` +/// + `nullptr == hMetric` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + If trying to destroy a metric from pre-defined metric group +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + If trying to destroy a metric currently added to a metric group ze_result_t ZE_APICALL -zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. +zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { #ifdef L0_STATIC_LOADER_BUILD @@ -3936,41 +3976,40 @@ zetMetricGroupCalculateMetricExportDataExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupCalculateMetricExportDataExp_t pfnCalculateMetricExportDataExp = [&result] { - auto pfnCalculateMetricExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMetricExportDataExp; - if( nullptr == pfnCalculateMetricExportDataExp ) { + static const zet_pfnMetricDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCalculateMetricExportDataExp; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return pfnDestroyExp( hMetric ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCalculateMetricExportDataExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCalculateMetricExportDataExp; - if( nullptr == pfnCalculateMetricExportDataExp ) { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return pfnDestroyExp( hMetric ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query and get the available metric programmable handles. +/// @brief Get sets of metric groups which could be collected concurrently. /// /// @details -/// - Query the available programmable handles using *pCount = 0. -/// - Returns all programmable metric handles available in the device. -/// - The application may call this function from simultaneous threads. +/// - Re-arrange the input metric groups to provide sets of concurrent +/// metric groups. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -3988,20 +4027,17 @@ zetMetricGroupCalculateMetricExportDataExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` ze_result_t ZE_APICALL -zetMetricProgrammableGetExp( +zetDeviceGetConcurrentMetricGroupsExp( zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4009,39 +4045,50 @@ zetMetricProgrammableGetExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricProgrammableGetExp_t pfnGetExp = [&result] { - auto pfnGetExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + static const zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp = [&result] { + auto pfnGetConcurrentMetricGroupsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnGetConcurrentMetricGroupsExp; + if( nullptr == pfnGetConcurrentMetricGroupsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp; + return pfnGetConcurrentMetricGroupsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetExp( hDevice, pCount, phMetricProgrammables ); + return pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnGetConcurrentMetricGroupsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnGetConcurrentMetricGroupsExp; + if( nullptr == pfnGetConcurrentMetricGroupsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetExp( hDevice, pCount, phMetricProgrammables ); + return pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the properties of the metric programmable. +/// @brief Create a metric tracer for a device. /// /// @details -/// - Returns the properties of the metric programmable. +/// - The notification event must have been created from an event pool that +/// was created using ::ZE_EVENT_POOL_FLAG_HOST_VISIBLE flag. +/// - The duration of the signal event created from an event pool that was +/// created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. +/// However, for consistency and orthogonality the event will report +/// correctly as signaled when used by other event API functionality. +/// - The application must **not** call this function from simultaneous +/// threads with the same device handle. +/// - The metric tracer is created in disabled state +/// - Metric groups must support sampling type +/// ZET_METRIC_SAMPLING_TYPE_EXP_FLAG_TRACER_BASED +/// - All metric groups must be first activated /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4058,13 +4105,25 @@ zetMetricProgrammableGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == phMetricGroups` +/// + `nullptr == desc` +/// + `nullptr == phMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT ze_result_t ZE_APICALL -zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable +zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4072,40 +4131,40 @@ zetMetricProgrammableGetPropertiesExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricProgrammableGetPropertiesExp_t pfnGetPropertiesExp = [&result] { - auto pfnGetPropertiesExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + static const zet_pfnMetricTracerCreateExp_t pfnCreateExp = [&result] { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp; + return pfnCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + return pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + return pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the information about the parameters of the metric programmable. +/// @brief Destroy a metric tracer. /// /// @details -/// - Returns information about the parameters of the metric programmable -/// handle. +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4122,21 +4181,10 @@ zetMetricProgrammableGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterCount` -/// + `nullptr == pParameterInfo` +/// + `nullptr == hMetricTracer` ze_result_t ZE_APICALL -zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. +zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4144,41 +4192,43 @@ zetMetricProgrammableGetParamInfoExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricProgrammableGetParamInfoExp_t pfnGetParamInfoExp = [&result] { - auto pfnGetParamInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamInfoExp; - if( nullptr == pfnGetParamInfoExp ) { + static const zet_pfnMetricTracerDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetParamInfoExp; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + return pfnDestroyExp( hMetricTracer ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetParamInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamInfoExp; - if( nullptr == pfnGetParamInfoExp ) { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + return pfnDestroyExp( hMetricTracer ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Get the information about the parameter value of the metric -/// programmable. +/// @brief Start events collection /// /// @details -/// - Returns the value-information about the parameter at the specific -/// ordinal of the metric programmable handle. +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4195,22 +4245,15 @@ zetMetricProgrammableGetParamInfoExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pValueInfoCount` -/// + `nullptr == pValueInfo` +/// + `nullptr == hMetricTracer` ze_result_t ZE_APICALL -zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. +zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4218,48 +4261,43 @@ zetMetricProgrammableGetParamValueInfoExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricProgrammableGetParamValueInfoExp_t pfnGetParamValueInfoExp = [&result] { - auto pfnGetParamValueInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamValueInfoExp; - if( nullptr == pfnGetParamValueInfoExp ) { + static const zet_pfnMetricTracerEnableExp_t pfnEnableExp = [&result] { + auto pfnEnableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnEnableExp; + if( nullptr == pfnEnableExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetParamValueInfoExp; + return pfnEnableExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + return pfnEnableExp( hMetricTracer, synchronous ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetParamValueInfoExp = ze_lib::context->zetDdiTable.load()->MetricProgrammableExp.pfnGetParamValueInfoExp; - if( nullptr == pfnGetParamValueInfoExp ) { + auto pfnEnableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnEnableExp; + if( nullptr == pfnEnableExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + return pfnEnableExp( hMetricTracer, synchronous ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric handles by applying parameter values on the metric -/// programmable handle. +/// @brief Stop events collection /// /// @details -/// - Multiple parameter values could be used to prepare a metric. -/// - If parameterCount = 0, the default value of the metric programmable -/// would be used for all parameters. -/// - The implementation can post-fix a C string to the metric name and -/// description, based on the parameter values chosen. -/// - ::zetMetricProgrammableGetParamInfoExp() returns a list of parameters -/// in a defined order. -/// - Therefore, the list of values passed in to the API should respect the -/// same order such that the desired parameter is set with expected value +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4276,31 +4314,16 @@ zetMetricProgrammableGetParamValueInfoExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterValues` -/// + `nullptr == pName` -/// + `nullptr == pDescription` -/// + `nullptr == pMetricHandleCount` +/// + `nullptr == hMetricTracer` ze_result_t ZE_APICALL -zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. +zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4308,41 +4331,42 @@ zetMetricCreateFromProgrammableExp2( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2 = [&result] { - auto pfnCreateFromProgrammableExp2 = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp2; - if( nullptr == pfnCreateFromProgrammableExp2 ) { + static const zet_pfnMetricTracerDisableExp_t pfnDisableExp = [&result] { + auto pfnDisableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDisableExp; + if( nullptr == pfnDisableExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateFromProgrammableExp2; + return pfnDisableExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return pfnDisableExp( hMetricTracer, synchronous ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateFromProgrammableExp2 = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp2; - if( nullptr == pfnCreateFromProgrammableExp2 ) { + auto pfnDisableExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDisableExp; + if( nullptr == pfnDisableExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return pfnDisableExp( hMetricTracer, synchronous ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric handles by applying parameter values on the metric -/// programmable handle. +/// @brief Read data from the metric tracer /// /// @details -/// - This API is deprecated. Please use -/// ::zetMetricCreateFromProgrammableExp2() +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// - Data can be retrieved after tracer is disabled. When buffers are +/// drained ::ZE_RESULT_NOT_READY will be returned /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4359,31 +4383,25 @@ zetMetricCreateFromProgrammableExp2( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricProgrammable` +/// + `nullptr == hMetricTracer` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pParameterValues` -/// + `nullptr == pName` -/// + `nullptr == pDescription` -/// + `nullptr == pMetricHandleCount` +/// + `nullptr == pRawDataSize` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric tracer data may have been dropped. +/// - ::ZE_RESULT_NOT_READY +/// + Metric tracer is disabled and no data is available to read. ze_result_t ZE_APICALL -zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. +zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4391,45 +4409,36 @@ zetMetricCreateFromProgrammableExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp = [&result] { - auto pfnCreateFromProgrammableExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp; - if( nullptr == pfnCreateFromProgrammableExp ) { + static const zet_pfnMetricTracerReadDataExp_t pfnReadDataExp = [&result] { + auto pfnReadDataExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnReadDataExp; + if( nullptr == pfnReadDataExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateFromProgrammableExp; + return pfnReadDataExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateFromProgrammableExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnCreateFromProgrammableExp; - if( nullptr == pfnCreateFromProgrammableExp ) { + auto pfnReadDataExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnReadDataExp; + if( nullptr == pfnReadDataExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create multiple metric group handles from metric handles. -/// -/// @details -/// - Creates multiple metric groups from metrics which were created using -/// ::zetMetricCreateFromProgrammableExp2(). -/// - Metrics whose Hardware resources do not overlap are added to same -/// metric group. -/// - The metric groups created using this API are managed by the -/// application and cannot be retrieved using ::zetMetricGroupGet(). -/// - The created metric groups are ready for activation and collection. +/// @brief Create a metric decoder for a given metric tracer. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4437,6 +4446,7 @@ zetMetricCreateFromProgrammableExp( /// - ::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 @@ -4445,31 +4455,13 @@ zetMetricCreateFromProgrammableExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + metricGroupCount is lesser than the number of metric group handles that could be created. +/// + `nullptr == hMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetricDecoder` ze_result_t ZE_APICALL -zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. +zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4477,40 +4469,36 @@ zetDeviceCreateMetricGroupsFromMetricsExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp = [&result] { - auto pfnCreateMetricGroupsFromMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnCreateMetricGroupsFromMetricsExp; - if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { + static const zet_pfnMetricDecoderCreateExp_t pfnCreateExp = [&result] { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateMetricGroupsFromMetricsExp; + return pfnCreateExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + return pfnCreateExp( hMetricTracer, phMetricDecoder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateMetricGroupsFromMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnCreateMetricGroupsFromMetricsExp; - if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { + auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + return pfnCreateExp( hMetricTracer, phMetricDecoder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create metric group handle. -/// -/// @details -/// - This API is deprecated. Please use -/// ::zetDeviceCreateMetricGroupsFromMetricsExp +/// @brief Destroy a metric decoder. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4527,24 +4515,10 @@ zetDeviceCreateMetricGroupsFromMetricsExp( /// - ::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 == pName` -/// + `nullptr == pDescription` -/// + `nullptr == phMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < samplingType` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + `nullptr == phMetricDecoder` ze_result_t ZE_APICALL -zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle +zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4552,48 +4526,44 @@ zetMetricGroupCreateExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupCreateExp_t pfnCreateExp = [&result] { - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + static const zet_pfnMetricDecoderDestroyExp_t pfnDestroyExp = [&result] { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp; + return pfnDestroyExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + return pfnDestroyExp( phMetricDecoder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + return pfnDestroyExp( phMetricDecoder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Add a metric handle to the metric group handle created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. +/// @brief Return the list of the decodable metrics from the decoder. /// /// @details -/// - Reasons for failing to add the metric could be queried using -/// pErrorString -/// - Multiple additions of same metric would add the metric only once to -/// the hMetricGroup -/// - Metric handles from multiple domains may be used in a single metric -/// group. -/// - Metric handles from different sourceIds (refer -/// ::zet_metric_programmable_exp_properties_t) are not allowed in a -/// single metric group. +/// - The decodable metrics handles returned by this API are defined by the +/// metric groups in the tracer on which the decoder was created. +/// - The decodable metrics handles returned by this API are only valid to +/// decode metrics raw data with ::zetMetricTracerDecodeExp(). Decodable +/// metric handles are not valid to compare with metrics handles included +/// in metric groups. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4601,6 +4571,7 @@ zetMetricGroupCreateExp( /// - ::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 @@ -4609,23 +4580,24 @@ zetMetricGroupCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricGroup` -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If a Metric handle from a pre-defined metric group is requested to be added. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated. +/// + `nullptr == hMetricDecoder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +/// + `nullptr == phMetrics` ze_result_t ZE_APICALL -zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. +zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4633,40 +4605,36 @@ zetMetricGroupAddMetricExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupAddMetricExp_t pfnAddMetricExp = [&result] { - auto pfnAddMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnAddMetricExp; - if( nullptr == pfnAddMetricExp ) { + static const zet_pfnMetricDecoderGetDecodableMetricsExp_t pfnGetDecodableMetricsExp = [&result] { + auto pfnGetDecodableMetricsExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnGetDecodableMetricsExp; + if( nullptr == pfnGetDecodableMetricsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAddMetricExp; + return pfnGetDecodableMetricsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + return pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAddMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnAddMetricExp; - if( nullptr == pfnAddMetricExp ) { + auto pfnGetDecodableMetricsExp = ze_lib::context->zetDdiTable.load()->MetricDecoderExp.pfnGetDecodableMetricsExp; + if( nullptr == pfnGetDecodableMetricsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + return pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Remove a metric from the metric group handle created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. -/// -/// @details -/// - Remove an already added metric handle from the metric group. +/// @brief Decode raw events collected from a tracer. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4674,6 +4642,7 @@ zetMetricGroupAddMetricExp( /// - ::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 @@ -4682,17 +4651,54 @@ zetMetricGroupAddMetricExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricGroup` -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to remove a metric not previously added to the metric group -/// + If the input metric group is a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated +/// + `nullptr == phMetricDecoder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawDataSize` +/// + `nullptr == phMetrics` +/// + `nullptr == pSetCount` +/// + `nullptr == pMetricEntriesCount` ze_result_t ZE_APICALL -zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. +zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4700,52 +4706,41 @@ zetMetricGroupRemoveMetricExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupRemoveMetricExp_t pfnRemoveMetricExp = [&result] { - auto pfnRemoveMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnRemoveMetricExp; - if( nullptr == pfnRemoveMetricExp ) { + static const zet_pfnMetricTracerDecodeExp_t pfnDecodeExp = [&result] { + auto pfnDecodeExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDecodeExp; + if( nullptr == pfnDecodeExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRemoveMetricExp; + return pfnDecodeExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnRemoveMetricExp( hMetricGroup, hMetric ); + return pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRemoveMetricExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnRemoveMetricExp; - if( nullptr == pfnRemoveMetricExp ) { + auto pfnDecodeExp = ze_lib::context->zetDdiTable.load()->MetricTracerExp.pfnDecodeExp; + if( nullptr == pfnDecodeExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRemoveMetricExp( hMetricGroup, hMetric ); + return pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes a created metric group using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp, so that it can be -/// activated. +/// @brief Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. /// /// @details -/// - Finalizes the ::zetMetricGroupAddMetricExp and -/// ::zetMetricGroupRemoveMetricExp operations on the metric group. -/// - This is a necessary step before activation of the created metric -/// group. -/// - Add / Remove of metrics is possible after ::zetMetricGroupCloseExp. -/// However, a call to ::zetMetricGroupCloseExp is necessary after -/// modifying the metric group. -/// - Implementations could choose to add new metrics to the group during -/// ::zetMetricGroupCloseExp, which are related and might add value to the -/// metrics already added by the application -/// - Applications can query the list of metrics in the metric group using -/// ::zetMetricGet +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4753,6 +4748,7 @@ zetMetricGroupRemoveMetricExp( /// - ::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 @@ -4761,14 +4757,15 @@ zetMetricGroupRemoveMetricExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` /// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If the input metric group is a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If the metric group is currently activated ze_result_t ZE_APICALL -zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group +zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4776,46 +4773,49 @@ zetMetricGroupCloseExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupCloseExp_t pfnCloseExp = [&result] { - auto pfnCloseExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCloseExp; - if( nullptr == pfnCloseExp ) { + static const zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp = [&result] { + auto pfnAppendMarkerExp = ze_lib::context->zetDdiTable.load()->CommandListExp.pfnAppendMarkerExp; + if( nullptr == pfnAppendMarkerExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseExp; + return pfnAppendMarkerExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCloseExp( hMetricGroup ); + return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCloseExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnCloseExp; - if( nullptr == pfnCloseExp ) { + auto pfnAppendMarkerExp = ze_lib::context->zetDdiTable.load()->CommandListExp.pfnAppendMarkerExp; + if( nullptr == pfnAppendMarkerExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCloseExp( hMetricGroup ); + return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric group created using -/// ::zetDeviceCreateMetricGroupsFromMetricsExp. +/// @brief Enable Metrics collection during runtime. /// /// @details -/// - Metric handles created using ::zetMetricCreateFromProgrammableExp2 and -/// are part of the metricGroup are not destroyed. -/// - It is necessary to call ::zetMetricDestroyExp for each of the metric -/// handles (created from ::zetMetricCreateFromProgrammableExp2) to -/// destroy them. -/// - It is not necessary to remove the metrics in the metricGroup before -/// destroying it. +/// - This API enables metric collection for a device/sub-device if not +/// already enabled. +/// - if ZET_ENABLE_METRICS=1 was already set, then calling this api would +/// be a NOP. +/// - This api should be called after calling zeInit(). +/// - If device is a root-device handle, then its sub-devices are also +/// enabled. +/// - ::zetDeviceDisableMetricsExp need not be called if if this api returns +/// error. +/// - This API can be used as runtime alternative to setting +/// ZET_ENABLE_METRICS=1. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4823,6 +4823,7 @@ zetMetricGroupCloseExp( /// - ::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 @@ -4831,14 +4832,10 @@ zetMetricGroupCloseExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetricGroup` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to destroy a pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If trying to destroy an activated metric group +/// + `nullptr == hDevice` ze_result_t ZE_APICALL -zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy +zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4846,40 +4843,46 @@ zetMetricGroupDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricGroupDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp = [&result] { + auto pfnEnableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnEnableMetricsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( hMetricGroup ); + return pfnEnableMetricsExp( hDevice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricGroupExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnEnableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( hMetricGroup ); + return pfnEnableMetricsExp( hDevice ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp2. +/// @brief Disable Metrics collection during runtime, if it was already enabled. /// /// @details -/// - If a metric is added to a metric group, the metric has to be removed -/// using ::zetMetricGroupRemoveMetricExp before it can be destroyed. +/// - This API disables metrics collection for a device/sub-device, if it +/// was previously enabled. +/// - If device is a root-device handle, then its sub-devices are also +/// disabled. +/// - The application has to ensure that all metric operations are complete +/// and all metric resources are released before this API is called. +/// - If there are metric operations in progress or metric resources are not +/// released, then ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE is returned. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4887,6 +4890,7 @@ zetMetricGroupDestroyExp( /// - ::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 @@ -4895,14 +4899,10 @@ zetMetricGroupDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hMetric` -/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + If trying to destroy a metric from pre-defined metric group -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + If trying to destroy a metric currently added to a metric group +/// + `nullptr == hDevice` ze_result_t ZE_APICALL -zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy +zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { #ifdef L0_STATIC_LOADER_BUILD @@ -4910,31 +4910,31 @@ zetMetricDestroyExp( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - static const zet_pfnMetricDestroyExp_t pfnDestroyExp = [&result] { - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + static const zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp = [&result] { + auto pfnDisableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnDisableMetricsExp; + if( nullptr == pfnDisableMetricsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp; + return pfnDisableMetricsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnDestroyExp( hMetric ); + return pfnDisableMetricsExp( hDevice ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = ze_lib::context->zetDdiTable.load()->MetricExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnDisableMetricsExp = ze_lib::context->zetDdiTable.load()->DeviceExp.pfnDisableMetricsExp; + if( nullptr == pfnDisableMetricsExp ) { if(!ze_lib::context->isInitialized) return ZE_RESULT_ERROR_UNINITIALIZED; else return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnDestroyExp( hMetric ); + return pfnDisableMetricsExp( hDevice ); #endif } diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 7857f3e6..2b51dad8 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -43,12 +43,6 @@ namespace loader return result; } // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. - zeGetExecutableGraphProcAddrTableFromDriver(driver); - result = ZE_RESULT_SUCCESS; - // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. - zeGetGraphProcAddrTableFromDriver(driver); - result = ZE_RESULT_SUCCESS; - // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. zeGetRTASBuilderProcAddrTableFromDriver(driver); result = ZE_RESULT_SUCCESS; // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. @@ -151,6 +145,12 @@ namespace loader // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. zeGetFabricVertexExpProcAddrTableFromDriver(driver); result = ZE_RESULT_SUCCESS; + // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. + zeGetExecutableGraphProcAddrTableFromDriver(driver); + result = ZE_RESULT_SUCCESS; + // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. + zeGetGraphProcAddrTableFromDriver(driver); + result = ZE_RESULT_SUCCESS; return result; } /////////////////////////////////////////////////////////////////////////////// @@ -5943,215 +5943,200 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hKernel )->dditable; - auto pfnGetBinaryExp = dditable->ze.KernelExp.pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnReserveCacheExt = dditable->ze.Device.pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hKernel = reinterpret_cast( hKernel )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeDeviceSetCacheAdviceExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnImportExternalSemaphoreExt = dditable->ze.Device.pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) + auto pfnSetCacheAdviceExt = dditable->ze.Device.pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phSemaphore = reinterpret_cast( - context->ze_external_semaphore_ext_factory.getInstance( *phSemaphore, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeEventQueryTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hSemaphore )->dditable; - auto pfnReleaseExternalSemaphoreExt = dditable->ze.Device.pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) + auto dditable = reinterpret_cast( hEvent )->dditable; + auto pfnQueryTimestampsExp = dditable->ze.EventExp.pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hSemaphore = reinterpret_cast( hSemaphore )->handle; + hEvent = reinterpret_cast( hEvent )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeImageGetMemoryPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendSignalExternalSemaphoreExt = dditable->ze.CommandList.pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) + auto dditable = reinterpret_cast( hImage )->dditable; + auto pfnGetMemoryPropertiesExp = dditable->ze.ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handles to driver handles - auto phSemaphoresLocal = new ze_external_semaphore_ext_handle_t [numSemaphores]; - for( size_t i = 0; ( nullptr != phSemaphores ) && ( i < numSemaphores ); ++i ) - phSemaphoresLocal[ i ] = reinterpret_cast( phSemaphores[ i ] )->handle; - - // convert loader handle to driver handle - hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; - - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + hImage = reinterpret_cast( hImage )->handle; // forward to device-driver - result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phSemaphoresLocal; - delete []phWaitEventsLocal; + result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeImageViewCreateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendWaitExternalSemaphoreExt = dditable->ze.CommandList.pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnViewCreateExt = dditable->ze.Image.pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handles to driver handles - auto phSemaphoresLocal = new ze_external_semaphore_ext_handle_t [numSemaphores]; - for( size_t i = 0; ( nullptr != phSemaphores ) && ( i < numSemaphores ); ++i ) - phSemaphoresLocal[ i ] = reinterpret_cast( phSemaphores[ i ] )->handle; + hContext = reinterpret_cast( hContext )->handle; // convert loader handle to driver handle - hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + hDevice = reinterpret_cast( hDevice )->handle; - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + // convert loader handle to driver handle + hImage = reinterpret_cast( hImage )->handle; // forward to device-driver - result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phSemaphoresLocal; - delete []phWaitEventsLocal; + result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phImageView = reinterpret_cast( + context->ze_image_factory.getInstance( *phImageView, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeImageViewCreateExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnCreateExt = dditable->ze.RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnViewCreateExp = dditable->ze.ImageExp.pfnViewCreateExp; + if( nullptr == pfnViewCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hContext = reinterpret_cast( hContext )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // convert loader handle to driver handle + hImage = reinterpret_cast( hImage )->handle; // forward to device-driver - result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -6159,8 +6144,14 @@ namespace loader try { // convert driver handle to loader handle - *phBuilder = reinterpret_cast( - context->ze_rtas_builder_ext_factory.getInstance( *phBuilder, dditable ) ); + ze_image_handle_t internalHandlePtr = *phImageView; + *phImageView = reinterpret_cast( + context->ze_image_factory.getInstance( *phImageView, dditable ) ); + // convert loader handle to driver handle and store in map + { + std::lock_guard lock(context->image_handle_map_lock); + context->image_handle_map.insert({context->ze_image_factory.getInstance( internalHandlePtr, dditable ), internalHandlePtr}); + } } catch( std::bad_alloc& ) { @@ -6171,106 +6162,115 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeKernelSchedulingHintExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnGetBuildPropertiesExt = dditable->ze.RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) + auto dditable = reinterpret_cast( hKernel )->dditable; + auto pfnSchedulingHintExp = dditable->ze.KernelExp.pfnSchedulingHintExp; + if( nullptr == pfnSchedulingHintExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; + hKernel = reinterpret_cast( hKernel )->handle; // forward to device-driver - result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnSchedulingHintExp( hKernel, pHint ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeDevicePciGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnRTASFormatCompatibilityCheckExt = dditable->ze.Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnPciGetPropertiesExt = dditable->ze.Device.pfnPciGetPropertiesExt; + if( nullptr == pfnPciGetPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnBuildExt = dditable->ze.RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendImageCopyToMemoryExt = dditable->ze.CommandList.pfnAppendImageCopyToMemoryExt; + if( nullptr == pfnAppendImageCopyToMemoryExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // convert loader handle to driver handle - hParallelOperation = ( hParallelOperation ) ? reinterpret_cast( hParallelOperation )->handle : nullptr; + hSrcImage = reinterpret_cast( hSrcImage )->handle; + + // convert loader handle to driver handle + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -6282,13 +6282,16 @@ namespace loader // extract driver's function pointer table auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnCommandListAppendCopyExt = dditable->ze.RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) + auto pfnAppendImageCopyFromMemoryExt = dditable->ze.CommandList.pfnAppendImageCopyFromMemoryExt; + if( nullptr == pfnAppendImageCopyFromMemoryExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hCommandList = reinterpret_cast( hCommandList )->handle; + // convert loader handle to driver handle + hDstImage = reinterpret_cast( hDstImage )->handle; + // convert loader handle to driver handle hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; @@ -6298,63 +6301,69 @@ namespace loader phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal ); delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeImageGetAllocPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnDestroyExt = dditable->ze.RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnGetAllocPropertiesExt = dditable->ze.Image.pfnGetAllocPropertiesExt; + if( nullptr == pfnGetAllocPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; - - // forward to device-driver - result = pfnDestroyExt( hBuilder ); + hContext = reinterpret_cast( hContext )->handle; - if( ZE_RESULT_SUCCESS != result ) - return result; + // convert loader handle to driver handle + hImage = reinterpret_cast( hImage )->handle; - // release loader handle - context->ze_rtas_builder_ext_factory.release( hBuilder ); + // forward to device-driver + result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt + /// @brief Intercept function for zeModuleInspectLinkageExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnCreateExt = dditable->ze.RTASParallelOperation.pfnCreateExt; - if( nullptr == pfnCreateExt ) + auto dditable = reinterpret_cast( phModules[ 0 ] )->dditable; + auto pfnInspectLinkageExt = dditable->ze.Module.pfnInspectLinkageExt; + if( nullptr == pfnInspectLinkageExt ) return ZE_RESULT_ERROR_UNINITIALIZED; - // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + // convert loader handles to driver handles + auto phModulesLocal = new ze_module_handle_t [numModules]; + for( size_t i = 0; ( nullptr != phModules ) && ( i < numModules ); ++i ) + phModulesLocal[ i ] = reinterpret_cast( phModules[ i ] )->handle; // forward to device-driver - result = pfnCreateExt( hDriver, phParallelOperation ); + result = pfnInspectLinkageExt( pInspectDesc, numModules, phModulesLocal, phLog ); + delete []phModulesLocal; if( ZE_RESULT_SUCCESS != result ) return result; @@ -6362,8 +6371,8 @@ namespace loader try { // convert driver handle to loader handle - *phParallelOperation = reinterpret_cast( - context->ze_rtas_parallel_operation_ext_factory.getInstance( *phParallelOperation, dditable ) ); + *phLog = reinterpret_cast( + context->ze_module_build_log_factory.getInstance( *phLog, dditable ) ); } catch( std::bad_alloc& ) { @@ -6374,210 +6383,273 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeMemFreeExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnGetPropertiesExt = dditable->ze.RTASParallelOperation.pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnFreeExt = dditable->ze.Mem.pfnFreeExt; + if( nullptr == pfnFreeExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hContext = reinterpret_cast( hContext )->handle; // forward to device-driver - result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeFabricVertexGetExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnJoinExt = dditable->ze.RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnGetExp = dditable->ze.FabricVertexExp.pfnGetExp; + if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnJoinExt( hParallelOperation ); + result = pfnGetExp( hDriver, pCount, phVertices ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phVertices ) && ( i < *pCount ); ++i ) + phVertices[ i ] = reinterpret_cast( + context->ze_fabric_vertex_factory.getInstance( phVertices[ i ], dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnDestroyExt = dditable->ze.RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) + auto dditable = reinterpret_cast( hVertex )->dditable; + auto pfnGetSubVerticesExp = dditable->ze.FabricVertexExp.pfnGetSubVerticesExp; + if( nullptr == pfnGetSubVerticesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hVertex = reinterpret_cast( hVertex )->handle; // forward to device-driver - result = pfnDestroyExt( hParallelOperation ); + result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); if( ZE_RESULT_SUCCESS != result ) return result; - // release loader handle - context->ze_rtas_parallel_operation_ext_factory.release( hParallelOperation ); + try + { + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phSubvertices ) && ( i < *pCount ); ++i ) + phSubvertices[ i ] = reinterpret_cast( + context->ze_fabric_vertex_factory.getInstance( phSubvertices[ i ], dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeFabricVertexGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnGetVectorWidthPropertiesExt = dditable->ze.Device.pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) + auto dditable = reinterpret_cast( hVertex )->dditable; + auto pfnGetPropertiesExp = dditable->ze.FabricVertexExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hVertex = reinterpret_cast( hVertex )->handle; // forward to device-driver - result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + result = pfnGetPropertiesExp( hVertex, pVertexProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeFabricVertexGetDeviceExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hKernel )->dditable; - auto pfnGetAllocationPropertiesExp = dditable->ze.KernelExp.pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) + auto dditable = reinterpret_cast( hVertex )->dditable; + auto pfnGetDeviceExp = dditable->ze.FabricVertexExp.pfnGetDeviceExp; + if( nullptr == pfnGetDeviceExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hKernel = reinterpret_cast( hKernel )->handle; + hVertex = reinterpret_cast( hVertex )->handle; // forward to device-driver - result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + result = pfnGetDeviceExp( hVertex, 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 zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeDeviceGetFabricVertexExp __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnGetIpcHandleWithProperties = dditable->ze.Mem.pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetFabricVertexExp = dditable->ze.DeviceExp.pfnGetFabricVertexExp; + if( nullptr == pfnGetFabricVertexExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + result = pfnGetFabricVertexExp( hDevice, phVertex ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phVertex = reinterpret_cast( + context->ze_fabric_vertex_factory.getInstance( *phVertex, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphCreateExt + /// @brief Intercept function for zeFabricEdgeGetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnCreateExt = dditable->ze.Graph.pfnCreateExt; - if( nullptr == pfnCreateExt ) + auto dditable = reinterpret_cast( hVertexA )->dditable; + auto pfnGetExp = dditable->ze.FabricEdgeExp.pfnGetExp; + if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hVertexA = reinterpret_cast( hVertexA )->handle; + + // convert loader handle to driver handle + hVertexB = reinterpret_cast( hVertexB )->handle; // forward to device-driver - result = pfnCreateExt( hContext, pNext, phGraph ); + result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); if( ZE_RESULT_SUCCESS != result ) return result; try { - // convert driver handle to loader handle - *phGraph = reinterpret_cast( - context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phEdges ) && ( i < *pCount ); ++i ) + phEdges[ i ] = reinterpret_cast( + context->ze_fabric_edge_factory.getInstance( phEdges[ i ], dditable ) ); } catch( std::bad_alloc& ) { @@ -6588,108 +6660,146 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginGraphCaptureExt + /// @brief Intercept function for zeFabricEdgeGetVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnBeginGraphCaptureExt = dditable->ze.CommandList.pfnBeginGraphCaptureExt; - if( nullptr == pfnBeginGraphCaptureExt ) + auto dditable = reinterpret_cast( hEdge )->dditable; + auto pfnGetVerticesExp = dditable->ze.FabricEdgeExp.pfnGetVerticesExp; + if( nullptr == pfnGetVerticesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hEdge = reinterpret_cast( hEdge )->handle; // forward to device-driver - result = pfnBeginGraphCaptureExt( hCommandList, pNext ); + result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phVertexA = reinterpret_cast( + context->ze_fabric_vertex_factory.getInstance( *phVertexA, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + try + { + // convert driver handle to loader handle + *phVertexB = reinterpret_cast( + context->ze_fabric_vertex_factory.getInstance( *phVertexB, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnBeginCaptureIntoGraphExt = dditable->ze.CommandList.pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnBeginCaptureIntoGraphExt ) + auto dditable = reinterpret_cast( hEdge )->dditable; + auto pfnGetPropertiesExp = dditable->ze.FabricEdgeExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hEdge = reinterpret_cast( hEdge )->handle; // forward to device-driver - result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + /// @brief Intercept function for zeEventQueryKernelTimestampsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnIsGraphCaptureEnabledExt = dditable->ze.CommandList.pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnIsGraphCaptureEnabledExt ) + auto dditable = reinterpret_cast( hEvent )->dditable; + auto pfnQueryKernelTimestampsExt = dditable->ze.Event.pfnQueryKernelTimestampsExt; + if( nullptr == pfnQueryKernelTimestampsExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hEvent = reinterpret_cast( hEvent )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnIsGraphCaptureEnabledExt( hCommandList ); + result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListEndGraphCaptureExt + /// @brief Intercept function for zeRTASBuilderCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnEndGraphCaptureExt = dditable->ze.CommandList.pfnEndGraphCaptureExt; - if( nullptr == pfnEndGraphCaptureExt ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnCreateExp = dditable->ze.RTASBuilderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -6697,8 +6807,8 @@ namespace loader try { // convert driver handle to loader handle - *phGraph = reinterpret_cast( - context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + *phBuilder = reinterpret_cast( + context->ze_rtas_builder_exp_factory.getInstance( *phBuilder, dditable ) ); } catch( std::bad_alloc& ) { @@ -6709,218 +6819,147 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetGraphExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnGetGraphExt = dditable->ze.CommandList.pfnGetGraphExt; - if( nullptr == pfnGetGraphExt ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnGetBuildPropertiesExp = dditable->ze.RTASBuilderExp.pfnGetBuildPropertiesExp; + if( nullptr == pfnGetBuildPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hBuilder = reinterpret_cast( hBuilder )->handle; // forward to device-driver - result = pfnGetGraphExt( hCommandList, phGraph ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phGraph = reinterpret_cast( - context->ze_graph_factory.getInstance( *phGraph, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnGetPrimaryCommandListExt = dditable->ze.Graph.pfnGetPrimaryCommandListExt; - if( nullptr == pfnGetPrimaryCommandListExt ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnRTASFormatCompatibilityCheckExp = dditable->ze.DriverExp.pfnRTASFormatCompatibilityCheckExp; + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phCommandList = reinterpret_cast( - context->ze_command_list_factory.getInstance( *phCommandList, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphSetDestructionCallbackExt + /// @brief Intercept function for zeRTASBuilderBuildExp __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnSetDestructionCallbackExt = dditable->ze.Graph.pfnSetDestructionCallbackExt; - if( nullptr == pfnSetDestructionCallbackExt ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnBuildExp = dditable->ze.RTASBuilderExp.pfnBuildExp; + if( nullptr == pfnBuildExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hBuilder = reinterpret_cast( hBuilder )->handle; + + // convert loader handle to driver handle + hParallelOperation = ( hParallelOperation ) ? reinterpret_cast( hParallelOperation )->handle : nullptr; // forward to device-driver - result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphInstantiateExt + /// @brief Intercept function for zeRTASBuilderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnInstantiateExt = dditable->ze.Graph.pfnInstantiateExt; - if( nullptr == pfnInstantiateExt ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnDestroyExp = dditable->ze.RTASBuilderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hBuilder = reinterpret_cast( hBuilder )->handle; // forward to device-driver - result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + result = pfnDestroyExp( hBuilder ); if( ZE_RESULT_SUCCESS != result ) return result; - try - { - // convert driver handle to loader handle - *phExecutableGraph = reinterpret_cast( - context->ze_executable_graph_factory.getInstance( *phExecutableGraph, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendGraphExt - __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendGraphExt = dditable->ze.CommandList.pfnAppendGraphExt; - if( nullptr == pfnAppendGraphExt ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; - - // convert loader handle to driver handle - hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; - - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; - - // forward to device-driver - result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phWaitEventsLocal; + // release loader handle + context->ze_rtas_builder_exp_factory.release( hBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + /// @brief Intercept function for zeRTASParallelOperationCreateExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnGetSourceGraphExt = dditable->ze.ExecutableGraph.pfnGetSourceGraphExt; - if( nullptr == pfnGetSourceGraphExt ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnCreateExp = dditable->ze.RTASParallelOperationExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + result = pfnCreateExp( hDriver, phParallelOperation ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -6928,8 +6967,8 @@ namespace loader try { // convert driver handle to loader handle - *phSourceGraph = reinterpret_cast( - context->ze_graph_factory.getInstance( *phSourceGraph, dditable ) ); + *phParallelOperation = reinterpret_cast( + context->ze_rtas_parallel_operation_exp_factory.getInstance( *phParallelOperation, dditable ) ); } catch( std::bad_alloc& ) { @@ -6940,143 +6979,213 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphIsEmptyExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph + zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnIsEmptyExt = dditable->ze.Graph.pfnIsEmptyExt; - if( nullptr == pfnIsEmptyExt ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnGetPropertiesExp = dditable->ze.RTASParallelOperationExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnIsEmptyExt( hGraph ); + result = pfnGetPropertiesExp( hParallelOperation, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDumpContentsExt + /// @brief Intercept function for zeRTASParallelOperationJoinExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnDumpContentsExt = dditable->ze.Graph.pfnDumpContentsExt; - if( nullptr == pfnDumpContentsExt ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnJoinExp = dditable->ze.RTASParallelOperationExp.pfnJoinExp; + if( nullptr == pfnJoinExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnDumpContentsExt( hGraph, filePath, pNext ); + result = pfnJoinExp( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphDestroyExt + /// @brief Intercept function for zeRTASParallelOperationDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnDestroyExt = dditable->ze.ExecutableGraph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnDestroyExp = dditable->ze.RTASParallelOperationExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnDestroyExt( hGraph ); + result = pfnDestroyExp( hParallelOperation ); if( ZE_RESULT_SUCCESS != result ) return result; // release loader handle - context->ze_executable_graph_factory.release( hGraph ); + context->ze_rtas_parallel_operation_exp_factory.release( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDestroyExt + /// @brief Intercept function for zeMemGetPitchFor2dImage __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hGraph )->dditable; - auto pfnDestroyExt = dditable->ze.Graph.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnGetPitchFor2dImage = dditable->ze.Mem.pfnGetPitchFor2dImage; + if( nullptr == pfnGetPitchFor2dImage ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hGraph = reinterpret_cast( hGraph )->handle; + hContext = reinterpret_cast( hContext )->handle; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnDestroyExt( hGraph ); + result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetDeviceOffsetExp + __zedlllocal ze_result_t ZE_APICALL + zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hImage )->dditable; + auto pfnGetDeviceOffsetExp = dditable->ze.ImageExp.pfnGetDeviceOffsetExp; + if( nullptr == pfnGetDeviceOffsetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hImage = reinterpret_cast( hImage )->handle; + + // forward to device-driver + result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListCreateCloneExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnCreateCloneExp = dditable->ze.CommandListExp.pfnCreateCloneExp; + if( nullptr == pfnCreateCloneExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); if( ZE_RESULT_SUCCESS != result ) return result; - // release loader handle - context->ze_graph_factory.release( hGraph ); + try + { + // convert driver handle to loader handle + *phClonedCommandList = reinterpret_cast( + context->ze_command_list_factory.getInstance( *phClonedCommandList, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendHostFunction + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function + zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendHostFunction = dditable->ze.CommandList.pfnAppendHostFunction; - if( nullptr == pfnAppendHostFunction ) + auto dditable = reinterpret_cast( hCommandListImmediate )->dditable; + auto pfnImmediateAppendCommandListsExp = dditable->ze.CommandListExp.pfnImmediateAppendCommandListsExp; + if( nullptr == pfnImmediateAppendCommandListsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hCommandListImmediate = reinterpret_cast( hCommandListImmediate )->handle; + + // convert loader handles to driver handles + auto phCommandListsLocal = new ze_command_list_handle_t [numCommandLists]; + for( size_t i = 0; ( nullptr != phCommandLists ) && ( i < numCommandLists ); ++i ) + phCommandListsLocal[ i ] = reinterpret_cast( phCommandLists[ i ] )->handle; // convert loader handle to driver handle hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; @@ -7087,341 +7196,375 @@ namespace loader phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandListsLocal, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phCommandListsLocal; delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnReserveCacheExt = dditable->ze.Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) + auto dditable = reinterpret_cast( hCommandListImmediate )->dditable; + auto pfnImmediateAppendCommandListsWithParameters = dditable->ze.CommandList.pfnImmediateAppendCommandListsWithParameters; + if( nullptr == pfnImmediateAppendCommandListsWithParameters ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hCommandListImmediate = reinterpret_cast( hCommandListImmediate )->handle; + + // convert loader handles to driver handles + auto phCommandListsLocal = new ze_command_list_handle_t [numCommandLists]; + for( size_t i = 0; ( nullptr != phCommandLists ) && ( i < numCommandLists ); ++i ) + phCommandListsLocal[ i ] = reinterpret_cast( phCommandLists[ i ] )->handle; + + // convert loader handle to driver handle + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandListsLocal, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phCommandListsLocal; + delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListGetNextCommandIdExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnSetCacheAdviceExt = dditable->ze.Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnGetNextCommandIdExp = dditable->ze.CommandListExp.pfnGetNextCommandIdExp; + if( nullptr == pfnGetNextCommandIdExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hEvent )->dditable; - auto pfnQueryTimestampsExp = dditable->ze.EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnGetNextCommandIdWithKernelsExp = dditable->ze.CommandListExp.pfnGetNextCommandIdWithKernelsExp; + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hEvent = reinterpret_cast( hEvent )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + // convert loader handles to driver handles + auto phKernelsLocal = new ze_kernel_handle_t [numKernels]; + for( size_t i = 0; ( nullptr != phKernels ) && ( i < numKernels ); ++i ) + phKernelsLocal[ i ] = reinterpret_cast( phKernels[ i ] )->handle; // forward to device-driver - result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernelsLocal, pCommandId ); + delete []phKernelsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hImage )->dditable; - auto pfnGetMemoryPropertiesExp = dditable->ze.ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnUpdateMutableCommandsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandsExp; + if( nullptr == pfnUpdateMutableCommandsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + result = pfnUpdateMutableCommandsExp( hCommandList, desc ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListIsMutableExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnViewCreateExt = dditable->ze.Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnIsMutableExp = dditable->ze.CommandListExp.pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; + + // forward to device-driver + result = pfnIsMutableExp( hCommandList, pIsMutable ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnUpdateMutableCommandSignalEventExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandSignalEventExp; + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; // forward to device-driver - result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phImageView = reinterpret_cast( - context->ze_image_factory.getInstance( *phImageView, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnViewCreateExp = dditable->ze.ImageExp.pfnViewCreateExp; - if( nullptr == pfnViewCreateExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnUpdateMutableCommandWaitEventsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; - - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; - // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; - if( ZE_RESULT_SUCCESS != result ) - return result; + return result; + } - try - { - // convert driver handle to loader handle - ze_image_handle_t internalHandlePtr = *phImageView; - *phImageView = reinterpret_cast( - context->ze_image_factory.getInstance( *phImageView, dditable ) ); - // convert loader handle to driver handle and store in map - { - std::lock_guard lock(context->image_handle_map_lock); - context->image_handle_map.insert({context->ze_image_factory.getInstance( internalHandlePtr, dditable ), internalHandlePtr}); - } - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp + __zedlllocal ze_result_t ZE_APICALL + zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnUpdateMutableCommandKernelsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandKernelsExp; + if( nullptr == pfnUpdateMutableCommandKernelsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handles to driver handles + auto phKernelsLocal = new ze_kernel_handle_t [numKernels]; + for( size_t i = 0; ( nullptr != phKernels ) && ( i < numKernels ); ++i ) + phKernelsLocal[ i ] = reinterpret_cast( phKernels[ i ] )->handle; + + // forward to device-driver + result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernelsLocal ); + delete []phKernelsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hKernel )->dditable; - auto pfnSchedulingHintExp = dditable->ze.KernelExp.pfnSchedulingHintExp; - if( nullptr == pfnSchedulingHintExp ) + auto pfnGetBinaryExp = dditable->ze.KernelExp.pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hKernel = reinterpret_cast( hKernel )->handle; // forward to device-driver - result = pfnSchedulingHintExp( hKernel, pHint ); + result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDevicePciGetPropertiesExt + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnPciGetPropertiesExt = dditable->ze.Device.pfnPciGetPropertiesExt; - if( nullptr == pfnPciGetPropertiesExt ) + auto pfnImportExternalSemaphoreExt = dditable->ze.Device.pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); + result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phSemaphore = reinterpret_cast( + context->ze_external_semaphore_ext_factory.getInstance( *phSemaphore, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendImageCopyToMemoryExt = dditable->ze.CommandList.pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnAppendImageCopyToMemoryExt ) + auto dditable = reinterpret_cast( hSemaphore )->dditable; + auto pfnReleaseExternalSemaphoreExt = dditable->ze.Device.pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handle to driver handle - hSrcImage = reinterpret_cast( hSrcImage )->handle; - - // convert loader handle to driver handle - hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; - - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + hSemaphore = reinterpret_cast( hSemaphore )->handle; // forward to device-driver - result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phWaitEventsLocal; + result = pfnReleaseExternalSemaphoreExt( hSemaphore ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -7433,15 +7576,17 @@ namespace loader // extract driver's function pointer table auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendImageCopyFromMemoryExt = dditable->ze.CommandList.pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnAppendImageCopyFromMemoryExt ) + auto pfnAppendSignalExternalSemaphoreExt = dditable->ze.CommandList.pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hCommandList = reinterpret_cast( hCommandList )->handle; - // convert loader handle to driver handle - hDstImage = reinterpret_cast( hDstImage )->handle; + // convert loader handles to driver handles + auto phSemaphoresLocal = new ze_external_semaphore_ext_handle_t [numSemaphores]; + for( size_t i = 0; ( nullptr != phSemaphores ) && ( i < numSemaphores ); ++i ) + phSemaphoresLocal[ i ] = reinterpret_cast( phSemaphores[ i ] )->handle; // convert loader handle to driver handle hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; @@ -7452,69 +7597,84 @@ namespace loader phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphoresLocal, signalParams, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phSemaphoresLocal; delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetAllocPropertiesExt + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnGetAllocPropertiesExt = dditable->ze.Image.pfnGetAllocPropertiesExt; - if( nullptr == pfnGetAllocPropertiesExt ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendWaitExternalSemaphoreExt = dditable->ze.CommandList.pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handles to driver handles + auto phSemaphoresLocal = new ze_external_semaphore_ext_handle_t [numSemaphores]; + for( size_t i = 0; ( nullptr != phSemaphores ) && ( i < numSemaphores ); ++i ) + phSemaphoresLocal[ i ] = reinterpret_cast( phSemaphores[ i ] )->handle; // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphoresLocal, waitParams, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phSemaphoresLocal; + delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleInspectLinkageExt + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( phModules[ 0 ] )->dditable; - auto pfnInspectLinkageExt = dditable->ze.Module.pfnInspectLinkageExt; - if( nullptr == pfnInspectLinkageExt ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnCreateExt = dditable->ze.RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; - // convert loader handles to driver handles - auto phModulesLocal = new ze_module_handle_t [numModules]; - for( size_t i = 0; ( nullptr != phModules ) && ( i < numModules ); ++i ) - phModulesLocal[ i ] = reinterpret_cast( phModules[ i ] )->handle; + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnInspectLinkageExt( pInspectDesc, numModules, phModulesLocal, phLog ); - delete []phModulesLocal; + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -7522,8 +7682,8 @@ namespace loader try { // convert driver handle to loader handle - *phLog = reinterpret_cast( - context->ze_module_build_log_factory.getInstance( *phLog, dditable ) ); + *phBuilder = reinterpret_cast( + context->ze_rtas_builder_ext_factory.getInstance( *phBuilder, dditable ) ); } catch( std::bad_alloc& ) { @@ -7534,212 +7694,190 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFreeExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnFreeExt = dditable->ze.Mem.pfnFreeExt; - if( nullptr == pfnFreeExt ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnGetBuildPropertiesExt = dditable->ze.RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hBuilder = reinterpret_cast( hBuilder )->handle; // forward to device-driver - result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetExp + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnGetExp = dditable->ze.FabricVertexExp.pfnGetExp; - if( nullptr == pfnGetExp ) + auto pfnRTASFormatCompatibilityCheckExt = dditable->ze.Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnGetExp( hDriver, pCount, phVertices ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phVertices ) && ( i < *pCount ); ++i ) - phVertices[ i ] = reinterpret_cast( - context->ze_fabric_vertex_factory.getInstance( phVertices[ i ], dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hVertex )->dditable; - auto pfnGetSubVerticesExp = dditable->ze.FabricVertexExp.pfnGetSubVerticesExp; - if( nullptr == pfnGetSubVerticesExp ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnBuildExt = dditable->ze.RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hVertex = reinterpret_cast( hVertex )->handle; - - // forward to device-driver - result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + hBuilder = reinterpret_cast( hBuilder )->handle; - if( ZE_RESULT_SUCCESS != result ) - return result; + // convert loader handle to driver handle + hParallelOperation = ( hParallelOperation ) ? reinterpret_cast( hParallelOperation )->handle : nullptr; - try - { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phSubvertices ) && ( i < *pCount ); ++i ) - phSubvertices[ i ] = reinterpret_cast( - context->ze_fabric_vertex_factory.getInstance( phSubvertices[ i ], dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + // forward to device-driver + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetPropertiesExp + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hVertex )->dditable; - auto pfnGetPropertiesExp = dditable->ze.FabricVertexExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnCommandListAppendCopyExt = dditable->ze.RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hVertex = reinterpret_cast( hVertex )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnGetPropertiesExp( hVertex, pVertexProperties ); + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetDeviceExp + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hVertex )->dditable; - auto pfnGetDeviceExp = dditable->ze.FabricVertexExp.pfnGetDeviceExp; - if( nullptr == pfnGetDeviceExp ) + auto dditable = reinterpret_cast( hBuilder )->dditable; + auto pfnDestroyExt = dditable->ze.RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hVertex = reinterpret_cast( hVertex )->handle; + hBuilder = reinterpret_cast( hBuilder )->handle; // forward to device-driver - result = pfnGetDeviceExp( hVertex, phDevice ); + result = pfnDestroyExt( hBuilder ); 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; - } + // release loader handle + context->ze_rtas_builder_ext_factory.release( hBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetFabricVertexExp + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnGetFabricVertexExp = dditable->ze.DeviceExp.pfnGetFabricVertexExp; - if( nullptr == pfnGetFabricVertexExp ) + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnCreateExt = dditable->ze.RTASParallelOperation.pfnCreateExt; + if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hDriver = reinterpret_cast( hDriver )->handle; // forward to device-driver - result = pfnGetFabricVertexExp( hDevice, phVertex ); + result = pfnCreateExt( hDriver, phParallelOperation ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -7747,8 +7885,8 @@ namespace loader try { // convert driver handle to loader handle - *phVertex = reinterpret_cast( - context->ze_fabric_vertex_factory.getInstance( *phVertex, dditable ) ); + *phParallelOperation = reinterpret_cast( + context->ze_rtas_parallel_operation_ext_factory.getInstance( *phParallelOperation, dditable ) ); } catch( std::bad_alloc& ) { @@ -7759,542 +7897,479 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetExp + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hVertexA )->dditable; - auto pfnGetExp = dditable->ze.FabricEdgeExp.pfnGetExp; - if( nullptr == pfnGetExp ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnGetPropertiesExt = dditable->ze.RTASParallelOperation.pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hVertexA = reinterpret_cast( hVertexA )->handle; - - // convert loader handle to driver handle - hVertexB = reinterpret_cast( hVertexB )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phEdges ) && ( i < *pCount ); ++i ) - phEdges[ i ] = reinterpret_cast( - context->ze_fabric_edge_factory.getInstance( phEdges[ i ], dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetVerticesExp + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hEdge )->dditable; - auto pfnGetVerticesExp = dditable->ze.FabricEdgeExp.pfnGetVerticesExp; - if( nullptr == pfnGetVerticesExp ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnJoinExt = dditable->ze.RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hEdge = reinterpret_cast( hEdge )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phVertexA = reinterpret_cast( - context->ze_fabric_vertex_factory.getInstance( *phVertexA, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } - - try - { - // convert driver handle to loader handle - *phVertexB = reinterpret_cast( - context->ze_fabric_vertex_factory.getInstance( *phVertexB, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnJoinExt( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hEdge )->dditable; - auto pfnGetPropertiesExp = dditable->ze.FabricEdgeExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) + auto dditable = reinterpret_cast( hParallelOperation )->dditable; + auto pfnDestroyExt = dditable->ze.RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hEdge = reinterpret_cast( hEdge )->handle; + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; // forward to device-driver - result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); + result = pfnDestroyExt( hParallelOperation ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_rtas_parallel_operation_ext_factory.release( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestampsExt + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hEvent )->dditable; - auto pfnQueryKernelTimestampsExt = dditable->ze.Event.pfnQueryKernelTimestampsExt; - if( nullptr == pfnQueryKernelTimestampsExt ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetVectorWidthPropertiesExt = dditable->ze.Device.pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; - // convert loader handle to driver handle - hEvent = reinterpret_cast( hEvent )->handle; - // convert loader handle to driver handle hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnCreateExp = dditable->ze.RTASBuilderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) + auto dditable = reinterpret_cast( hKernel )->dditable; + auto pfnGetAllocationPropertiesExp = dditable->ze.KernelExp.pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hKernel = reinterpret_cast( hKernel )->handle; // forward to device-driver - result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phBuilder = reinterpret_cast( - context->ze_rtas_builder_exp_factory.getInstance( *phBuilder, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnGetBuildPropertiesExp = dditable->ze.RTASBuilderExp.pfnGetBuildPropertiesExp; - if( nullptr == pfnGetBuildPropertiesExp ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnGetIpcHandleWithProperties = dditable->ze.Mem.pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; + hContext = reinterpret_cast( hContext )->handle; // forward to device-driver - result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnRTASFormatCompatibilityCheckExp = dditable->ze.DriverExp.pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnRTASFormatCompatibilityCheckExp ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnCreateExt = dditable->ze.Graph.pfnCreateExt; + if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hContext = reinterpret_cast( hContext )->handle; // forward to device-driver - result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + result = pfnCreateExt( hContext, pNext, phGraph ); - return result; + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExp + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnBuildExp = dditable->ze.RTASBuilderExp.pfnBuildExp; - if( nullptr == pfnBuildExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnBeginGraphCaptureExt = dditable->ze.CommandList.pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; - - // convert loader handle to driver handle - hParallelOperation = ( hParallelOperation ) ? reinterpret_cast( hParallelOperation )->handle : nullptr; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hBuilder )->dditable; - auto pfnDestroyExp = dditable->ze.RTASBuilderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnBeginCaptureIntoGraphExt = dditable->ze.CommandList.pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; - - // forward to device-driver - result = pfnDestroyExp( hBuilder ); + hCommandList = reinterpret_cast( hCommandList )->handle; - if( ZE_RESULT_SUCCESS != result ) - return result; + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; - // release loader handle - context->ze_rtas_builder_exp_factory.release( hBuilder ); + // forward to device-driver + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnCreateExp = dditable->ze.RTASParallelOperationExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnIsGraphCaptureEnabledExt = dditable->ze.CommandList.pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnCreateExp( hDriver, phParallelOperation ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phParallelOperation = reinterpret_cast( - context->ze_rtas_parallel_operation_exp_factory.getInstance( *phParallelOperation, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnIsGraphCaptureEnabledExt( hCommandList ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnGetPropertiesExp = dditable->ze.RTASParallelOperationExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnEndGraphCaptureExt = dditable->ze.CommandList.pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnGetPropertiesExp( hParallelOperation, pProperties ); + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnJoinExp = dditable->ze.RTASParallelOperationExp.pfnJoinExp; - if( nullptr == pfnJoinExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnGetGraphExt = dditable->ze.CommandList.pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; // forward to device-driver - result = pfnJoinExp( hParallelOperation ); + result = pfnGetGraphExt( hCommandList, phGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->dditable; - auto pfnDestroyExp = dditable->ze.RTASParallelOperationExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnGetPrimaryCommandListExt = dditable->ze.Graph.pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnDestroyExp( hParallelOperation ); + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); if( ZE_RESULT_SUCCESS != result ) return result; - // release loader handle - context->ze_rtas_parallel_operation_exp_factory.release( hParallelOperation ); + try + { + // convert driver handle to loader handle + *phCommandList = reinterpret_cast( + context->ze_command_list_factory.getInstance( *phCommandList, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetPitchFor2dImage + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnGetPitchFor2dImage = dditable->ze.Mem.pfnGetPitchFor2dImage; - if( nullptr == pfnGetPitchFor2dImage ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnSetDestructionCallbackExt = dditable->ze.Graph.pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; - - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetDeviceOffsetExp + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hImage )->dditable; - auto pfnGetDeviceOffsetExp = dditable->ze.ImageExp.pfnGetDeviceOffsetExp; - if( nullptr == pfnGetDeviceOffsetExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnInstantiateExt = dditable->ze.Graph.pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hImage = reinterpret_cast( hImage )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateCloneExp - __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnCreateCloneExp = dditable->ze.CommandListExp.pfnCreateCloneExp; - if( nullptr == pfnCreateCloneExp ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // forward to device-driver - result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); - - if( ZE_RESULT_SUCCESS != result ) - return result; + if( ZE_RESULT_SUCCESS != result ) + return result; try { // convert driver handle to loader handle - *phClonedCommandList = reinterpret_cast( - context->ze_command_list_factory.getInstance( *phClonedCommandList, dditable ) ); + *phExecutableGraph = reinterpret_cast( + context->ze_executable_graph_factory.getInstance( *phExecutableGraph, dditable ) ); } catch( std::bad_alloc& ) { @@ -8305,38 +8380,33 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + /// @brief Intercept function for zeCommandListAppendGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandListImmediate )->dditable; - auto pfnImmediateAppendCommandListsExp = dditable->ze.CommandListExp.pfnImmediateAppendCommandListsExp; - if( nullptr == pfnImmediateAppendCommandListsExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendGraphExt = dditable->ze.CommandList.pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandListImmediate = reinterpret_cast( hCommandListImmediate )->handle; + hCommandList = reinterpret_cast( hCommandList )->handle; - // convert loader handles to driver handles - auto phCommandListsLocal = new ze_command_list_handle_t [numCommandLists]; - for( size_t i = 0; ( nullptr != phCommandLists ) && ( i < numCommandLists ); ++i ) - phCommandListsLocal[ i ] = reinterpret_cast( phCommandLists[ i ] )->handle; + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; // convert loader handle to driver handle hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; @@ -8347,193 +8417,185 @@ namespace loader phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; // forward to device-driver - result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandListsLocal, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phCommandListsLocal; + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); delete []phWaitEventsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandListImmediate )->dditable; - auto pfnImmediateAppendCommandListsWithParameters = dditable->ze.CommandList.pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnImmediateAppendCommandListsWithParameters ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnGetSourceGraphExt = dditable->ze.ExecutableGraph.pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandListImmediate = reinterpret_cast( hCommandListImmediate )->handle; - - // convert loader handles to driver handles - auto phCommandListsLocal = new ze_command_list_handle_t [numCommandLists]; - for( size_t i = 0; ( nullptr != phCommandLists ) && ( i < numCommandLists ); ++i ) - phCommandListsLocal[ i ] = reinterpret_cast( phCommandLists[ i ] )->handle; + hGraph = reinterpret_cast( hGraph )->handle; - // convert loader handle to driver handle - hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + // forward to device-driver + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + if( ZE_RESULT_SUCCESS != result ) + return result; - // forward to device-driver - result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandListsLocal, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phCommandListsLocal; - delete []phWaitEventsLocal; + try + { + // convert driver handle to loader handle + *phSourceGraph = reinterpret_cast( + context->ze_graph_factory.getInstance( *phSourceGraph, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdExp + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnGetNextCommandIdExp = dditable->ze.CommandListExp.pfnGetNextCommandIdExp; - if( nullptr == pfnGetNextCommandIdExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnIsEmptyExt = dditable->ze.Graph.pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + result = pfnIsEmptyExt( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnGetNextCommandIdWithKernelsExp = dditable->ze.CommandListExp.pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetNextCommandIdWithKernelsExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDumpContentsExt = dditable->ze.Graph.pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handles to driver handles - auto phKernelsLocal = new ze_kernel_handle_t [numKernels]; - for( size_t i = 0; ( nullptr != phKernels ) && ( i < numKernels ); ++i ) - phKernelsLocal[ i ] = reinterpret_cast( phKernels[ i ] )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernelsLocal, pCommandId ); - delete []phKernelsLocal; + result = pfnDumpContentsExt( hGraph, filePath, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnUpdateMutableCommandsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandsExp; - if( nullptr == pfnUpdateMutableCommandsExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDestroyExt = dditable->ze.ExecutableGraph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnUpdateMutableCommandsExp( hCommandList, desc ); + result = pfnDestroyExt( hGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_executable_graph_factory.release( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsMutableExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnIsMutableExp = dditable->ze.CommandListExp.pfnIsMutableExp; - if( nullptr == pfnIsMutableExp ) + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnDestroyExt = dditable->ze.Graph.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hGraph = reinterpret_cast( hGraph )->handle; // forward to device-driver - result = pfnIsMutableExp( hCommandList, pIsMutable ); + result = pfnDestroyExt( hGraph ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_graph_factory.release( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandSignalEventExp( + zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnUpdateMutableCommandSignalEventExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnUpdateMutableCommandSignalEventExp ) + auto pfnAppendHostFunction = dditable->ze.CommandList.pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle @@ -8542,76 +8604,14 @@ namespace loader // convert loader handle to driver handle hSignalEvent = ( hSignalEvent ) ? reinterpret_cast( hSignalEvent )->handle : nullptr; + // convert loader handles to driver handles + auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; + for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) + phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; + // forward to device-driver - result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp - __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnUpdateMutableCommandWaitEventsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handles to driver handles - auto phWaitEventsLocal = new ze_event_handle_t [numWaitEvents]; - for( size_t i = 0; ( nullptr != phWaitEvents ) && ( i < numWaitEvents ); ++i ) - phWaitEventsLocal[ i ] = reinterpret_cast( phWaitEvents[ i ] )->handle; - - // forward to device-driver - result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEventsLocal ); - delete []phWaitEventsLocal; - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp - __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnUpdateMutableCommandKernelsExp = dditable->ze.CommandListExp.pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnUpdateMutableCommandKernelsExp ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handles to driver handles - auto phKernelsLocal = new ze_kernel_handle_t [numKernels]; - for( size_t i = 0; ( nullptr != phKernels ) && ( i < numKernels ); ++i ) - phKernelsLocal[ i ] = reinterpret_cast( phKernels[ i ] )->handle; - - // forward to device-driver - result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernelsLocal ); - delete []phKernelsLocal; + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; return result; } @@ -8632,31 +8632,6 @@ zeGetGlobalProcAddrTableLegacy() loader::loaderDispatch->pCore->Global->pfnInitDrivers = loader::zeInitDrivers; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief function for filling the legacy api pointers for ExecutableGraph table -__zedlllocal void ZE_APICALL -zeGetExecutableGraphProcAddrTableLegacy() -{ - // return pointers to the Loader's Functions. - loader::loaderDispatch->pCore->ExecutableGraph->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; - loader::loaderDispatch->pCore->ExecutableGraph->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief function for filling the legacy api pointers for Graph table -__zedlllocal void ZE_APICALL -zeGetGraphProcAddrTableLegacy() -{ - // return pointers to the Loader's Functions. - loader::loaderDispatch->pCore->Graph->pfnCreateExt = loader::zeGraphCreateExt; - loader::loaderDispatch->pCore->Graph->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; - loader::loaderDispatch->pCore->Graph->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; - loader::loaderDispatch->pCore->Graph->pfnInstantiateExt = loader::zeGraphInstantiateExt; - loader::loaderDispatch->pCore->Graph->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; - loader::loaderDispatch->pCore->Graph->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; - loader::loaderDispatch->pCore->Graph->pfnDestroyExt = loader::zeGraphDestroyExt; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief function for filling the legacy api pointers for RTASBuilder table __zedlllocal void ZE_APICALL @@ -9126,6 +9101,31 @@ zeGetFabricVertexExpProcAddrTableLegacy() loader::loaderDispatch->pCore->FabricVertexExp->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for ExecutableGraph table +__zedlllocal void ZE_APICALL +zeGetExecutableGraphProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->ExecutableGraph->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; + loader::loaderDispatch->pCore->ExecutableGraph->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Graph table +__zedlllocal void ZE_APICALL +zeGetGraphProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Graph->pfnCreateExt = loader::zeGraphCreateExt; + loader::loaderDispatch->pCore->Graph->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; + loader::loaderDispatch->pCore->Graph->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; + loader::loaderDispatch->pCore->Graph->pfnInstantiateExt = loader::zeGraphInstantiateExt; + loader::loaderDispatch->pCore->Graph->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; + loader::loaderDispatch->pCore->Graph->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; + loader::loaderDispatch->pCore->Graph->pfnDestroyExt = loader::zeGraphDestroyExt; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Global table @@ -9157,50 +9157,6 @@ zeGetGlobalProcAddrTableFromDriver(loader::driver_t *driver) return result; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -__zedlllocal ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver) -{ - ze_result_t result = ZE_RESULT_SUCCESS; - if(driver->initStatus != ZE_RESULT_SUCCESS) - return driver->initStatus; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( driver->handle, "zeGetExecutableGraphProcAddrTable") ); - if(!getTable) - return driver->initStatus; - result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.ExecutableGraph); - return result; -} -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table -/// with current process' addresses -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -__zedlllocal ze_result_t ZE_APICALL -zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver) -{ - ze_result_t result = ZE_RESULT_SUCCESS; - if(driver->initStatus != ZE_RESULT_SUCCESS) - return driver->initStatus; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( driver->handle, "zeGetGraphProcAddrTable") ); - if(!getTable) - return driver->initStatus; - result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.Graph); - return result; -} -/////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilder table /// with current process' addresses /// @@ -9903,7 +9859,7 @@ zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver) return result; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Global table +/// @brief Exported function for filling application's ExecutableGraph table /// with current process' addresses /// /// @returns @@ -9911,89 +9867,21 @@ zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver) /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGlobalProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) +__zedlllocal ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver) { - if( loader::context->zeDrivers.size() < 1 ) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( loader::context->version < version ) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - loader::context->ddi_init_version = version; - ze_result_t result = ZE_RESULT_SUCCESS; - - auto driverCount = loader::context->zeDrivers.size(); - auto firstDriver = &loader::context->zeDrivers[0]; - if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { - result = zeGetGlobalProcAddrTableFromDriver(firstDriver); - } - - if( ZE_RESULT_SUCCESS == result ) - { - if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) - { - // return pointers to loader's DDIs - loader::loaderDispatch->pCore->Global = new ze_global_dditable_t; - if (version >= ZE_API_VERSION_1_0) { - pDdiTable->pfnInit = loader::zeInit; - } - if (version >= ZE_API_VERSION_1_10) { - pDdiTable->pfnInitDrivers = loader::zeInitDrivers; - } - zeGetGlobalProcAddrTableLegacy(); - } - else - { - // return pointers directly to driver's DDIs - if (version >= ZE_API_VERSION_1_0) { - pDdiTable->pfnInit = firstDriver->dditable.ze.Global.pfnInit; - } - if (version >= ZE_API_VERSION_1_10) { - pDdiTable->pfnInitDrivers = firstDriver->dditable.ze.Global.pfnInitDrivers; - } - } - } - - // If the validation layer is enabled, then intercept the loader's DDIs - if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) - { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGlobalProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - result = getTable( version, pDdiTable ); - } - - // If the API tracing layer is enabled, then intercept the loader's DDIs - if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) - { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGlobalProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - ze_global_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_global_dditable_t)); - result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.Global = dditable; - if ( loader::context->tracingLayerEnabled ) { - result = getTable( version, pDdiTable ); - } - } - + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.ExecutableGraph); return result; } - /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's ExecutableGraph table +/// @brief Exported function for filling application's Graph table /// with current process' addresses /// /// @returns @@ -10001,97 +9889,21 @@ zeGetGlobalProcAddrTable( /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) +__zedlllocal ze_result_t ZE_APICALL +zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver) { - if( loader::context->zeDrivers.size() < 1 ) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( loader::context->version < version ) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - loader::context->ddi_init_version = version; - ze_result_t result = ZE_RESULT_SUCCESS; - - auto driverCount = loader::context->zeDrivers.size(); - auto firstDriver = &loader::context->zeDrivers[0]; - if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { - result = zeGetExecutableGraphProcAddrTableFromDriver(firstDriver); - } - - if( ZE_RESULT_SUCCESS == result ) - { - if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) - { - // return pointers to loader's DDIs - loader::loaderDispatch->pCore->ExecutableGraph = new ze_executable_graph_dditable_t; - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnGetSourceGraphExt = loader_driver_ddi::zeExecutableGraphGetSourceGraphExt; - } else { - pDdiTable->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnDestroyExt = loader_driver_ddi::zeExecutableGraphDestroyExt; - } else { - pDdiTable->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; - } - } - zeGetExecutableGraphProcAddrTableLegacy(); - } - else - { - // return pointers directly to driver's DDIs - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnGetSourceGraphExt = firstDriver->dditable.ze.ExecutableGraph.pfnGetSourceGraphExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.ExecutableGraph.pfnDestroyExt; - } - } - } - - // If the validation layer is enabled, then intercept the loader's DDIs - if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) - { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetExecutableGraphProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - result = getTable( version, pDdiTable ); - } - - // If the API tracing layer is enabled, then intercept the loader's DDIs - if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) - { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetExecutableGraphProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - ze_executable_graph_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_executable_graph_dditable_t)); - result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.ExecutableGraph = dditable; - if ( loader::context->tracingLayerEnabled ) { - result = getTable( version, pDdiTable ); - } - } - + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zeGetGraphProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.ze.Graph); return result; } - /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's Graph table +/// @brief Exported function for filling application's Global table /// with current process' addresses /// /// @returns @@ -10100,9 +9912,9 @@ zeGetExecutableGraphProcAddrTable( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION ZE_DLLEXPORT ze_result_t ZE_APICALL -zeGetGraphProcAddrTable( +zeGetGlobalProcAddrTable( ze_api_version_t version, ///< [in] API version requested - ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers ) { if( loader::context->zeDrivers.size() < 1 ) { @@ -10122,7 +9934,7 @@ zeGetGraphProcAddrTable( auto driverCount = loader::context->zeDrivers.size(); auto firstDriver = &loader::context->zeDrivers[0]; if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { - result = zeGetGraphProcAddrTableFromDriver(firstDriver); + result = zeGetGlobalProcAddrTableFromDriver(firstDriver); } if( ZE_RESULT_SUCCESS == result ) @@ -10130,81 +9942,23 @@ zeGetGraphProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - loader::loaderDispatch->pCore->Graph = new ze_graph_dditable_t; - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnCreateExt = loader_driver_ddi::zeGraphCreateExt; - } else { - pDdiTable->pfnCreateExt = loader::zeGraphCreateExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnGetPrimaryCommandListExt = loader_driver_ddi::zeGraphGetPrimaryCommandListExt; - } else { - pDdiTable->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnSetDestructionCallbackExt = loader_driver_ddi::zeGraphSetDestructionCallbackExt; - } else { - pDdiTable->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnInstantiateExt = loader_driver_ddi::zeGraphInstantiateExt; - } else { - pDdiTable->pfnInstantiateExt = loader::zeGraphInstantiateExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnIsEmptyExt = loader_driver_ddi::zeGraphIsEmptyExt; - } else { - pDdiTable->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnDumpContentsExt = loader_driver_ddi::zeGraphDumpContentsExt; - } else { - pDdiTable->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; - } - } - if (version >= ZE_API_VERSION_1_17) { - if (loader::context->driverDDIPathDefault) { - pDdiTable->pfnDestroyExt = loader_driver_ddi::zeGraphDestroyExt; - } else { - pDdiTable->pfnDestroyExt = loader::zeGraphDestroyExt; + loader::loaderDispatch->pCore->Global = new ze_global_dditable_t; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = loader::zeInit; } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = loader::zeInitDrivers; } - zeGetGraphProcAddrTableLegacy(); + zeGetGlobalProcAddrTableLegacy(); } else { // return pointers directly to driver's DDIs - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnCreateExt = firstDriver->dditable.ze.Graph.pfnCreateExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnGetPrimaryCommandListExt = firstDriver->dditable.ze.Graph.pfnGetPrimaryCommandListExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnSetDestructionCallbackExt = firstDriver->dditable.ze.Graph.pfnSetDestructionCallbackExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnInstantiateExt = firstDriver->dditable.ze.Graph.pfnInstantiateExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnIsEmptyExt = firstDriver->dditable.ze.Graph.pfnIsEmptyExt; - } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDumpContentsExt = firstDriver->dditable.ze.Graph.pfnDumpContentsExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = firstDriver->dditable.ze.Global.pfnInit; } - if (version >= ZE_API_VERSION_1_17) { - pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.Graph.pfnDestroyExt; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = firstDriver->dditable.ze.Global.pfnInitDrivers; } } } @@ -10212,8 +9966,8 @@ zeGetGraphProcAddrTable( // If the validation layer is enabled, then intercept the loader's DDIs if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGraphProcAddrTable") ); + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGlobalProcAddrTable") ); if(!getTable) return ZE_RESULT_ERROR_UNINITIALIZED; result = getTable( version, pDdiTable ); @@ -10222,14 +9976,14 @@ zeGetGraphProcAddrTable( // If the API tracing layer is enabled, then intercept the loader's DDIs if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) { - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGraphProcAddrTable") ); + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGlobalProcAddrTable") ); if(!getTable) return ZE_RESULT_ERROR_UNINITIALIZED; - ze_graph_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_graph_dditable_t)); + ze_global_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_global_dditable_t)); result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.Graph = dditable; + loader::context->tracing_dditable.ze.Global = dditable; if ( loader::context->tracingLayerEnabled ) { result = getTable( version, pDdiTable ); } @@ -14866,6 +14620,252 @@ zeGetFabricVertexExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's ExecutableGraph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_executable_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( loader::context->zeDrivers.size() < 1 ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( loader::context->version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + loader::context->ddi_init_version = version; + + ze_result_t result = ZE_RESULT_SUCCESS; + + auto driverCount = loader::context->zeDrivers.size(); + auto firstDriver = &loader::context->zeDrivers[0]; + if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { + result = zeGetExecutableGraphProcAddrTableFromDriver(firstDriver); + } + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + loader::loaderDispatch->pCore->ExecutableGraph = new ze_executable_graph_dditable_t; + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSourceGraphExt = loader_driver_ddi::zeExecutableGraphGetSourceGraphExt; + } else { + pDdiTable->pfnGetSourceGraphExt = loader::zeExecutableGraphGetSourceGraphExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeExecutableGraphDestroyExt; + } else { + pDdiTable->pfnDestroyExt = loader::zeExecutableGraphDestroyExt; + } + } + zeGetExecutableGraphProcAddrTableLegacy(); + } + else + { + // return pointers directly to driver's DDIs + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetSourceGraphExt = firstDriver->dditable.ze.ExecutableGraph.pfnGetSourceGraphExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.ExecutableGraph.pfnDestroyExt; + } + } + } + + // If the validation layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + // If the API tracing layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetExecutableGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_executable_graph_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_executable_graph_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.ExecutableGraph = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Graph table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetGraphProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_graph_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( loader::context->zeDrivers.size() < 1 ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( loader::context->version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + loader::context->ddi_init_version = version; + + ze_result_t result = ZE_RESULT_SUCCESS; + + auto driverCount = loader::context->zeDrivers.size(); + auto firstDriver = &loader::context->zeDrivers[0]; + if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { + result = zeGetGraphProcAddrTableFromDriver(firstDriver); + } + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Graph = new ze_graph_dditable_t; + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExt = loader_driver_ddi::zeGraphCreateExt; + } else { + pDdiTable->pfnCreateExt = loader::zeGraphCreateExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPrimaryCommandListExt = loader_driver_ddi::zeGraphGetPrimaryCommandListExt; + } else { + pDdiTable->pfnGetPrimaryCommandListExt = loader::zeGraphGetPrimaryCommandListExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetDestructionCallbackExt = loader_driver_ddi::zeGraphSetDestructionCallbackExt; + } else { + pDdiTable->pfnSetDestructionCallbackExt = loader::zeGraphSetDestructionCallbackExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnInstantiateExt = loader_driver_ddi::zeGraphInstantiateExt; + } else { + pDdiTable->pfnInstantiateExt = loader::zeGraphInstantiateExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnIsEmptyExt = loader_driver_ddi::zeGraphIsEmptyExt; + } else { + pDdiTable->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDumpContentsExt = loader_driver_ddi::zeGraphDumpContentsExt; + } else { + pDdiTable->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; + } + } + if (version >= ZE_API_VERSION_1_17) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeGraphDestroyExt; + } else { + pDdiTable->pfnDestroyExt = loader::zeGraphDestroyExt; + } + } + zeGetGraphProcAddrTableLegacy(); + } + else + { + // return pointers directly to driver's DDIs + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnCreateExt = firstDriver->dditable.ze.Graph.pfnCreateExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnGetPrimaryCommandListExt = firstDriver->dditable.ze.Graph.pfnGetPrimaryCommandListExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnSetDestructionCallbackExt = firstDriver->dditable.ze.Graph.pfnSetDestructionCallbackExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnInstantiateExt = firstDriver->dditable.ze.Graph.pfnInstantiateExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnIsEmptyExt = firstDriver->dditable.ze.Graph.pfnIsEmptyExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDumpContentsExt = firstDriver->dditable.ze.Graph.pfnDumpContentsExt; + } + if (version >= ZE_API_VERSION_1_17) { + pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.Graph.pfnDestroyExt; + } + } + } + + // If the validation layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->validationLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->validationLayer, "zeGetGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + // If the API tracing layer is enabled, then intercept the loader's DDIs + if(( ZE_RESULT_SUCCESS == result ) && ( nullptr != loader::context->tracingLayer )) + { + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader::context->tracingLayer, "zeGetGraphProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_graph_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_graph_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.Graph = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + #if defined(__cplusplus) }; diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 4b60eb69..4fa56034 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -67,6 +67,12 @@ namespace loader using ze_fabric_edge_object_t = object_t < ze_fabric_edge_handle_t >; using ze_fabric_edge_factory_t = singleton_factory_t < ze_fabric_edge_object_t, ze_fabric_edge_handle_t >; + using ze_rtas_builder_exp_object_t = object_t < ze_rtas_builder_exp_handle_t >; + using ze_rtas_builder_exp_factory_t = singleton_factory_t < ze_rtas_builder_exp_object_t, ze_rtas_builder_exp_handle_t >; + + using ze_rtas_parallel_operation_exp_object_t = object_t < ze_rtas_parallel_operation_exp_handle_t >; + using ze_rtas_parallel_operation_exp_factory_t = singleton_factory_t < ze_rtas_parallel_operation_exp_object_t, ze_rtas_parallel_operation_exp_handle_t >; + using ze_external_semaphore_ext_object_t = object_t < ze_external_semaphore_ext_handle_t >; using ze_external_semaphore_ext_factory_t = singleton_factory_t < ze_external_semaphore_ext_object_t, ze_external_semaphore_ext_handle_t >; @@ -79,12 +85,6 @@ namespace loader using ze_executable_graph_object_t = object_t < ze_executable_graph_handle_t >; using ze_executable_graph_factory_t = singleton_factory_t < ze_executable_graph_object_t, ze_executable_graph_handle_t >; - using ze_rtas_builder_exp_object_t = object_t < ze_rtas_builder_exp_handle_t >; - using ze_rtas_builder_exp_factory_t = singleton_factory_t < ze_rtas_builder_exp_object_t, ze_rtas_builder_exp_handle_t >; - - using ze_rtas_parallel_operation_exp_object_t = object_t < ze_rtas_parallel_operation_exp_handle_t >; - using ze_rtas_parallel_operation_exp_factory_t = singleton_factory_t < ze_rtas_parallel_operation_exp_object_t, ze_rtas_parallel_operation_exp_handle_t >; - __zedlllocal ze_result_t ZE_APICALL zeloaderInitDriverDDITables(loader::driver_t *driver); } @@ -1336,91 +1336,75 @@ namespace loader_driver_ddi uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel ); __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. - ); - __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ); __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ); __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ); __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ); __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ); __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ); __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ); __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ); __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyToMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -1428,335 +1412,96 @@ namespace loader_driver_ddi ///< on before launching ); __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ); - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeCommandListAppendImageCopyFromMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ); __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ); __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ); __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ); __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ); __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ); __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ); __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ); __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ); - __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list - ); - __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle - ); - __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph - ); - __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - 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 - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ); - __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy - ); - __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy - ); - __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - 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 - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation - ); - __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region - ); - __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. - ); - __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. - ); - __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view - ); - __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view - ); - __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor - ); - __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. - ); - __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - 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 - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - 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 - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties - ); - __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. - ); - __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free - ); - __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. - ); - __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. - ); - __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties - ); - __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex - ); - __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device - ); - __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ); __zedlllocal ze_result_t ZE_APICALL zeFabricEdgeGetVerticesExp( @@ -1945,7 +1690,262 @@ namespace loader_driver_ddi ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command ///< identifier to switch to ); -} + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ); + __zedlllocal ze_result_t ZE_APICALL + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + ); + __zedlllocal ze_result_t ZE_APICALL + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ); + __zedlllocal ze_result_t ZE_APICALL + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. + ); + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + 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 + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ); + __zedlllocal ze_result_t ZE_APICALL + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + ); + __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 + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); +} #if defined(__cplusplus) extern "C" { @@ -1956,14 +1956,6 @@ zeGetGlobalProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zeGetGlobalProcAddrTableFromDriver(loader::driver_t *driver); __zedlllocal void ZE_APICALL -zeGetExecutableGraphProcAddrTableLegacy(); -__zedlllocal ze_result_t ZE_APICALL -zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver); -__zedlllocal void ZE_APICALL -zeGetGraphProcAddrTableLegacy(); -__zedlllocal ze_result_t ZE_APICALL -zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver); -__zedlllocal void ZE_APICALL zeGetRTASBuilderProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zeGetRTASBuilderProcAddrTableFromDriver(loader::driver_t *driver); @@ -2079,6 +2071,14 @@ __zedlllocal void ZE_APICALL zeGetFabricVertexExpProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zeGetFabricVertexExpProcAddrTableFromDriver(loader::driver_t *driver); +__zedlllocal void ZE_APICALL +zeGetExecutableGraphProcAddrTableLegacy(); +__zedlllocal ze_result_t ZE_APICALL +zeGetExecutableGraphProcAddrTableFromDriver(loader::driver_t *driver); +__zedlllocal void ZE_APICALL +zeGetGraphProcAddrTableLegacy(); +__zedlllocal ze_result_t ZE_APICALL +zeGetGraphProcAddrTableFromDriver(loader::driver_t *driver); #if defined(__cplusplus) }; diff --git a/source/loader/ze_ldrddi_driver_ddi.cpp b/source/loader/ze_ldrddi_driver_ddi.cpp index 82c07b4b..0003734a 100644 --- a/source/loader/ze_ldrddi_driver_ddi.cpp +++ b/source/loader/ze_ldrddi_driver_ddi.cpp @@ -5622,44 +5622,48 @@ namespace loader_driver_ddi } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetBinaryExp + /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL - zeKernelGetBinaryExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. - uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hKernel )->pCore; + 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_11) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->KernelExp == nullptr) { + if (dditable->Device == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBinaryExp = dditable->KernelExp->pfnGetBinaryExp; - if( nullptr == pfnGetBinaryExp ) { + auto pfnReserveCacheExt = dditable->Device->pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + /// @brief Intercept function for zeDeviceSetCacheAdviceExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceImportExternalSemaphoreExt( - ze_device_handle_t hDevice, ///< [in] The device handle. - const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. - ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. + zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -5669,280 +5673,276 @@ namespace loader_driver_ddi 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_12) { + if (dditable->version < ZE_API_VERSION_1_2) { 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 pfnImportExternalSemaphoreExt = dditable->Device->pfnImportExternalSemaphoreExt; - if( nullptr == pfnImportExternalSemaphoreExt ) { + auto pfnSetCacheAdviceExt = dditable->Device->pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + /// @brief Intercept function for zeEventQueryTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReleaseExternalSemaphoreExt( - ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hSemaphore )->pCore; + auto dditable = reinterpret_cast( hEvent )->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_12) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->EventExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReleaseExternalSemaphoreExt = dditable->Device->pfnReleaseExternalSemaphoreExt; - if( nullptr == pfnReleaseExternalSemaphoreExt ) { + auto pfnQueryTimestampsExp = dditable->EventExp->pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + /// @brief Intercept function for zeImageGetMemoryPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendSignalExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore handles to be appended into command list. - ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external - ///< semaphore signal parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hImage )->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_12) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->ImageExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendSignalExternalSemaphoreExt = dditable->CommandList->pfnAppendSignalExternalSemaphoreExt; - if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { + auto pfnGetMemoryPropertiesExp = dditable->ImageExp->pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + /// @brief Intercept function for zeImageViewCreateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendWaitExternalSemaphoreExt( - ze_command_list_handle_t hCommandList, ///< [in] The command list handle. - uint32_t numSemaphores, ///< [in] The number of external semaphores. - ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore handles to append into command list. - ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external - ///< semaphore wait parameters. - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hContext )->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_12) { + if (dditable->version < ZE_API_VERSION_1_5) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->Image == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendWaitExternalSemaphoreExt = dditable->CommandList->pfnAppendWaitExternalSemaphoreExt; - if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { + auto pfnViewCreateExt = dditable->Image->pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt + /// @brief Intercept function for zeImageViewCreateExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + auto dditable = reinterpret_cast( hContext )->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_13) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilder == nullptr) { + if (dditable->ImageExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = dditable->RTASBuilder->pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnViewCreateExp = dditable->ImageExp->pfnViewCreateExp; + if( nullptr == pfnViewCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + /// @brief Intercept function for zeKernelSchedulingHintExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + 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_13) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilder == nullptr) { + if (dditable->KernelExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExt = dditable->RTASBuilder->pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + auto pfnSchedulingHintExp = dditable->KernelExp->pfnSchedulingHintExp; + if( nullptr == pfnSchedulingHintExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnSchedulingHintExp( hKernel, pHint ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt + /// @brief Intercept function for zeDevicePciGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A - ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + 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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Driver == nullptr) { + if (dditable->Device == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExt = dditable->Driver->pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + auto pfnPciGetPropertiesExt = dditable->Device->pfnPciGetPropertiesExt; + if( nullptr == pfnPciGetPropertiesExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExt( - ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + 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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilder == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExt = dditable->RTASBuilder->pfnBuildExt; - if( nullptr == pfnBuildExt ) { + auto pfnAppendImageCopyToMemoryExt = dditable->CommandList->pfnAppendImageCopyToMemoryExt; + if( nullptr == pfnAppendImageCopyToMemoryExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCommandListAppendCopyExt( + zeCommandListAppendImageCopyFromMemoryExt( ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing - ///< acceleration structure to - const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in - ///< host memory to copy from - size_t size, ///< [in] size in bytes to copy + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 ///< if `nullptr == phWaitEvents` @@ -5957,784 +5957,803 @@ namespace loader_driver_ddi 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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilder == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCommandListAppendCopyExt = dditable->RTASBuilder->pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + auto pfnAppendImageCopyFromMemoryExt = dditable->CommandList->pfnAppendImageCopyFromMemoryExt; + if( nullptr == pfnAppendImageCopyFromMemoryExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt + /// @brief Intercept function for zeImageGetAllocPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + auto dditable = reinterpret_cast( hContext )->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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilder == nullptr) { + if (dditable->Image == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = dditable->RTASBuilder->pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetAllocPropertiesExt = dditable->Image->pfnGetAllocPropertiesExt; + if( nullptr == pfnGetAllocPropertiesExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExt( hBuilder ); + result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExt + /// @brief Intercept function for zeModuleInspectLinkageExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExt( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + auto dditable = reinterpret_cast( phModules[ 0 ] )->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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperation == nullptr) { + if (dditable->Module == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = dditable->RTASParallelOperation->pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnInspectLinkageExt = dditable->Module->pfnInspectLinkageExt; + if( nullptr == pfnInspectLinkageExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExt( hDriver, phParallelOperation ); + result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt + /// @brief Intercept function for zeMemFreeExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + auto dditable = reinterpret_cast( hContext )->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_13) { + if (dditable->version < ZE_API_VERSION_1_3) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperation == nullptr) { + if (dditable->Mem == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExt = dditable->RTASParallelOperation->pfnGetPropertiesExt; - if( nullptr == pfnGetPropertiesExt ) { + auto pfnFreeExt = dditable->Mem->pfnFreeExt; + if( nullptr == pfnFreeExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt + /// @brief Intercept function for zeFabricVertexGetExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_13) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperation == nullptr) { + if (dditable->FabricVertexExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnJoinExt = dditable->RTASParallelOperation->pfnJoinExt; - if( nullptr == pfnJoinExt ) { + auto pfnGetExp = dditable->FabricVertexExp->pfnGetExp; + if( nullptr == pfnGetExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnJoinExt( hParallelOperation ); + result = pfnGetExp( hDriver, pCount, phVertices ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + auto dditable = reinterpret_cast( hVertex )->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_13) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperation == nullptr) { + if (dditable->FabricVertexExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = dditable->RTASParallelOperation->pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetSubVerticesExp = dditable->FabricVertexExp->pfnGetSubVerticesExp; + if( nullptr == pfnGetSubVerticesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExt( hParallelOperation ); + result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + /// @brief Intercept function for zeFabricVertexGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetVectorWidthPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of vector width properties available. - ///< if count is greater than the number of vector width properties - ///< available, then the driver shall update the value with the correct - ///< number of vector width properties available. - ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. - ///< if count is less than the number of properties available, then the - ///< driver will return only the number requested. + zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + auto dditable = reinterpret_cast( hVertex )->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_13) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->FabricVertexExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetVectorWidthPropertiesExt = dditable->Device->pfnGetVectorWidthPropertiesExt; - if( nullptr == pfnGetVectorWidthPropertiesExt ) { + auto pfnGetPropertiesExp = dditable->FabricVertexExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + result = pfnGetPropertiesExp( hVertex, pVertexProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelGetAllocationPropertiesExp + /// @brief Intercept function for zeFabricVertexGetDeviceExp __zedlllocal ze_result_t ZE_APICALL - zeKernelGetAllocationPropertiesExp( - ze_kernel_handle_t hKernel, ///< [in] Kernel handle. - uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of kernel allocation properties available. - ///< if count is greater than the number of kernel allocation properties - ///< available, then the driver shall update the value with the correct - ///< number of kernel allocation properties. - ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. - ///< if count is less than the number of kernel allocation properties - ///< available, then driver shall only retrieve that number of kernel - ///< allocation properties. + zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hKernel )->pCore; + auto dditable = reinterpret_cast( hVertex )->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_14) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->KernelExp == nullptr) { + if (dditable->FabricVertexExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocationPropertiesExp = dditable->KernelExp->pfnGetAllocationPropertiesExp; - if( nullptr == pfnGetAllocationPropertiesExp ) { + auto pfnGetDeviceExp = dditable->FabricVertexExp->pfnGetDeviceExp; + if( nullptr == pfnGetDeviceExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); + result = pfnGetDeviceExp( hVertex, phDevice ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetIpcHandleWithProperties + /// @brief Intercept function for zeDeviceGetFabricVertexExp __zedlllocal ze_result_t ZE_APICALL - zeMemGetIpcHandleWithProperties( - ze_context_handle_t hContext, ///< [in] handle of the context object - const void* ptr, ///< [in] pointer to the device memory allocation - void* pNext, ///< [in][optional] Pointer to extension-specific structure. - ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_15) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Mem == nullptr) { + if (dditable->DeviceExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetIpcHandleWithProperties = dditable->Mem->pfnGetIpcHandleWithProperties; - if( nullptr == pfnGetIpcHandleWithProperties ) { + auto pfnGetFabricVertexExp = dditable->DeviceExp->pfnGetFabricVertexExp; + if( nullptr == pfnGetFabricVertexExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); + result = pfnGetFabricVertexExp( hDevice, phVertex ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphCreateExt + /// @brief Intercept function for zeFabricEdgeGetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created + zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + auto dditable = reinterpret_cast( hVertexA )->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_17) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->FabricEdgeExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = dditable->Graph->pfnCreateExt; - if( nullptr == pfnCreateExt ) { + auto pfnGetExp = dditable->FabricEdgeExp->pfnGetExp; + if( nullptr == pfnGetExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExt( hContext, pNext, phGraph ); + result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginGraphCaptureExt + /// @brief Intercept function for zeFabricEdgeGetVerticesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hEdge )->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_17) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->FabricEdgeExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBeginGraphCaptureExt = dditable->CommandList->pfnBeginGraphCaptureExt; - if( nullptr == pfnBeginGraphCaptureExt ) { + auto pfnGetVerticesExp = dditable->FabricEdgeExp->pfnGetVerticesExp; + if( nullptr == pfnGetVerticesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnBeginGraphCaptureExt( hCommandList, pNext ); + result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListBeginCaptureIntoGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on - ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hEdge )->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_17) { + if (dditable->version < ZE_API_VERSION_1_4) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->FabricEdgeExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBeginCaptureIntoGraphExt = dditable->CommandList->pfnBeginCaptureIntoGraphExt; - if( nullptr == pfnBeginCaptureIntoGraphExt ) { + auto pfnGetPropertiesExp = dditable->FabricEdgeExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); + result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt + /// @brief Intercept function for zeEventQueryKernelTimestampsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsGraphCaptureEnabledExt( - ze_command_list_handle_t hCommandList ///< [in] handle of the command list + zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hEvent )->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_17) { + if (dditable->version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->Event == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsGraphCaptureEnabledExt = dditable->CommandList->pfnIsGraphCaptureEnabledExt; - if( nullptr == pfnIsGraphCaptureEnabledExt ) { + auto pfnQueryKernelTimestampsExt = dditable->Event->pfnQueryKernelTimestampsExt; + if( nullptr == pfnQueryKernelTimestampsExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnIsGraphCaptureEnabledExt( hCommandList ); + result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListEndGraphCaptureExt + /// @brief Intercept function for zeRTASBuilderCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListEndGraphCaptureExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle + zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->RTASBuilderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEndGraphCaptureExt = dditable->CommandList->pfnEndGraphCaptureExt; - if( nullptr == pfnEndGraphCaptureExt ) { + auto pfnCreateExp = dditable->RTASBuilderExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); + result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetGraphExt + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode - ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list + zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->RTASBuilderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetGraphExt = dditable->CommandList->pfnGetGraphExt; - if( nullptr == pfnGetGraphExt ) { + auto pfnGetBuildPropertiesExp = dditable->RTASBuilderExp->pfnGetBuildPropertiesExp; + if( nullptr == pfnGetBuildPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetGraphExt( hCommandList, phGraph ); + result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphGetPrimaryCommandListExt + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp __zedlllocal ze_result_t ZE_APICALL - zeGraphGetPrimaryCommandListExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the - ///< graph + zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->DriverExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPrimaryCommandListExt = dditable->Graph->pfnGetPrimaryCommandListExt; - if( nullptr == pfnGetPrimaryCommandListExt ) { + auto pfnRTASFormatCompatibilityCheckExp = dditable->DriverExp->pfnRTASFormatCompatibilityCheckExp; + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); + result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphSetDestructionCallbackExt + /// @brief Intercept function for zeRTASBuilderBuildExp __zedlllocal ze_result_t ZE_APICALL - zeGraphSetDestructionCallbackExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed - void* pUserData, ///< [in][optional] user data to pass to the callback - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->RTASBuilderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetDestructionCallbackExt = dditable->Graph->pfnSetDestructionCallbackExt; - if( nullptr == pfnSetDestructionCallbackExt ) { + auto pfnBuildExp = dditable->RTASBuilderExp->pfnBuildExp; + if( nullptr == pfnBuildExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); + result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphInstantiateExt + /// @brief Intercept function for zeRTASBuilderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphInstantiateExt( - ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->RTASBuilderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnInstantiateExt = dditable->Graph->pfnInstantiateExt; - if( nullptr == pfnInstantiateExt ) { + auto pfnDestroyExp = dditable->RTASBuilderExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); + result = pfnDestroyExp( hBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendGraphExt + /// @brief Intercept function for zeRTASParallelOperationCreateExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendGraphExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->RTASParallelOperationExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendGraphExt = dditable->CommandList->pfnAppendGraphExt; - if( nullptr == pfnAppendGraphExt ) { + auto pfnCreateExp = dditable->RTASParallelOperationExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnCreateExp( hDriver, phParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphGetSourceGraphExt( - ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph - ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle + zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->ExecutableGraph == nullptr) { + if (dditable->RTASParallelOperationExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSourceGraphExt = dditable->ExecutableGraph->pfnGetSourceGraphExt; - if( nullptr == pfnGetSourceGraphExt ) { + auto pfnGetPropertiesExp = dditable->RTASParallelOperationExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); + result = pfnGetPropertiesExp( hParallelOperation, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphIsEmptyExt + /// @brief Intercept function for zeRTASParallelOperationJoinExp __zedlllocal ze_result_t ZE_APICALL - zeGraphIsEmptyExt( - ze_graph_handle_t hGraph ///< [in] handle of the graph + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->RTASParallelOperationExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsEmptyExt = dditable->Graph->pfnIsEmptyExt; - if( nullptr == pfnIsEmptyExt ) { + auto pfnJoinExp = dditable->RTASParallelOperationExp->pfnJoinExp; + if( nullptr == pfnJoinExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnIsEmptyExt( hGraph ); + result = pfnJoinExp( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDumpContentsExt + /// @brief Intercept function for zeRTASParallelOperationDestroyExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDumpContentsExt( - ze_graph_handle_t hGraph, ///< [in] handle of the graph - const char* filePath, ///< [in] path where the DOT file is written - const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext) + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_17) { + if (dditable->version < ZE_API_VERSION_1_7) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->RTASParallelOperationExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDumpContentsExt = dditable->Graph->pfnDumpContentsExt; - if( nullptr == pfnDumpContentsExt ) { + auto pfnDestroyExp = dditable->RTASParallelOperationExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDumpContentsExt( hGraph, filePath, pNext ); + result = pfnDestroyExp( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeExecutableGraphDestroyExt + /// @brief Intercept function for zeMemGetPitchFor2dImage __zedlllocal ze_result_t ZE_APICALL - zeExecutableGraphDestroyExt( - ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy + zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hContext )->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_17) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->ExecutableGraph == nullptr) { + if (dditable->Mem == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = dditable->ExecutableGraph->pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetPitchFor2dImage = dditable->Mem->pfnGetPitchFor2dImage; + if( nullptr == pfnGetPitchFor2dImage ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExt( hGraph ); + result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeGraphDestroyExt + /// @brief Intercept function for zeImageGetDeviceOffsetExp __zedlllocal ze_result_t ZE_APICALL - zeGraphDestroyExt( - ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy + zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hGraph )->pCore; + auto dditable = reinterpret_cast( hImage )->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_17) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Graph == nullptr) { + if (dditable->ImageExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExt = dditable->Graph->pfnDestroyExt; - if( nullptr == pfnDestroyExt ) { + auto pfnGetDeviceOffsetExp = dditable->ImageExp->pfnGetDeviceOffsetExp; + if( nullptr == pfnGetDeviceOffsetExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExt( hGraph ); + result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendHostFunction + /// @brief Intercept function for zeCommandListCreateCloneExp __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 - ///< non-blocking - void* pUserData, ///< [in][optional] user specific data that would be passed to function; - ///< neither the runtime nor the device will dereference it - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == - ///< phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -6744,307 +6763,312 @@ namespace loader_driver_ddi 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_17) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendHostFunction = dditable->CommandList->pfnAppendHostFunction; - if( nullptr == pfnAppendHostFunction ) { + auto pfnCreateCloneExp = dditable->CommandListExp->pfnCreateCloneExp; + if( nullptr == pfnCreateCloneExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceReserveCacheExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp __zedlllocal ze_result_t ZE_APICALL - zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation + zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + auto dditable = reinterpret_cast( hCommandListImmediate )->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_2) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserveCacheExt = dditable->Device->pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + auto pfnImmediateAppendCommandListsExp = dditable->CommandListExp->pfnImmediateAppendCommandListsExp; + if( nullptr == pfnImmediateAppendCommandListsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceSetCacheAdviceExt + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters __zedlllocal ze_result_t ZE_APICALL - zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region + zeCommandListImmediateAppendCommandListsWithParameters( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + auto dditable = reinterpret_cast( hCommandListImmediate )->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_2) { + if (dditable->version < ZE_API_VERSION_1_16) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheAdviceExt = dditable->Device->pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + auto pfnImmediateAppendCommandListsWithParameters = dditable->CommandList->pfnImmediateAppendCommandListsWithParameters; + if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryTimestampsExp + /// @brief Intercept function for zeCommandListGetNextCommandIdExp __zedlllocal ze_result_t ZE_APICALL - zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. + zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hEvent )->pCore; + 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_2) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->EventExp == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryTimestampsExp = dditable->EventExp->pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) { + auto pfnGetNextCommandIdExp = dditable->CommandListExp->pfnGetNextCommandIdExp; + if( nullptr == pfnGetNextCommandIdExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetMemoryPropertiesExp + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. + zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hImage )->pCore; + 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_2) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->ImageExp == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetMemoryPropertiesExp = dditable->ImageExp->pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) { + auto pfnGetNextCommandIdWithKernelsExp = dditable->CommandListExp->pfnGetNextCommandIdWithKernelsExp; + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_5) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Image == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExt = dditable->Image->pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) { + auto pfnUpdateMutableCommandsExp = dditable->CommandListExp->pfnUpdateMutableCommandsExp; + if( nullptr == pfnUpdateMutableCommandsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + result = pfnUpdateMutableCommandsExp( hCommandList, desc ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageViewCreateExp + /// @brief Intercept function for zeCommandListIsMutableExp __zedlllocal ze_result_t ZE_APICALL - zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view + zeCommandListIsMutableExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with + ///< mutable extension ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_2) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->ImageExp == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExp = dditable->ImageExp->pfnViewCreateExp; - if( nullptr == pfnViewCreateExp ) { + auto pfnIsMutableExp = dditable->CommandListExp->pfnIsMutableExp; + if( nullptr == pfnIsMutableExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + result = pfnIsMutableExp( hCommandList, pIsMutable ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeKernelSchedulingHintExp + /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp __zedlllocal ze_result_t ZE_APICALL - zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor - ) + zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hKernel )->pCore; + 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_2) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->KernelExp == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSchedulingHintExp = dditable->KernelExp->pfnSchedulingHintExp; - if( nullptr == pfnSchedulingHintExp ) { + auto pfnUpdateMutableCommandSignalEventExp = dditable->CommandListExp->pfnUpdateMutableCommandSignalEventExp; + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnSchedulingHintExp( hKernel, pHint ); + result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDevicePciGetPropertiesExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp __zedlllocal ze_result_t ZE_APICALL - zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. + zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + 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_3) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Device == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnPciGetPropertiesExt = dditable->Device->pfnPciGetPropertiesExt; - if( nullptr == pfnPciGetPropertiesExt ) { + auto pfnUpdateMutableCommandWaitEventsExp = dditable->CommandListExp->pfnUpdateMutableCommandWaitEventsExp; + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); + result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -7054,960 +7078,942 @@ namespace loader_driver_ddi 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_3) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyToMemoryExt = dditable->CommandList->pfnAppendImageCopyToMemoryExt; - if( nullptr == pfnAppendImageCopyToMemoryExt ) { + auto pfnUpdateMutableCommandKernelsExp = dditable->CommandListExp->pfnUpdateMutableCommandKernelsExp; + if( nullptr == pfnUpdateMutableCommandKernelsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + /// @brief Intercept function for zeKernelGetBinaryExp __zedlllocal ze_result_t ZE_APICALL - zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_3) { + if (dditable->version < ZE_API_VERSION_1_11) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->KernelExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendImageCopyFromMemoryExt = dditable->CommandList->pfnAppendImageCopyFromMemoryExt; - if( nullptr == pfnAppendImageCopyFromMemoryExt ) { + auto pfnGetBinaryExp = dditable->KernelExp->pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetAllocPropertiesExt + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_3) { + if (dditable->version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Image == nullptr) { + if (dditable->Device == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetAllocPropertiesExt = dditable->Image->pfnGetAllocPropertiesExt; - if( nullptr == pfnGetAllocPropertiesExt ) { + auto pfnImportExternalSemaphoreExt = dditable->Device->pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeModuleInspectLinkageExt + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. + zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( phModules[ 0 ] )->pCore; + auto dditable = reinterpret_cast( hSemaphore )->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_3) { + if (dditable->version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Module == nullptr) { + if (dditable->Device == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnInspectLinkageExt = dditable->Module->pfnInspectLinkageExt; - if( nullptr == pfnInspectLinkageExt ) { + auto pfnReleaseExternalSemaphoreExt = dditable->Device->pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + result = pfnReleaseExternalSemaphoreExt( hSemaphore ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemFreeExt + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free + zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_3) { + if (dditable->version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Mem == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnFreeExt = dditable->Mem->pfnFreeExt; - if( nullptr == pfnFreeExt ) { + auto pfnAppendSignalExternalSemaphoreExt = dditable->CommandList->pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); + result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetExp + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. + zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + 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_4) { + if (dditable->version < ZE_API_VERSION_1_12) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricVertexExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = dditable->FabricVertexExp->pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnAppendWaitExternalSemaphoreExt = dditable->CommandList->pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetExp( hDriver, pCount, phVertices ); + result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + /// @brief Intercept function for zeRTASBuilderCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. + zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hVertex )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricVertexExp == nullptr) { + if (dditable->RTASBuilder == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetSubVerticesExp = dditable->FabricVertexExp->pfnGetSubVerticesExp; - if( nullptr == pfnGetSubVerticesExp ) { + auto pfnCreateExt = dditable->RTASBuilder->pfnCreateExt; + if( nullptr == pfnCreateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetPropertiesExp + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties + zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hVertex )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricVertexExp == nullptr) { + if (dditable->RTASBuilder == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = dditable->FabricVertexExp->pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnGetBuildPropertiesExt = dditable->RTASBuilder->pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPropertiesExp( hVertex, pVertexProperties ); + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricVertexGetDeviceExp + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExt __zedlllocal ze_result_t ZE_APICALL - zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hVertex )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricVertexExp == nullptr) { + if (dditable->Driver == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDeviceExp = dditable->FabricVertexExp->pfnGetDeviceExp; - if( nullptr == pfnGetDeviceExp ) { + auto pfnRTASFormatCompatibilityCheckExt = dditable->Driver->pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetDeviceExp( hVertex, phDevice ); + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetFabricVertexExp + /// @brief Intercept function for zeRTASBuilderBuildExt __zedlllocal ze_result_t ZE_APICALL - zeDeviceGetFabricVertexExp( - ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DeviceExp == nullptr) { + if (dditable->RTASBuilder == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetFabricVertexExp = dditable->DeviceExp->pfnGetFabricVertexExp; - if( nullptr == pfnGetFabricVertexExp ) { + auto pfnBuildExt = dditable->RTASBuilder->pfnBuildExt; + if( nullptr == pfnBuildExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetFabricVertexExp( hDevice, phVertex ); + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetExp + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. + zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hVertexA )->pCore; + 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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricEdgeExp == nullptr) { + if (dditable->RTASBuilder == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = dditable->FabricEdgeExp->pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnCommandListAppendCopyExt = dditable->RTASBuilder->pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetVerticesExp + /// @brief Intercept function for zeRTASBuilderDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hEdge )->pCore; + auto dditable = reinterpret_cast( hBuilder )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricEdgeExp == nullptr) { + if (dditable->RTASBuilder == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetVerticesExp = dditable->FabricEdgeExp->pfnGetVerticesExp; - if( nullptr == pfnGetVerticesExp ) { + auto pfnDestroyExt = dditable->RTASBuilder->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + result = pfnDestroyExt( hBuilder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationCreateExt __zedlllocal ze_result_t ZE_APICALL - zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties + zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hEdge )->pCore; + auto dditable = reinterpret_cast( hDriver )->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_4) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->FabricEdgeExp == nullptr) { + if (dditable->RTASParallelOperation == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = dditable->FabricEdgeExp->pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnCreateExt = dditable->RTASParallelOperation->pfnCreateExt; + if( nullptr == pfnCreateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); + result = pfnCreateExt( hDriver, phParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeEventQueryKernelTimestampsExt + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. + zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hEvent )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_6) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Event == nullptr) { + if (dditable->RTASParallelOperation == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryKernelTimestampsExt = dditable->Event->pfnQueryKernelTimestampsExt; - if( nullptr == pfnQueryKernelTimestampsExt ) { + auto pfnGetPropertiesExt = dditable->RTASParallelOperation->pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExp + /// @brief Intercept function for zeRTASParallelOperationJoinExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_7) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilderExp == nullptr) { + if (dditable->RTASParallelOperation == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = dditable->RTASBuilderExp->pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnJoinExt = dditable->RTASParallelOperation->pfnJoinExt; + if( nullptr == pfnJoinExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); + result = pfnJoinExt( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + /// @brief Intercept function for zeRTASParallelOperationDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + auto dditable = reinterpret_cast( hParallelOperation )->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_7) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilderExp == nullptr) { + if (dditable->RTASParallelOperation == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExp = dditable->RTASBuilderExp->pfnGetBuildPropertiesExp; - if( nullptr == pfnGetBuildPropertiesExp ) { + auto pfnDestroyExt = dditable->RTASParallelOperation->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + result = pfnDestroyExt( hParallelOperation ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt __zedlllocal ze_result_t ZE_APICALL - zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + 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_7) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DriverExp == nullptr) { + if (dditable->Device == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExp = dditable->DriverExp->pfnRTASFormatCompatibilityCheckExp; - if( nullptr == pfnRTASFormatCompatibilityCheckExp ) { + auto pfnGetVectorWidthPropertiesExt = dditable->Device->pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExp + /// @brief Intercept function for zeKernelGetAllocationPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes + zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + 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_7) { + if (dditable->version < ZE_API_VERSION_1_14) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilderExp == nullptr) { + if (dditable->KernelExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExp = dditable->RTASBuilderExp->pfnBuildExp; - if( nullptr == pfnBuildExp ) { + auto pfnGetAllocationPropertiesExp = dditable->KernelExp->pfnGetAllocationPropertiesExp; + if( nullptr == pfnGetAllocationPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + result = pfnGetAllocationPropertiesExp( hKernel, pCount, pAllocationProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExp + /// @brief Intercept function for zeMemGetIpcHandleWithProperties __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hBuilder )->pCore; + auto dditable = reinterpret_cast( hContext )->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_7) { + if (dditable->version < ZE_API_VERSION_1_15) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASBuilderExp == nullptr) { + if (dditable->Mem == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->RTASBuilderExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetIpcHandleWithProperties = dditable->Mem->pfnGetIpcHandleWithProperties; + if( nullptr == pfnGetIpcHandleWithProperties ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( hBuilder ); + result = pfnGetIpcHandleWithProperties( hContext, ptr, pNext, pIpcHandle ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationCreateExp + /// @brief Intercept function for zeGraphCreateExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object + zeGraphCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to handle of the graph object created ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pCore; + auto dditable = reinterpret_cast( hContext )->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_7) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperationExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = dditable->RTASParallelOperationExp->pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnCreateExt = dditable->Graph->pfnCreateExt; + if( nullptr == pfnCreateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExp( hDriver, phParallelOperation ); + result = pfnCreateExt( hContext, pNext, phGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + /// @brief Intercept function for zeCommandListBeginGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties + zeCommandListBeginGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + 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_7) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperationExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = dditable->RTASParallelOperationExp->pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnBeginGraphCaptureExt = dditable->CommandList->pfnBeginGraphCaptureExt; + if( nullptr == pfnBeginGraphCaptureExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPropertiesExp( hParallelOperation, pProperties ); + result = pfnBeginGraphCaptureExt( hCommandList, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExp + /// @brief Intercept function for zeCommandListBeginCaptureIntoGraphExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + zeCommandListBeginCaptureIntoGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to start capture on + ze_graph_handle_t hGraph, ///< [in] handle of the graph to capture into + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + 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_7) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperationExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnJoinExp = dditable->RTASParallelOperationExp->pfnJoinExp; - if( nullptr == pfnJoinExp ) { + auto pfnBeginCaptureIntoGraphExt = dditable->CommandList->pfnBeginCaptureIntoGraphExt; + if( nullptr == pfnBeginCaptureIntoGraphExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnJoinExp( hParallelOperation ); + result = pfnBeginCaptureIntoGraphExt( hCommandList, hGraph, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExp + /// @brief Intercept function for zeCommandListIsGraphCaptureEnabledExt __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + zeCommandListIsGraphCaptureEnabledExt( + ze_command_list_handle_t hCommandList ///< [in] handle of the command list ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hParallelOperation )->pCore; + 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_7) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->RTASParallelOperationExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->RTASParallelOperationExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnIsGraphCaptureEnabledExt = dditable->CommandList->pfnIsGraphCaptureEnabledExt; + if( nullptr == pfnIsGraphCaptureEnabledExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( hParallelOperation ); + result = pfnIsGraphCaptureEnabledExt( hCommandList ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeMemGetPitchFor2dImage + /// @brief Intercept function for zeCommandListEndGraphCaptureExt __zedlllocal ze_result_t ZE_APICALL - zeMemGetPitchFor2dImage( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - size_t imageWidth, ///< [in] imageWidth - size_t imageHeight, ///< [in] imageHeight - unsigned int elementSizeInBytes, ///< [in] Element size in bytes - size_t * rowPitch ///< [out] rowPitch + zeCommandListEndGraphCaptureExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to end capture on + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_graph_handle_t* phGraph ///< [out] pointer to the captured graph handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->Mem == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPitchFor2dImage = dditable->Mem->pfnGetPitchFor2dImage; - if( nullptr == pfnGetPitchFor2dImage ) { + auto pfnEndGraphCaptureExt = dditable->CommandList->pfnEndGraphCaptureExt; + if( nullptr == pfnEndGraphCaptureExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPitchFor2dImage( hContext, hDevice, imageWidth, imageHeight, elementSizeInBytes, rowPitch ); + result = pfnEndGraphCaptureExt( hCommandList, pNext, phGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeImageGetDeviceOffsetExp + /// @brief Intercept function for zeCommandListGetGraphExt __zedlllocal ze_result_t ZE_APICALL - zeImageGetDeviceOffsetExp( - ze_image_handle_t hImage, ///< [in] handle of the image - uint64_t* pDeviceOffset ///< [out] bindless device offset for image + zeCommandListGetGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list that is in capture mode + ze_graph_handle_t* phGraph ///< [out] pointer to the graph handle associated with the command list ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hImage )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->ImageExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDeviceOffsetExp = dditable->ImageExp->pfnGetDeviceOffsetExp; - if( nullptr == pfnGetDeviceOffsetExp ) { + auto pfnGetGraphExt = dditable->CommandList->pfnGetGraphExt; + if( nullptr == pfnGetGraphExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetDeviceOffsetExp( hImage, pDeviceOffset ); + result = pfnGetGraphExt( hCommandList, phGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListCreateCloneExp + /// @brief Intercept function for zeGraphGetPrimaryCommandListExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListCreateCloneExp( - ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) - ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list + zeGraphGetPrimaryCommandListExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + ze_command_list_handle_t* phCommandList ///< [out] pointer to the primary command list handle associated with the + ///< graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateCloneExp = dditable->CommandListExp->pfnCreateCloneExp; - if( nullptr == pfnCreateCloneExp ) { + auto pfnGetPrimaryCommandListExt = dditable->Graph->pfnGetPrimaryCommandListExt; + if( nullptr == pfnGetPrimaryCommandListExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); + result = pfnGetPrimaryCommandListExt( hGraph, phCommandList ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + /// @brief Intercept function for zeGraphSetDestructionCallbackExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsExp( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphSetDestructionCallbackExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + zex_mem_graph_free_callback_fn_t pfnCallback, ///< [in] callback function to invoke when the graph is destroyed + void* pUserData, ///< [in][optional] user data to pass to the callback + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandListImmediate )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImmediateAppendCommandListsExp = dditable->CommandListExp->pfnImmediateAppendCommandListsExp; - if( nullptr == pfnImmediateAppendCommandListsExp ) { + auto pfnSetDestructionCallbackExt = dditable->Graph->pfnSetDestructionCallbackExt; + if( nullptr == pfnSetDestructionCallbackExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnSetDestructionCallbackExt( hGraph, pfnCallback, pUserData, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListImmediateAppendCommandListsWithParameters + /// @brief Intercept function for zeGraphInstantiateExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListImmediateAppendCommandListsWithParameters( - ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list - uint32_t numCommandLists, ///< [in] number of command lists - ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists - const void* pNext, ///< [in][optional] additional extensions passed to the function - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - ///< - if not null, this event is signaled after the completion of all - ///< appended command lists - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended - ///< command lists; must be 0 if nullptr == phWaitEvents - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing appended command lists. - ///< - if not null, all wait events must be satisfied prior to the start - ///< of any appended command list(s) + zeGraphInstantiateExt( + ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_executable_graph_handle_t* phExecutableGraph ///< [out] pointer to handle of the executable graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandListImmediate )->pCore; + 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_16) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandList == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnImmediateAppendCommandListsWithParameters = dditable->CommandList->pfnImmediateAppendCommandListsWithParameters; - if( nullptr == pfnImmediateAppendCommandListsWithParameters ) { + auto pfnInstantiateExt = dditable->Graph->pfnInstantiateExt; + if( nullptr == pfnInstantiateExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnImmediateAppendCommandListsWithParameters( hCommandListImmediate, numCommandLists, phCommandLists, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); + result = pfnInstantiateExt( hGraph, pNext, phExecutableGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdExp + /// @brief Intercept function for zeCommandListAppendGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeCommandListAppendGraphExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list to execute the graph on + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + const void* pNext, ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -8017,103 +8023,97 @@ namespace loader_driver_ddi 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetNextCommandIdExp = dditable->CommandListExp->pfnGetNextCommandIdExp; - if( nullptr == pfnGetNextCommandIdExp ) { + auto pfnAppendGraphExt = dditable->CommandList->pfnAppendGraphExt; + if( nullptr == pfnAppendGraphExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + result = pfnAppendGraphExt( hCommandList, hGraph, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + /// @brief Intercept function for zeExecutableGraphGetSourceGraphExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListGetNextCommandIdWithKernelsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor - uint32_t numKernels, ///< [in][optional] number of entries on phKernels list - ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can - ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp - ///< call - uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + zeExecutableGraphGetSourceGraphExt( + ze_executable_graph_handle_t hGraph, ///< [in] handle of the executable graph + ze_graph_handle_t* phSourceGraph ///< [out] pointer to the source recorded graph handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_10) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->ExecutableGraph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetNextCommandIdWithKernelsExp = dditable->CommandListExp->pfnGetNextCommandIdWithKernelsExp; - if( nullptr == pfnGetNextCommandIdWithKernelsExp ) { + auto pfnGetSourceGraphExt = dditable->ExecutableGraph->pfnGetSourceGraphExt; + if( nullptr == pfnGetSourceGraphExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + result = pfnGetSourceGraphExt( hGraph, phSourceGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + /// @brief Intercept function for zeGraphIsEmptyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may - ///< be chained via `pNext` member + zeGraphIsEmptyExt( + ze_graph_handle_t hGraph ///< [in] handle of the graph ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandsExp = dditable->CommandListExp->pfnUpdateMutableCommandsExp; - if( nullptr == pfnUpdateMutableCommandsExp ) { + auto pfnIsEmptyExt = dditable->Graph->pfnIsEmptyExt; + if( nullptr == pfnIsEmptyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnUpdateMutableCommandsExp( hCommandList, desc ); + result = pfnIsEmptyExt( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListIsMutableExp + /// @brief Intercept function for zeGraphDumpContentsExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListIsMutableExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_bool_t* pIsMutable ///< [out] pointer bool determining whether command list was created with - ///< mutable extension + zeGraphDumpContentsExt( + ze_graph_handle_t hGraph, ///< [in] handle of the graph + const char* filePath, ///< [in] path where the DOT file is written + const void* pNext ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext) ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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 @@ -8121,93 +8121,93 @@ namespace loader_driver_ddi return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnIsMutableExp = dditable->CommandListExp->pfnIsMutableExp; - if( nullptr == pfnIsMutableExp ) { + auto pfnDumpContentsExt = dditable->Graph->pfnDumpContentsExt; + if( nullptr == pfnDumpContentsExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnIsMutableExp( hCommandList, pIsMutable ); + result = pfnDumpContentsExt( hGraph, filePath, pNext ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandSignalEventExp + /// @brief Intercept function for zeExecutableGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandSignalEventExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion + zeExecutableGraphDestroyExt( + ze_executable_graph_handle_t hGraph ///< [in][release] handle of the executable graph to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->ExecutableGraph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandSignalEventExp = dditable->CommandListExp->pfnUpdateMutableCommandSignalEventExp; - if( nullptr == pfnUpdateMutableCommandSignalEventExp ) { + auto pfnDestroyExt = dditable->ExecutableGraph->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnUpdateMutableCommandSignalEventExp( hCommandList, commandId, hSignalEvent ); + result = pfnDestroyExt( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandWaitEventsExp + /// @brief Intercept function for zeGraphDestroyExt __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandWaitEventsExp( - ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint64_t commandId, ///< [in] command identifier - uint32_t numWaitEvents, ///< [in][optional] the number of wait events - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching + zeGraphDestroyExt( + ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pCore; + 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_9) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->Graph == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandWaitEventsExp = dditable->CommandListExp->pfnUpdateMutableCommandWaitEventsExp; - if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) { + auto pfnDestroyExt = dditable->Graph->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + result = pfnDestroyExt( hGraph ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeCommandListUpdateMutableCommandKernelsExp + /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL - zeCommandListUpdateMutableCommandKernelsExp( + zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numKernels, ///< [in] the number of kernels to update - uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier - ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command - ///< identifier to switch to + ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and + ///< non-blocking + void* pUserData, ///< [in][optional] user specific data that would be passed to function; + ///< neither the runtime nor the device will dereference it + const void* pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] count of phWaitEvents; must be 0 if `nullptr == + ///< phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -8217,19 +8217,19 @@ namespace loader_driver_ddi 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_10) { + if (dditable->version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->CommandList == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnUpdateMutableCommandKernelsExp = dditable->CommandListExp->pfnUpdateMutableCommandKernelsExp; - if( nullptr == pfnUpdateMutableCommandKernelsExp ) { + auto pfnAppendHostFunction = dditable->CommandList->pfnAppendHostFunction; + if( nullptr == pfnAppendHostFunction ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + result = pfnAppendHostFunction( hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents ); return result; } @@ -8241,8 +8241,6 @@ namespace loader_driver_ddi { // Delete ddi tables delete pDdiTable->Global; - delete pDdiTable->ExecutableGraph; - delete pDdiTable->Graph; delete pDdiTable->RTASBuilder; delete pDdiTable->RTASBuilderExp; delete pDdiTable->RTASParallelOperation; @@ -8272,6 +8270,8 @@ namespace loader_driver_ddi delete pDdiTable->VirtualMem; delete pDdiTable->FabricEdgeExp; delete pDdiTable->FabricVertexExp; + delete pDdiTable->ExecutableGraph; + delete pDdiTable->Graph; delete pDdiTable; } diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 5cd216c7..99b19adf 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -4074,33 +4074,6 @@ namespace loader return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt - __zedlllocal ze_result_t ZE_APICALL - zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnPciLinkSpeedUpdateExt = dditable->zes.Device.pfnPciLinkSpeedUpdateExt; - if( nullptr == pfnPciLinkSpeedUpdateExt ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; - - // forward to device-driver - result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesPowerGetLimitsExt __zedlllocal ze_result_t ZE_APICALL @@ -4919,6 +4892,33 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnPciLinkSpeedUpdateExt = dditable->zes.Device.pfnPciLinkSpeedUpdateExt; + if( nullptr == pfnPciLinkSpeedUpdateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + + return result; + } + } // namespace loader #if defined(__cplusplus) diff --git a/source/loader/zes_ldrddi.h b/source/loader/zes_ldrddi.h index d60095c5..165a2c15 100644 --- a/source/loader/zes_ldrddi.h +++ b/source/loader/zes_ldrddi.h @@ -1059,13 +1059,6 @@ namespace loader_driver_ddi ///< in degrees Celsius. ); __zedlllocal ze_result_t ZE_APICALL - zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ); - __zedlllocal ze_result_t ZE_APICALL zesPowerGetLimitsExt( zes_pwr_handle_t hPower, ///< [in] Power domain handle instance. uint32_t* pCount, ///< [in,out] Pointer to the number of power limit descriptors. If count is @@ -1319,6 +1312,13 @@ namespace loader_driver_ddi zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. ); + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ); } #if defined(__cplusplus) diff --git a/source/loader/zes_ldrddi_driver_ddi.cpp b/source/loader/zes_ldrddi_driver_ddi.cpp index a72707a2..cb20b4f9 100644 --- a/source/loader/zes_ldrddi_driver_ddi.cpp +++ b/source/loader/zes_ldrddi_driver_ddi.cpp @@ -4316,39 +4316,6 @@ namespace loader_driver_ddi return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt - __zedlllocal ze_result_t ZE_APICALL - zesDevicePciLinkSpeedUpdateExt( - zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. - ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) - ///< or set to default speed(false) - zes_device_action_t* pendingAction ///< [out] Pending action - ) - { - 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_15) { - 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 pfnPciLinkSpeedUpdateExt = dditable->Device->pfnPciLinkSpeedUpdateExt; - if( nullptr == pfnPciLinkSpeedUpdateExt ) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - // forward to device-driver - result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesPowerGetLimitsExt __zedlllocal ze_result_t ZE_APICALL @@ -5279,6 +5246,39 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciLinkSpeedUpdateExt + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciLinkSpeedUpdateExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t shouldDowngrade, ///< [in] boolean value to decide whether to perform PCIe downgrade(true) + ///< or set to default speed(false) + zes_device_action_t* pendingAction ///< [out] Pending action + ) + { + 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_15) { + 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 pfnPciLinkSpeedUpdateExt = dditable->Device->pfnPciLinkSpeedUpdateExt; + if( nullptr == pfnPciLinkSpeedUpdateExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnPciLinkSpeedUpdateExt( hDevice, shouldDowngrade, pendingAction ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief function for removing the ddi driver tables for zes diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 18d403bf..541aa001 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -1368,242 +1368,343 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp + /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnGetConcurrentMetricGroupsExp = dditable->zet.DeviceExp.pfnGetConcurrentMetricGroupsExp; - if( nullptr == pfnGetConcurrentMetricGroupsExp ) + auto dditable = reinterpret_cast( hMetricGroup )->dditable; + auto pfnCalculateMultipleMetricValuesExp = dditable->zet.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; + if( nullptr == pfnCalculateMultipleMetricValuesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // forward to device-driver - result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerCreateExp + /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hContext )->dditable; - auto pfnCreateExp = dditable->zet.MetricTracerExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) + auto dditable = reinterpret_cast( hMetricGroup )->dditable; + auto pfnGetGlobalTimestampsExp = dditable->zet.MetricGroupExp.pfnGetGlobalTimestampsExp; + if( nullptr == pfnGetGlobalTimestampsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hContext = reinterpret_cast( hContext )->handle; + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + // forward to device-driver + result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); - // convert loader handles to driver handles - auto phMetricGroupsLocal = new zet_metric_group_handle_t [metricGroupCount ]; - for( size_t i = 0; ( nullptr != phMetricGroups ) && ( i < metricGroupCount ); ++i ) - phMetricGroupsLocal[ i ] = reinterpret_cast( phMetricGroups[ i ] )->handle; + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupGetExportDataExp + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hMetricGroup )->dditable; + auto pfnGetExportDataExp = dditable->zet.MetricGroupExp.pfnGetExportDataExp; + if( nullptr == pfnGetExportDataExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hNotificationEvent = ( hNotificationEvent ) ? reinterpret_cast( hNotificationEvent )->handle : nullptr; + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // forward to device-driver - result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroupsLocal, desc, hNotificationEvent, phMetricTracer ); - delete []phMetricGroupsLocal; + result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); - if( ZE_RESULT_SUCCESS != result ) - return result; + return result; + } - try - { - // convert driver handle to loader handle - *phMetricTracer = reinterpret_cast( - context->zet_metric_tracer_exp_factory.getInstance( *phMetricTracer, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnCalculateMetricExportDataExp = dditable->zet.MetricGroupExp.pfnCalculateMetricExportDataExp; + if( nullptr == pfnCalculateMetricExportDataExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDestroyExp + /// @brief Intercept function for zetMetricProgrammableGetExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->dditable; - auto pfnDestroyExp = dditable->zet.MetricTracerExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetExp = dditable->zet.MetricProgrammableExp.pfnGetExp; + if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricTracer = reinterpret_cast( hMetricTracer )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnDestroyExp( hMetricTracer ); + result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phMetricProgrammables ) && ( i < *pCount ); ++i ) + phMetricProgrammables[ i ] = reinterpret_cast( + context->zet_metric_programmable_exp_factory.getInstance( phMetricProgrammables[ i ], dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerEnableExp + /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->dditable; - auto pfnEnableExp = dditable->zet.MetricTracerExp.pfnEnableExp; - if( nullptr == pfnEnableExp ) + auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; + auto pfnGetPropertiesExp = dditable->zet.MetricProgrammableExp.pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricTracer = reinterpret_cast( hMetricTracer )->handle; + hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; // forward to device-driver - result = pfnEnableExp( hMetricTracer, synchronous ); + result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDisableExp + /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. + zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->dditable; - auto pfnDisableExp = dditable->zet.MetricTracerExp.pfnDisableExp; - if( nullptr == pfnDisableExp ) + auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; + auto pfnGetParamInfoExp = dditable->zet.MetricProgrammableExp.pfnGetParamInfoExp; + if( nullptr == pfnGetParamInfoExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricTracer = reinterpret_cast( hMetricTracer )->handle; + hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; // forward to device-driver - result = pfnDisableExp( hMetricTracer, synchronous ); + result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerReadDataExp + /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->dditable; - auto pfnReadDataExp = dditable->zet.MetricTracerExp.pfnReadDataExp; - if( nullptr == pfnReadDataExp ) + auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; + auto pfnGetParamValueInfoExp = dditable->zet.MetricProgrammableExp.pfnGetParamValueInfoExp; + if( nullptr == pfnGetParamValueInfoExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricTracer = reinterpret_cast( hMetricTracer )->handle; + hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; // forward to device-driver - result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderCreateExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->dditable; - auto pfnCreateExp = dditable->zet.MetricDecoderExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) + auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; + auto pfnCreateFromProgrammableExp2 = dditable->zet.MetricExp.pfnCreateFromProgrammableExp2; + if( nullptr == pfnCreateFromProgrammableExp2 ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricTracer = reinterpret_cast( hMetricTracer )->handle; + hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; // forward to device-driver - result = pfnCreateExp( hMetricTracer, phMetricDecoder ); + result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); if( ZE_RESULT_SUCCESS != result ) return result; try { - // convert driver handle to loader handle - *phMetricDecoder = reinterpret_cast( - context->zet_metric_decoder_exp_factory.getInstance( *phMetricDecoder, dditable ) ); + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) + phMetricHandles[ i ] = reinterpret_cast( + context->zet_metric_factory.getInstance( phMetricHandles[ i ], dditable ) ); } catch( std::bad_alloc& ) { @@ -1614,60 +1715,99 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderDestroyExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( phMetricDecoder )->dditable; - auto pfnDestroyExp = dditable->zet.MetricDecoderExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; + auto pfnCreateFromProgrammableExp = dditable->zet.MetricExp.pfnCreateFromProgrammableExp; + if( nullptr == pfnCreateFromProgrammableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - phMetricDecoder = reinterpret_cast( phMetricDecoder )->handle; + hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; // forward to device-driver - result = pfnDestroyExp( phMetricDecoder ); + result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) + phMetricHandles[ i ] = reinterpret_cast( + context->zet_metric_factory.getInstance( phMetricHandles[ i ], dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp + /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricDecoder )->dditable; - auto pfnGetDecodableMetricsExp = dditable->zet.MetricDecoderExp.pfnGetDecodableMetricsExp; - if( nullptr == pfnGetDecodableMetricsExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnCreateMetricGroupsFromMetricsExp = dditable->zet.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricDecoder = reinterpret_cast( hMetricDecoder )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); if( ZE_RESULT_SUCCESS != result ) return result; @@ -1675,9 +1815,9 @@ namespace loader try { // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phMetrics ) && ( i < *pCount ); ++i ) - phMetrics[ i ] = reinterpret_cast( - context->zet_metric_factory.getInstance( phMetrics[ i ], dditable ) ); + for( size_t i = 0; ( nullptr != phMetricGroup ) && ( i < *pMetricGroupCount ); ++i ) + phMetricGroup[ i ] = reinterpret_cast( + context->zet_metric_group_factory.getInstance( phMetricGroup[ i ], dditable ) ); } catch( std::bad_alloc& ) { @@ -1688,346 +1828,267 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDecodeExp + /// @brief Intercept function for zetMetricGroupCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( phMetricDecoder )->dditable; - auto pfnDecodeExp = dditable->zet.MetricTracerExp.pfnDecodeExp; - if( nullptr == pfnDecodeExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnCreateExp = dditable->zet.MetricGroupExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - phMetricDecoder = reinterpret_cast( phMetricDecoder )->handle; - - // convert loader handles to driver handles - auto phMetricsLocal = new zet_metric_handle_t [metricsCount]; - for( size_t i = 0; ( nullptr != phMetrics ) && ( i < metricsCount ); ++i ) - phMetricsLocal[ i ] = reinterpret_cast( phMetrics[ i ] )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetricsLocal, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); - delete []phMetricsLocal; + result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phMetricGroup = reinterpret_cast( + context->zet_metric_group_factory.getInstance( *phMetricGroup, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp + /// @brief Intercept function for zetMetricGroupAddMetricExp __zedlllocal ze_result_t ZE_APICALL - zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hCommandList )->dditable; - auto pfnAppendMarkerExp = dditable->zet.CommandListExp.pfnAppendMarkerExp; - if( nullptr == pfnAppendMarkerExp ) + auto dditable = reinterpret_cast( hMetricGroup )->dditable; + auto pfnAddMetricExp = dditable->zet.MetricGroupExp.pfnAddMetricExp; + if( nullptr == pfnAddMetricExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + hMetric = reinterpret_cast( hMetric )->handle; // forward to device-driver - result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp + /// @brief Intercept function for zetMetricGroupRemoveMetricExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnEnableMetricsExp = dditable->zet.DeviceExp.pfnEnableMetricsExp; - if( nullptr == pfnEnableMetricsExp ) + auto dditable = reinterpret_cast( hMetricGroup )->dditable; + auto pfnRemoveMetricExp = dditable->zet.MetricGroupExp.pfnRemoveMetricExp; + if( nullptr == pfnRemoveMetricExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; - - // forward to device-driver - result = pfnEnableMetricsExp( hDevice ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceDisableMetricsExp - __zedlllocal ze_result_t ZE_APICALL - zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnDisableMetricsExp = dditable->zet.DeviceExp.pfnDisableMetricsExp; - if( nullptr == pfnDisableMetricsExp ) - return ZE_RESULT_ERROR_UNINITIALIZED; + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hMetric = reinterpret_cast( hMetric )->handle; // forward to device-driver - result = pfnDisableMetricsExp( hDevice ); + result = pfnRemoveMetricExp( hMetricGroup, hMetric ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp + /// @brief Intercept function for zetMetricGroupCloseExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnCalculateMultipleMetricValuesExp = dditable->zet.MetricGroupExp.pfnCalculateMultipleMetricValuesExp; - if( nullptr == pfnCalculateMultipleMetricValuesExp ) + auto pfnCloseExp = dditable->zet.MetricGroupExp.pfnCloseExp; + if( nullptr == pfnCloseExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // forward to device-driver - result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnCloseExp( hMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp + /// @brief Intercept function for zetMetricGroupDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnGetGlobalTimestampsExp = dditable->zet.MetricGroupExp.pfnGetGlobalTimestampsExp; - if( nullptr == pfnGetGlobalTimestampsExp ) + auto pfnDestroyExp = dditable->zet.MetricGroupExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // forward to device-driver - result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + result = pfnDestroyExp( hMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetExportDataExp + /// @brief Intercept function for zetMetricDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnGetExportDataExp = dditable->zet.MetricGroupExp.pfnGetExportDataExp; - if( nullptr == pfnGetExportDataExp ) + auto dditable = reinterpret_cast( hMetric )->dditable; + auto pfnDestroyExp = dditable->zet.MetricExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + hMetric = reinterpret_cast( hMetric )->handle; // forward to device-driver - result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + result = pfnDestroyExp( hMetric ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp + /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetDeviceGetConcurrentMetricGroupsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDriver )->dditable; - auto pfnCalculateMetricExportDataExp = dditable->zet.MetricGroupExp.pfnCalculateMetricExportDataExp; - if( nullptr == pfnCalculateMetricExportDataExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetConcurrentMetricGroupsExp = dditable->zet.DeviceExp.pfnGetConcurrentMetricGroupsExp; + if( nullptr == pfnGetConcurrentMetricGroupsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetExp + /// @brief Intercept function for zetMetricTracerCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetExp( + zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnGetExp = dditable->zet.MetricProgrammableExp.pfnGetExp; - if( nullptr == pfnGetExp ) + auto dditable = reinterpret_cast( hContext )->dditable; + auto pfnCreateExp = dditable->zet.MetricTracerExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; + // convert loader handle to driver handle + hContext = reinterpret_cast( hContext )->handle; + // convert loader handle to driver handle hDevice = reinterpret_cast( hDevice )->handle; + // convert loader handles to driver handles + auto phMetricGroupsLocal = new zet_metric_group_handle_t [metricGroupCount ]; + for( size_t i = 0; ( nullptr != phMetricGroups ) && ( i < metricGroupCount ); ++i ) + phMetricGroupsLocal[ i ] = reinterpret_cast( phMetricGroups[ i ] )->handle; + + // convert loader handle to driver handle + hNotificationEvent = ( hNotificationEvent ) ? reinterpret_cast( hNotificationEvent )->handle : nullptr; + // forward to device-driver - result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroupsLocal, desc, hNotificationEvent, phMetricTracer ); + delete []phMetricGroupsLocal; if( ZE_RESULT_SUCCESS != result ) return result; try { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phMetricProgrammables ) && ( i < *pCount ); ++i ) - phMetricProgrammables[ i ] = reinterpret_cast( - context->zet_metric_programmable_exp_factory.getInstance( phMetricProgrammables[ i ], dditable ) ); + // convert driver handle to loader handle + *phMetricTracer = reinterpret_cast( + context->zet_metric_tracer_exp_factory.getInstance( *phMetricTracer, dditable ) ); } catch( std::bad_alloc& ) { @@ -2038,196 +2099,151 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp + /// @brief Intercept function for zetMetricTracerDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; - auto pfnGetPropertiesExp = dditable->zet.MetricProgrammableExp.pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) + auto dditable = reinterpret_cast( hMetricTracer )->dditable; + auto pfnDestroyExp = dditable->zet.MetricTracerExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; + hMetricTracer = reinterpret_cast( hMetricTracer )->handle; // forward to device-driver - result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + result = pfnDestroyExp( hMetricTracer ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp + /// @brief Intercept function for zetMetricTracerEnableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; - auto pfnGetParamInfoExp = dditable->zet.MetricProgrammableExp.pfnGetParamInfoExp; - if( nullptr == pfnGetParamInfoExp ) + auto dditable = reinterpret_cast( hMetricTracer )->dditable; + auto pfnEnableExp = dditable->zet.MetricTracerExp.pfnEnableExp; + if( nullptr == pfnEnableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; + hMetricTracer = reinterpret_cast( hMetricTracer )->handle; // forward to device-driver - result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + result = pfnEnableExp( hMetricTracer, synchronous ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp + /// @brief Intercept function for zetMetricTracerDisableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; - auto pfnGetParamValueInfoExp = dditable->zet.MetricProgrammableExp.pfnGetParamValueInfoExp; - if( nullptr == pfnGetParamValueInfoExp ) + auto dditable = reinterpret_cast( hMetricTracer )->dditable; + auto pfnDisableExp = dditable->zet.MetricTracerExp.pfnDisableExp; + if( nullptr == pfnDisableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; + hMetricTracer = reinterpret_cast( hMetricTracer )->handle; // forward to device-driver - result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + result = pfnDisableExp( hMetricTracer, synchronous ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 + /// @brief Intercept function for zetMetricTracerReadDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; - auto pfnCreateFromProgrammableExp2 = dditable->zet.MetricExp.pfnCreateFromProgrammableExp2; - if( nullptr == pfnCreateFromProgrammableExp2 ) + auto dditable = reinterpret_cast( hMetricTracer )->dditable; + auto pfnReadDataExp = dditable->zet.MetricTracerExp.pfnReadDataExp; + if( nullptr == pfnReadDataExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; + hMetricTracer = reinterpret_cast( hMetricTracer )->handle; // forward to device-driver - result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) - phMetricHandles[ i ] = reinterpret_cast( - context->zet_metric_factory.getInstance( phMetricHandles[ i ], dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp + /// @brief Intercept function for zetMetricDecoderCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->dditable; - auto pfnCreateFromProgrammableExp = dditable->zet.MetricExp.pfnCreateFromProgrammableExp; - if( nullptr == pfnCreateFromProgrammableExp ) + auto dditable = reinterpret_cast( hMetricTracer )->dditable; + auto pfnCreateExp = dditable->zet.MetricDecoderExp.pfnCreateExp; + if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricProgrammable = reinterpret_cast( hMetricProgrammable )->handle; + hMetricTracer = reinterpret_cast( hMetricTracer )->handle; // forward to device-driver - result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + result = pfnCreateExp( hMetricTracer, phMetricDecoder ); if( ZE_RESULT_SUCCESS != result ) return result; try { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phMetricHandles ) && ( i < *pMetricHandleCount ); ++i ) - phMetricHandles[ i ] = reinterpret_cast( - context->zet_metric_factory.getInstance( phMetricHandles[ i ], dditable ) ); + // convert driver handle to loader handle + *phMetricDecoder = reinterpret_cast( + context->zet_metric_decoder_exp_factory.getInstance( *phMetricDecoder, dditable ) ); } catch( std::bad_alloc& ) { @@ -2238,99 +2254,70 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp + /// @brief Intercept function for zetMetricDecoderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnCreateMetricGroupsFromMetricsExp = dditable->zet.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; - if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) + auto dditable = reinterpret_cast( phMetricDecoder )->dditable; + auto pfnDestroyExp = dditable->zet.MetricDecoderExp.pfnDestroyExp; + if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + phMetricDecoder = reinterpret_cast( phMetricDecoder )->handle; // forward to device-driver - result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handles to loader handles - for( size_t i = 0; ( nullptr != phMetricGroup ) && ( i < *pMetricGroupCount ); ++i ) - phMetricGroup[ i ] = reinterpret_cast( - context->zet_metric_group_factory.getInstance( phMetricGroup[ i ], dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } + result = pfnDestroyExp( phMetricDecoder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCreateExp + /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hDevice )->dditable; - auto pfnCreateExp = dditable->zet.MetricGroupExp.pfnCreateExp; - if( nullptr == pfnCreateExp ) + auto dditable = reinterpret_cast( hMetricDecoder )->dditable; + auto pfnGetDecodableMetricsExp = dditable->zet.MetricDecoderExp.pfnGetDecodableMetricsExp; + if( nullptr == pfnGetDecodableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; + hMetricDecoder = reinterpret_cast( hMetricDecoder )->handle; // forward to device-driver - result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); if( ZE_RESULT_SUCCESS != result ) return result; try { - // convert driver handle to loader handle - *phMetricGroup = reinterpret_cast( - context->zet_metric_group_factory.getInstance( *phMetricGroup, dditable ) ); + // convert driver handles to loader handles + for( size_t i = 0; ( nullptr != phMetrics ) && ( i < *pCount ); ++i ) + phMetrics[ i ] = reinterpret_cast( + context->zet_metric_factory.getInstance( phMetrics[ i ], dditable ) ); } catch( std::bad_alloc& ) { @@ -2341,136 +2328,149 @@ namespace loader } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupAddMetricExp + /// @brief Intercept function for zetMetricTracerDecodeExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnAddMetricExp = dditable->zet.MetricGroupExp.pfnAddMetricExp; - if( nullptr == pfnAddMetricExp ) + auto dditable = reinterpret_cast( phMetricDecoder )->dditable; + auto pfnDecodeExp = dditable->zet.MetricTracerExp.pfnDecodeExp; + if( nullptr == pfnDecodeExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + phMetricDecoder = reinterpret_cast( phMetricDecoder )->handle; - // convert loader handle to driver handle - hMetric = reinterpret_cast( hMetric )->handle; + // convert loader handles to driver handles + auto phMetricsLocal = new zet_metric_handle_t [metricsCount]; + for( size_t i = 0; ( nullptr != phMetrics ) && ( i < metricsCount ); ++i ) + phMetricsLocal[ i ] = reinterpret_cast( phMetrics[ i ] )->handle; // forward to device-driver - result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetricsLocal, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + delete []phMetricsLocal; return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupRemoveMetricExp + /// @brief Intercept function for zetCommandListAppendMarkerExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnRemoveMetricExp = dditable->zet.MetricGroupExp.pfnRemoveMetricExp; - if( nullptr == pfnRemoveMetricExp ) + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendMarkerExp = dditable->zet.CommandListExp.pfnAppendMarkerExp; + if( nullptr == pfnAppendMarkerExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; - - // convert loader handle to driver handle - hMetric = reinterpret_cast( hMetric )->handle; - - // forward to device-driver - result = pfnRemoveMetricExp( hMetricGroup, hMetric ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCloseExp - __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnCloseExp = dditable->zet.MetricGroupExp.pfnCloseExp; - if( nullptr == pfnCloseExp ) - return ZE_RESULT_ERROR_UNINITIALIZED; + hCommandList = reinterpret_cast( hCommandList )->handle; // convert loader handle to driver handle hMetricGroup = reinterpret_cast( hMetricGroup )->handle; // forward to device-driver - result = pfnCloseExp( hMetricGroup ); + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupDestroyExp + /// @brief Intercept function for zetDeviceEnableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->dditable; - auto pfnDestroyExp = dditable->zet.MetricGroupExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnEnableMetricsExp = dditable->zet.DeviceExp.pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnDestroyExp( hMetricGroup ); + result = pfnEnableMetricsExp( hDevice ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDestroyExp + /// @brief Intercept function for zetDeviceDisableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract driver's function pointer table - auto dditable = reinterpret_cast( hMetric )->dditable; - auto pfnDestroyExp = dditable->zet.MetricExp.pfnDestroyExp; - if( nullptr == pfnDestroyExp ) + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnDisableMetricsExp = dditable->zet.DeviceExp.pfnDisableMetricsExp; + if( nullptr == pfnDisableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; // convert loader handle to driver handle - hMetric = reinterpret_cast( hMetric )->handle; + hDevice = reinterpret_cast( hDevice )->handle; // forward to device-driver - result = pfnDestroyExp( hMetric ); + result = pfnDisableMetricsExp( hDevice ); return result; } diff --git a/source/loader/zet_ldrddi.h b/source/loader/zet_ldrddi.h index 9a3b05fe..2e947e12 100644 --- a/source/loader/zet_ldrddi.h +++ b/source/loader/zet_ldrddi.h @@ -55,15 +55,15 @@ namespace loader using zet_debug_session_object_t = object_t < zet_debug_session_handle_t >; using zet_debug_session_factory_t = singleton_factory_t < zet_debug_session_object_t, zet_debug_session_handle_t >; + using zet_metric_programmable_exp_object_t = object_t < zet_metric_programmable_exp_handle_t >; + using zet_metric_programmable_exp_factory_t = singleton_factory_t < zet_metric_programmable_exp_object_t, zet_metric_programmable_exp_handle_t >; + using zet_metric_tracer_exp_object_t = object_t < zet_metric_tracer_exp_handle_t >; using zet_metric_tracer_exp_factory_t = singleton_factory_t < zet_metric_tracer_exp_object_t, zet_metric_tracer_exp_handle_t >; using zet_metric_decoder_exp_object_t = object_t < zet_metric_decoder_exp_handle_t >; using zet_metric_decoder_exp_factory_t = singleton_factory_t < zet_metric_decoder_exp_object_t, zet_metric_decoder_exp_handle_t >; - using zet_metric_programmable_exp_object_t = object_t < zet_metric_programmable_exp_handle_t >; - using zet_metric_programmable_exp_factory_t = singleton_factory_t < zet_metric_programmable_exp_object_t, zet_metric_programmable_exp_handle_t >; - __zedlllocal ze_result_t ZE_APICALL zetloaderInitDriverDDITables(loader::driver_t *driver); } @@ -379,150 +379,6 @@ namespace loader_driver_ddi ze_bool_t enable ///< [in] enable the tracer if true; disable if false ); __zedlllocal ze_result_t ZE_APICALL - zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. - ); - __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries - ); - __zedlllocal ze_result_t ZE_APICALL - zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value - ); - __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. - ); - __zedlllocal ze_result_t ZE_APICALL - zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled - ); - __zedlllocal ze_result_t ZE_APICALL zetMetricGroupCalculateMultipleMetricValuesExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data @@ -742,6 +598,150 @@ namespace loader_driver_ddi zetMetricDestroyExp( zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ); + __zedlllocal ze_result_t ZE_APICALL + zetDeviceGetConcurrentMetricGroupsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries + ); + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value + ); + __zedlllocal ze_result_t ZE_APICALL + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ); + __zedlllocal ze_result_t ZE_APICALL + zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + ); } #if defined(__cplusplus) diff --git a/source/loader/zet_ldrddi_driver_ddi.cpp b/source/loader/zet_ldrddi_driver_ddi.cpp index ebc4dff3..86beabfd 100644 --- a/source/loader/zet_ldrddi_driver_ddi.cpp +++ b/source/loader/zet_ldrddi_driver_ddi.cpp @@ -1332,432 +1332,483 @@ namespace loader_driver_ddi } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp + /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceGetConcurrentMetricGroupsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent - ///< groups - uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per - ///< concurrent group. - uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. - ///< The value of this parameter could be used to determine the number of - ///< replays necessary. + zetMetricGroupCalculateMultipleMetricValuesExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pTools; + auto dditable = reinterpret_cast( hMetricGroup )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_2) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DeviceExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetConcurrentMetricGroupsExp = dditable->DeviceExp->pfnGetConcurrentMetricGroupsExp; - if( nullptr == pfnGetConcurrentMetricGroupsExp ) { + auto pfnCalculateMultipleMetricValuesExp = dditable->MetricGroupExp->pfnCalculateMultipleMetricValuesExp; + if( nullptr == pfnCalculateMultipleMetricValuesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerCreateExp + /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerCreateExp( - zet_context_handle_t hContext, ///< [in] handle of the context object - zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t metricGroupCount, ///< [in] metric group count - zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to - ///< trace - zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor - ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: - ///< If buffer is not drained when the event it flagged, there is a risk of - ///< HW event buffer being overrun - zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + zetMetricGroupGetGlobalTimestampsExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host + ///< timestamp, else will reflect the device timestamp. + uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. + ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. + uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hContext )->pTools; + auto dditable = reinterpret_cast( hMetricGroup )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_5) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = dditable->MetricTracerExp->pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnGetGlobalTimestampsExp = dditable->MetricGroupExp->pfnGetGlobalTimestampsExp; + if( nullptr == pfnGetGlobalTimestampsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDestroyExp + /// @brief Intercept function for zetMetricGroupGetExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDestroyExp( - zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + zetMetricGroupGetExportDataExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + const uint8_t* pRawData, ///< [in] buffer of raw data + size_t rawDataSize, ///< [in] size in bytes of raw data buffer + size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer + ///< if size is zero, then the driver shall update the value with the + ///< number of bytes necessary to store the exported data. + ///< if size is greater than required, then the driver shall update the + ///< value with the actual number of bytes necessary to store the exported data. + uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->pTools; + auto dditable = reinterpret_cast( hMetricGroup )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->MetricTracerExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetExportDataExp = dditable->MetricGroupExp->pfnGetExportDataExp; + if( nullptr == pfnGetExportDataExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( hMetricTracer ); + result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerEnableExp + /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerEnableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned - ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active. + zetMetricGroupCalculateMetricExportDataExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data + size_t exportDataSize, ///< [in] size in bytes of exported data buffer + const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate + zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric sets to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric sets to be calculated. + uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values + ///< calculated, for all metric sets. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric values to be calculated. + ///< if count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with the actual number of + ///< metric values to be calculated. + uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per + ///< metric set. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of + ///< calculated metrics. + ///< if count is less than the number available in the raw data buffer, + ///< then driver shall only calculate that number of metric values. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->pTools; + auto dditable = reinterpret_cast( hDriver )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_6) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEnableExp = dditable->MetricTracerExp->pfnEnableExp; - if( nullptr == pfnEnableExp ) { + auto pfnCalculateMetricExportDataExp = dditable->MetricGroupExp->pfnCalculateMetricExportDataExp; + if( nullptr == pfnCalculateMetricExportDataExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnEnableExp( hMetricTracer, synchronous ); + result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDisableExp + /// @brief Intercept function for zetMetricProgrammableGetExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDisableExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful - ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() - ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned - ///< when the tracer is active or when it is inactive but still has data. - ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and - ///< has no more data to be retrieved. + zetMetricProgrammableGetExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric programmable handles available. + ///< if count is greater than the number of metric programmable handles + ///< available, then the driver shall update the value with the correct + ///< number of metric programmable handles available. + zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. + ///< if count is less than the number of metric programmables available, + ///< then driver shall only retrieve that number of metric programmables. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->pTools; + auto dditable = reinterpret_cast( hDevice )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricProgrammableExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDisableExp = dditable->MetricTracerExp->pfnDisableExp; - if( nullptr == pfnDisableExp ) { + auto pfnGetExp = dditable->MetricProgrammableExp->pfnGetExp; + if( nullptr == pfnGetExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDisableExp( hMetricTracer, synchronous ); + result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerReadDataExp + /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerReadDataExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. - ///< The driver will only retrieve the number of reports that fit into the buffer. - ///< pRawDataSize will be updated by the driver to reflect the actual - ///< number of bytes written into the buffer. - ///< If the size returns the full size requested, the application may need - ///< to issue additional reads to - ///< retrieve any remaining reports that did not fit into the buffer. - uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format + zetMetricProgrammableGetPropertiesExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->pTools; + auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricProgrammableExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReadDataExp = dditable->MetricTracerExp->pfnReadDataExp; - if( nullptr == pfnReadDataExp ) { + auto pfnGetPropertiesExp = dditable->MetricProgrammableExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderCreateExp + /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderCreateExp( - zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer - zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object + zetMetricProgrammableGetParamInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. + ///< if value pParameterCount is greater than count of parameters + ///< available, then pParameterCount will be updated with count of + ///< parameters available. + ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. + zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. + ///< if parameterCount is less than the number of parameters available, + ///< then driver shall only retrieve that number of parameter info. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricTracer )->pTools; + auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricDecoderExp == nullptr) { + if (dditable->MetricProgrammableExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = dditable->MetricDecoderExp->pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnGetParamInfoExp = dditable->MetricProgrammableExp->pfnGetParamInfoExp; + if( nullptr == pfnGetParamInfoExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExp( hMetricTracer, phMetricDecoder ); + result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderDestroyExp + /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderDestroyExp( - zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + zetMetricProgrammableGetParamValueInfoExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable + uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. + ///< if value at pValueInfoCount is greater than count of value info + ///< available, then pValueInfoCount will be updated with count of value + ///< info available. + ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. + zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. + ///< if pValueInfoCount is less than the number of value info available, + ///< then driver shall only retrieve that number of value info. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( phMetricDecoder )->pTools; + auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricDecoderExp == nullptr) { + if (dditable->MetricProgrammableExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->MetricDecoderExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnGetParamValueInfoExp = dditable->MetricProgrammableExp->pfnGetParamValueInfoExp; + if( nullptr == pfnGetParamValueInfoExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( phMetricDecoder ); + result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 __zedlllocal ze_result_t ZE_APICALL - zetMetricDecoderGetDecodableMetricsExp( - zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object - uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder - ///< handle. If count is zero, then the driver shall - ///< update the value with the total number of decodable metrics available - ///< in the decoder. if count is greater than zero - ///< but less than the total number of decodable metrics available in the - ///< decoder, then only that number will be returned. - ///< if count is greater than the number of decodable metrics available in - ///< the decoder, then the driver shall update the - ///< value with the actual number of decodable metrics available. - zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in - ///< the hMetricDecoder handle provided. + zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricDecoder )->pTools; + auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_11) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricDecoderExp == nullptr) { + if (dditable->MetricExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetDecodableMetricsExp = dditable->MetricDecoderExp->pfnGetDecodableMetricsExp; - if( nullptr == pfnGetDecodableMetricsExp ) { + auto pfnCreateFromProgrammableExp2 = dditable->MetricExp->pfnCreateFromProgrammableExp2; + if( nullptr == pfnCreateFromProgrammableExp2 ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricTracerDecodeExp + /// @brief Intercept function for zetMetricCreateFromProgrammableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricTracerDecodeExp( - zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object - size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is - ///< greater than zero but less than total number of - ///< decodable metrics available in the raw data buffer, then driver shall - ///< update this value with actual number of raw - ///< data bytes processed. - uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer - ///< data in raw format - uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the - ///< hMetricDecoder handle was provided. See - ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater - ///< than zero but less than the number decodable - ///< metrics available in the raw data buffer, then driver shall only - ///< decode those. - zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in - ///< the decoder for which the hMetricDecoder handle was - ///< provided. Metrics handles are expected to be for decodable metrics, - ///< see ::zetMetricDecoderGetDecodableMetricsExp() - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the - ///< driver shall update the value with the total - ///< number of metric sets to be decoded. If count is greater than the - ///< number available in the raw data buffer, then the - ///< driver shall update the value with the actual number of metric sets to - ///< be decoded. There is a 1:1 relation between - ///< the number of sets and sub-devices returned in the decoded entries. - uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries - ///< counts per metric set, one value per set. - uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for - ///< all metric sets. If count is zero, then the - ///< driver shall update the value with the total number of metric entries - ///< to be decoded. If count is greater than zero - ///< but less than the total number of metric entries available in the raw - ///< data, then user provided number will be decoded. - ///< If count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with - ///< the actual number of decodable metric entries decoded. If set to null, - ///< then driver will only update the value of - ///< pSetCount. - zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing - ///< decoded metric entries + zetMetricCreateFromProgrammableExp( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. + uint32_t parameterCount, ///< [in] Count of parameters to set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( phMetricDecoder )->pTools; + auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; 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_10) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricTracerExp == nullptr) { + if (dditable->MetricExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDecodeExp = dditable->MetricTracerExp->pfnDecodeExp; - if( nullptr == pfnDecodeExp ) { + auto pfnCreateFromProgrammableExp = dditable->MetricExp->pfnCreateFromProgrammableExp; + if( nullptr == pfnCreateFromProgrammableExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp + /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetCommandListAppendMarkerExp( - zet_command_list_handle_t hCommandList, ///< [in] handle to the command list - zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. - ///< ::zet_metric_group_type_exp_flags_t could be used to check whether - ///< marker is supoported by the metric group. - uint32_t value ///< [in] marker value + zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hCommandList )->pTools; + auto dditable = reinterpret_cast( hDevice )->pTools; 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_13) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->CommandListExp == nullptr) { + if (dditable->DeviceExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAppendMarkerExp = dditable->CommandListExp->pfnAppendMarkerExp; - if( nullptr == pfnAppendMarkerExp ) { + auto pfnCreateMetricGroupsFromMetricsExp = dditable->DeviceExp->pfnCreateMetricGroupsFromMetricsExp; + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp + /// @brief Intercept function for zetMetricGroupCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + zetMetricGroupCreateExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated + ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. + const char* pDescription, ///< [in] pointer to metric group description. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. + zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -1767,79 +1818,66 @@ namespace loader_driver_ddi 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_13) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DeviceExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnEnableMetricsExp = dditable->DeviceExp->pfnEnableMetricsExp; - if( nullptr == pfnEnableMetricsExp ) { + auto pfnCreateExp = dditable->MetricGroupExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnEnableMetricsExp( hDevice ); + result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceDisableMetricsExp + /// @brief Intercept function for zetMetricGroupAddMetricExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + zetMetricGroupAddMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. + size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was + ///< reported during adding the metric handle. + ///< if *pErrorStringSize is zero, then the driver shall update the value + ///< with the size of the error string in bytes. + char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. + ///< if *pErrorStringSize is less than the length of the error string + ///< available, then driver shall only retrieve that length of error string. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pTools; + auto dditable = reinterpret_cast( hMetricGroup )->pTools; 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_13) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DeviceExp == nullptr) { + if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDisableMetricsExp = dditable->DeviceExp->pfnDisableMetricsExp; - if( nullptr == pfnDisableMetricsExp ) { + auto pfnAddMetricExp = dditable->MetricGroupExp->pfnAddMetricExp; + if( nullptr == pfnAddMetricExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDisableMetricsExp( hDevice ); + result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp - __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMultipleMetricValuesExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - const uint8_t* pRawData, ///< [in][range(0, rawDataSize)] buffer of raw data to calculate - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupRemoveMetricExp + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupRemoveMetricExp( + zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group + zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -1849,32 +1887,27 @@ namespace loader_driver_ddi 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_2) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCalculateMultipleMetricValuesExp = dditable->MetricGroupExp->pfnCalculateMultipleMetricValuesExp; - if( nullptr == pfnCalculateMultipleMetricValuesExp ) { + auto pfnRemoveMetricExp = dditable->MetricGroupExp->pfnRemoveMetricExp; + if( nullptr == pfnRemoveMetricExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnRemoveMetricExp( hMetricGroup, hMetric ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp + /// @brief Intercept function for zetMetricGroupCloseExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetGlobalTimestampsExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - ze_bool_t synchronizedWithHost, ///< [in] if set to true, the globalTimestamp will reflect the host - ///< timestamp, else will reflect the device timestamp. - uint64_t* globalTimestamp, ///< [out] if synchronizedWithHost is false, timestamp is in tick counts. - ///< [out] if synchronizedWithHost is true, the timestamp is in nanoseconds. - uint64_t* metricTimestamp ///< [out] Metric timestamp in tick counts. + zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -1884,35 +1917,27 @@ namespace loader_driver_ddi 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_5) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetGlobalTimestampsExp = dditable->MetricGroupExp->pfnGetGlobalTimestampsExp; - if( nullptr == pfnGetGlobalTimestampsExp ) { + auto pfnCloseExp = dditable->MetricGroupExp->pfnCloseExp; + if( nullptr == pfnCloseExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + result = pfnCloseExp( hMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupGetExportDataExp + /// @brief Intercept function for zetMetricGroupDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupGetExportDataExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group - const uint8_t* pRawData, ///< [in] buffer of raw data - size_t rawDataSize, ///< [in] size in bytes of raw data buffer - size_t* pExportDataSize, ///< [in,out] size in bytes of export data buffer - ///< if size is zero, then the driver shall update the value with the - ///< number of bytes necessary to store the exported data. - ///< if size is greater than required, then the driver shall update the - ///< value with the actual number of bytes necessary to store the exported data. - uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -1922,89 +1947,65 @@ namespace loader_driver_ddi 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_6) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init if (dditable->MetricGroupExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExportDataExp = dditable->MetricGroupExp->pfnGetExportDataExp; - if( nullptr == pfnGetExportDataExp ) { + auto pfnDestroyExp = dditable->MetricGroupExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + result = pfnDestroyExp( hMetricGroup ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCalculateMetricExportDataExp + /// @brief Intercept function for zetMetricDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCalculateMetricExportDataExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - zet_metric_group_calculation_type_t type, ///< [in] calculation type to be applied on raw data - size_t exportDataSize, ///< [in] size in bytes of exported data buffer - const uint8_t* pExportData, ///< [in][range(0, exportDataSize)] buffer of exported data to calculate - zet_metric_calculate_exp_desc_t* pCalculateDescriptor, ///< [in] descriptor specifying calculation specific parameters - uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric sets to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric sets to be calculated. - uint32_t* pTotalMetricValueCount, ///< [in,out] pointer to number of the total number of metric values - ///< calculated, for all metric sets. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric values to be calculated. - ///< if count is greater than the number available in the raw data buffer, - ///< then the driver shall update the value with the actual number of - ///< metric values to be calculated. - uint32_t* pMetricCounts, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric counts per - ///< metric set. - zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pTotalMetricValueCount)] buffer of - ///< calculated metrics. - ///< if count is less than the number available in the raw data buffer, - ///< then driver shall only calculate that number of metric values. + zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDriver )->pTools; + auto dditable = reinterpret_cast( hMetric )->pTools; 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_6) { + if (dditable->version < ZE_API_VERSION_1_9) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->MetricExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCalculateMetricExportDataExp = dditable->MetricGroupExp->pfnCalculateMetricExportDataExp; - if( nullptr == pfnCalculateMetricExportDataExp ) { + auto pfnDestroyExp = dditable->MetricExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + result = pfnDestroyExp( hMetric ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetExp + /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetExp( + zetDeviceGetConcurrentMetricGroupsExp( zet_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of metric programmable handles. - ///< if count is zero, then the driver shall update the value with the - ///< total number of metric programmable handles available. - ///< if count is greater than the number of metric programmable handles - ///< available, then the driver shall update the value with the correct - ///< number of metric programmable handles available. - zet_metric_programmable_exp_handle_t* phMetricProgrammables ///< [in,out][optional][range(0, *pCount)] array of handle of metric programmables. - ///< if count is less than the number of metric programmables available, - ///< then driver shall only retrieve that number of metric programmables. + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup,///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -2014,252 +2015,213 @@ namespace loader_driver_ddi 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricProgrammableExp == nullptr) { + if (dditable->DeviceExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetExp = dditable->MetricProgrammableExp->pfnGetExp; - if( nullptr == pfnGetExp ) { + auto pfnGetConcurrentMetricGroupsExp = dditable->DeviceExp->pfnGetConcurrentMetricGroupsExp; + if( nullptr == pfnGetConcurrentMetricGroupsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp + /// @brief Intercept function for zetMetricTracerCreateExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetPropertiesExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable + zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; + auto dditable = reinterpret_cast( hContext )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricProgrammableExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetPropertiesExp = dditable->MetricProgrammableExp->pfnGetPropertiesExp; - if( nullptr == pfnGetPropertiesExp ) { + auto pfnCreateExp = dditable->MetricTracerExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp + /// @brief Intercept function for zetMetricTracerDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t* pParameterCount, ///< [in,out] count of the parameters to retrieve parameter info. - ///< if value pParameterCount is greater than count of parameters - ///< available, then pParameterCount will be updated with count of - ///< parameters available. - ///< The count of parameters available can be queried using ::zetMetricProgrammableGetPropertiesExp. - zet_metric_programmable_param_info_exp_t* pParameterInfo///< [in,out][range(1, *pParameterCount)] array of parameter info. - ///< if parameterCount is less than the number of parameters available, - ///< then driver shall only retrieve that number of parameter info. + zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; + auto dditable = reinterpret_cast( hMetricTracer )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricProgrammableExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetParamInfoExp = dditable->MetricProgrammableExp->pfnGetParamInfoExp; - if( nullptr == pfnGetParamInfoExp ) { + auto pfnDestroyExp = dditable->MetricTracerExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + result = pfnDestroyExp( hMetricTracer ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp + /// @brief Intercept function for zetMetricTracerEnableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricProgrammableGetParamValueInfoExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterOrdinal, ///< [in] ordinal of the parameter in the metric programmable - uint32_t* pValueInfoCount, ///< [in,out] count of parameter value information to retrieve. - ///< if value at pValueInfoCount is greater than count of value info - ///< available, then pValueInfoCount will be updated with count of value - ///< info available. - ///< The count of parameter value info available can be queried using ::zetMetricProgrammableGetParamInfoExp. - zet_metric_programmable_param_value_info_exp_t* pValueInfo ///< [in,out][range(1, *pValueInfoCount)] array of parameter value info. - ///< if pValueInfoCount is less than the number of value info available, - ///< then driver shall only retrieve that number of value info. + zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; + auto dditable = reinterpret_cast( hMetricTracer )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricProgrammableExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetParamValueInfoExp = dditable->MetricProgrammableExp->pfnGetParamValueInfoExp; - if( nullptr == pfnGetParamValueInfoExp ) { + auto pfnEnableExp = dditable->MetricTracerExp->pfnEnableExp; + if( nullptr == pfnEnableExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + result = pfnEnableExp( hMetricTracer, synchronous ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 + /// @brief Intercept function for zetMetricTracerDisableExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp2( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - uint32_t parameterCount, ///< [in] Count of parameters to set. - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; + auto dditable = reinterpret_cast( hMetricTracer )->pTools; 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_11) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateFromProgrammableExp2 = dditable->MetricExp->pfnCreateFromProgrammableExp2; - if( nullptr == pfnCreateFromProgrammableExp2 ) { + auto pfnDisableExp = dditable->MetricTracerExp->pfnDisableExp; + if( nullptr == pfnDisableExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + result = pfnDisableExp( hMetricTracer, synchronous ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricCreateFromProgrammableExp + /// @brief Intercept function for zetMetricTracerReadDataExp __zedlllocal ze_result_t ZE_APICALL - zetMetricCreateFromProgrammableExp( - zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable - zet_metric_programmable_param_value_exp_t* pParameterValues,///< [in] list of parameter values to be set. - uint32_t parameterCount, ///< [in] Count of parameters to set. - const char* pName, ///< [in] pointer to metric name to be used. Must point to a - ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. - const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_DESCRIPTION. - uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. - ///< if count is zero, then the driver shall update the value with the - ///< number of metric handles available for this programmable. - ///< if count is greater than the number of metric handles available, then - ///< the driver shall update the value with the correct number of metric - ///< handles available. - zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. - ///< if count is less than the number of metrics available, then driver - ///< shall only retrieve that number of metric handles. + zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to the size in bytes of raw data requested to read. + ///< The driver will only retrieve the number of reports that fit into the buffer. + ///< pRawDataSize will be updated by the driver to reflect the actual + ///< number of bytes written into the buffer. + ///< If the size returns the full size requested, the application may need + ///< to issue additional reads to + ///< retrieve any remaining reports that did not fit into the buffer. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricProgrammable )->pTools; + auto dditable = reinterpret_cast( hMetricTracer )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateFromProgrammableExp = dditable->MetricExp->pfnCreateFromProgrammableExp; - if( nullptr == pfnCreateFromProgrammableExp ) { + auto pfnReadDataExp = dditable->MetricTracerExp->pfnReadDataExp; + if( nullptr == pfnReadDataExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp + /// @brief Intercept function for zetMetricDecoderCreateExp __zedlllocal ze_result_t ZE_APICALL - zetDeviceCreateMetricGroupsFromMetricsExp( - zet_device_handle_t hDevice, ///< [in] handle of the device. - uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. - const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. - const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. - ///< if pMetricGroupCount is zero, then the driver shall update the value - ///< with the maximum possible number of metric group handles that could be created. - ///< if pMetricGroupCount is greater than the number of metric group - ///< handles that could be created, then the driver shall update the value - ///< with the correct number of metric group handles generated. - ///< if pMetricGroupCount is lesser than the number of metric group handles - ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. - zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of - ///< metric group handles. - ///< Created Metric group handles. + zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pTools; + auto dditable = reinterpret_cast( hMetricTracer )->pTools; if (dditable->isValidFlag == 0) return ZE_RESULT_ERROR_UNINITIALIZED; // Check that api version in the driver is supported by this version of the API @@ -2267,211 +2229,249 @@ namespace loader_driver_ddi return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->DeviceExp == nullptr) { + if (dditable->MetricDecoderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateMetricGroupsFromMetricsExp = dditable->DeviceExp->pfnCreateMetricGroupsFromMetricsExp; - if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) { + auto pfnCreateExp = dditable->MetricDecoderExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + result = pfnCreateExp( hMetricTracer, phMetricDecoder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCreateExp + /// @brief Intercept function for zetMetricDecoderDestroyExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCreateExp( - zet_device_handle_t hDevice, ///< [in] handle of the device - const char* pName, ///< [in] pointer to metric group name. Must point to a null-terminated - ///< character array no longer than ::ZET_MAX_METRIC_GROUP_NAME. - const char* pDescription, ///< [in] pointer to metric group description. Must point to a - ///< null-terminated character array no longer than - ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. - zet_metric_group_sampling_type_flags_t samplingType,///< [in] Sampling type for the metric group. - zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle + zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hDevice )->pTools; + auto dditable = reinterpret_cast( phMetricDecoder )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->MetricDecoderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExp = dditable->MetricGroupExp->pfnCreateExp; - if( nullptr == pfnCreateExp ) { + auto pfnDestroyExp = dditable->MetricDecoderExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + result = pfnDestroyExp( phMetricDecoder ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupAddMetricExp + /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupAddMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric, ///< [in] Metric to be added to the group. - size_t * pErrorStringSize, ///< [in,out][optional] Size of the error string to query, if an error was - ///< reported during adding the metric handle. - ///< if *pErrorStringSize is zero, then the driver shall update the value - ///< with the size of the error string in bytes. - char* pErrorString ///< [in,out][optional][range(0, *pErrorStringSize)] Error string. - ///< if *pErrorStringSize is less than the length of the error string - ///< available, then driver shall only retrieve that length of error string. + zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->pTools; + auto dditable = reinterpret_cast( hMetricDecoder )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->MetricDecoderExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnAddMetricExp = dditable->MetricGroupExp->pfnAddMetricExp; - if( nullptr == pfnAddMetricExp ) { + auto pfnGetDecodableMetricsExp = dditable->MetricDecoderExp->pfnGetDecodableMetricsExp; + if( nullptr == pfnGetDecodableMetricsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupRemoveMetricExp + /// @brief Intercept function for zetMetricTracerDecodeExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupRemoveMetricExp( - zet_metric_group_handle_t hMetricGroup, ///< [in] Handle of the metric group - zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. + zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder,///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->pTools; + auto dditable = reinterpret_cast( phMetricDecoder )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->MetricTracerExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRemoveMetricExp = dditable->MetricGroupExp->pfnRemoveMetricExp; - if( nullptr == pfnRemoveMetricExp ) { + auto pfnDecodeExp = dditable->MetricTracerExp->pfnDecodeExp; + if( nullptr == pfnDecodeExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnRemoveMetricExp( hMetricGroup, hMetric ); + result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupCloseExp + /// @brief Intercept function for zetCommandListAppendMarkerExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupCloseExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->pTools; + auto dditable = reinterpret_cast( hCommandList )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->CommandListExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCloseExp = dditable->MetricGroupExp->pfnCloseExp; - if( nullptr == pfnCloseExp ) { + auto pfnAppendMarkerExp = dditable->CommandListExp->pfnAppendMarkerExp; + if( nullptr == pfnAppendMarkerExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnCloseExp( hMetricGroup ); + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricGroupDestroyExp + /// @brief Intercept function for zetDeviceEnableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricGroupDestroyExp( - zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetricGroup )->pTools; + auto dditable = reinterpret_cast( hDevice )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricGroupExp == nullptr) { + if (dditable->DeviceExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->MetricGroupExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnEnableMetricsExp = dditable->DeviceExp->pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( hMetricGroup ); + result = pfnEnableMetricsExp( hDevice ); return result; } /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetMetricDestroyExp + /// @brief Intercept function for zetDeviceDisableMetricsExp __zedlllocal ze_result_t ZE_APICALL - zetMetricDestroyExp( - zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { ze_result_t result = ZE_RESULT_SUCCESS; // extract handle's function pointer table - auto dditable = reinterpret_cast( hMetric )->pTools; + auto dditable = reinterpret_cast( hDevice )->pTools; 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_9) { + if (dditable->version < ZE_API_VERSION_1_13) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } // Check that the driver has the function pointer table init - if (dditable->MetricExp == nullptr) { + if (dditable->DeviceExp == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnDestroyExp = dditable->MetricExp->pfnDestroyExp; - if( nullptr == pfnDestroyExp ) { + auto pfnDisableMetricsExp = dditable->DeviceExp->pfnDisableMetricsExp; + if( nullptr == pfnDisableMetricsExp ) { return ZE_RESULT_ERROR_UNINITIALIZED; } // forward to device-driver - result = pfnDestroyExp( hMetric ); + result = pfnDisableMetricsExp( hDevice ); return result; } diff --git a/source/utils/ze_to_string.h b/source/utils/ze_to_string.h index 9795c6a3..766db61b 100644 --- a/source/utils/ze_to_string.h +++ b/source/utils/ze_to_string.h @@ -104,27 +104,27 @@ inline std::string to_string(ze_fabric_edge_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_external_semaphore_ext_handle_t handle) { +inline std::string to_string(ze_rtas_builder_exp_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_rtas_builder_ext_handle_t handle) { +inline std::string to_string(ze_rtas_parallel_operation_exp_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_rtas_parallel_operation_ext_handle_t handle) { +inline std::string to_string(ze_external_semaphore_ext_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_executable_graph_handle_t handle) { +inline std::string to_string(ze_rtas_builder_ext_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_rtas_builder_exp_handle_t handle) { +inline std::string to_string(ze_rtas_parallel_operation_ext_handle_t handle) { return to_string(reinterpret_cast(handle)); } -inline std::string to_string(ze_rtas_parallel_operation_exp_handle_t handle) { +inline std::string to_string(ze_executable_graph_handle_t handle) { return to_string(reinterpret_cast(handle)); } @@ -133,15 +133,15 @@ inline std::string to_string(ze_rtas_parallel_operation_exp_handle_t handle) { // type (e.g. void(*)(void*)). Since typedefs are aliases rather than distinct // types in C++, emit only one to_string overload per unique signature // (returntype + parameter types) to avoid redefinition errors. -inline std::string to_string(ze_rtas_geometry_aabbs_cb_ext_t ptr) { +inline std::string to_string(ze_rtas_geometry_aabbs_cb_exp_t ptr) { return to_string(reinterpret_cast(ptr)); } -inline std::string to_string(zex_mem_graph_free_callback_fn_t ptr) { +inline std::string to_string(ze_rtas_geometry_aabbs_cb_ext_t ptr) { return to_string(reinterpret_cast(ptr)); } -inline std::string to_string(ze_rtas_geometry_aabbs_cb_exp_t ptr) { +inline std::string to_string(zex_mem_graph_free_callback_fn_t ptr) { return to_string(reinterpret_cast(ptr)); } @@ -1361,1073 +1361,1155 @@ inline std::string to_string(const ze_relaxed_allocation_limits_exp_desc_t& desc return to_string(&desc); } -inline std::string to_string(const ze_driver_ddi_handles_ext_properties_t* desc) { +inline std::string to_string(const ze_cache_reservation_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", maxCacheReservationSize=" << to_string(desc->maxCacheReservationSize); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_driver_ddi_handles_ext_properties_t& desc) { +inline std::string to_string(const ze_cache_reservation_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_semaphore_ext_desc_t* desc) { +inline std::string to_string(const ze_image_memory_properties_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", size=" << to_string(desc->size); + oss << ", rowPitch=" << to_string(desc->rowPitch); + oss << ", slicePitch=" << to_string(desc->slicePitch); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_semaphore_ext_desc_t& desc) { +inline std::string to_string(const ze_image_memory_properties_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_semaphore_win32_ext_desc_t* desc) { +inline std::string to_string(const ze_image_view_planar_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", handle=" << to_string(desc->handle); - oss << ", name=" << to_string(desc->name); + oss << ", planeIndex=" << to_string(desc->planeIndex); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_semaphore_win32_ext_desc_t& desc) { +inline std::string to_string(const ze_image_view_planar_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_semaphore_fd_ext_desc_t* desc) { +inline std::string to_string(const ze_image_view_planar_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", fd=" << to_string(desc->fd); + oss << ", planeIndex=" << to_string(desc->planeIndex); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_semaphore_fd_ext_desc_t& desc) { +inline std::string to_string(const ze_image_view_planar_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_semaphore_signal_params_ext_t* desc) { +inline std::string to_string(const ze_scheduling_hint_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", value=" << to_string(desc->value); + oss << ", schedulingHintFlags=" << to_string(desc->schedulingHintFlags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_semaphore_signal_params_ext_t& desc) { +inline std::string to_string(const ze_scheduling_hint_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_semaphore_wait_params_ext_t* desc) { +inline std::string to_string(const ze_scheduling_hint_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", value=" << to_string(desc->value); + oss << ", flags=" << to_string(desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_semaphore_wait_params_ext_t& desc) { +inline std::string to_string(const ze_scheduling_hint_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_cache_line_size_ext_t* 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 << ", cacheLineSize=" << to_string(desc->cacheLineSize); + oss << ", hint=" << to_string(desc->hint); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_cache_line_size_ext_t& desc) { +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_rtas_builder_ext_desc_t* desc) { +inline std::string to_string(const ze_eu_count_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", builderVersion=" << to_string(&desc->builderVersion); + oss << ", numTotalEUs=" << to_string(desc->numTotalEUs); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_ext_desc_t& desc) { +inline std::string to_string(const ze_eu_count_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_ext_properties_t* desc) { +inline std::string to_string(const ze_pci_address_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << ", rtasBufferSizeBytesExpected=" << to_string(desc->rtasBufferSizeBytesExpected); - oss << ", rtasBufferSizeBytesMaxRequired=" << to_string(desc->rtasBufferSizeBytesMaxRequired); - oss << ", scratchBufferSizeBytes=" << to_string(desc->scratchBufferSizeBytes); + oss << "domain=" << to_string(desc->domain); + oss << ", bus=" << to_string(desc->bus); + oss << ", device=" << to_string(desc->device); + oss << ", function=" << to_string(desc->function); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_ext_properties_t& desc) { +inline std::string to_string(const ze_pci_address_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_parallel_operation_ext_properties_t* desc) { +inline std::string to_string(const ze_pci_speed_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << ", maxConcurrency=" << to_string(desc->maxConcurrency); + oss << "genVersion=" << to_string(desc->genVersion); + oss << ", width=" << to_string(desc->width); + oss << ", maxBandwidth=" << to_string(desc->maxBandwidth); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_parallel_operation_ext_properties_t& desc) { +inline std::string to_string(const ze_pci_speed_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_device_ext_properties_t* desc) { +inline std::string to_string(const ze_pci_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << ", rtasFormat=" << to_string(&desc->rtasFormat); - oss << ", rtasBufferAlignment=" << to_string(desc->rtasBufferAlignment); + oss << ", address=" << to_string(&desc->address); + oss << ", maxSpeed=" << to_string(&desc->maxSpeed); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_device_ext_properties_t& desc) { +inline std::string to_string(const ze_pci_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_float3_ext_t* desc) { +inline std::string to_string(const ze_srgb_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "x=" << to_string(desc->x); - oss << ", y=" << to_string(desc->y); - oss << ", z=" << to_string(desc->z); + oss << "stype=" << to_string(&desc->stype); + oss << ", sRGB=" << to_string(&desc->sRGB); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_float3_ext_t& desc) { +inline std::string to_string(const ze_srgb_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_column_major_ext_t* desc) { +inline std::string to_string(const ze_image_allocation_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "vx_x=" << to_string(desc->vx_x); - oss << ", vx_y=" << to_string(desc->vx_y); - oss << ", vx_z=" << to_string(desc->vx_z); - oss << ", vy_x=" << to_string(desc->vy_x); - oss << ", vy_y=" << to_string(desc->vy_y); - oss << ", vy_z=" << to_string(desc->vy_z); - oss << ", vz_x=" << to_string(desc->vz_x); - oss << ", vz_y=" << to_string(desc->vz_y); - oss << ", vz_z=" << to_string(desc->vz_z); - oss << ", p_x=" << to_string(desc->p_x); - oss << ", p_y=" << to_string(desc->p_y); - oss << ", p_z=" << to_string(desc->p_z); + oss << "stype=" << to_string(&desc->stype); + oss << ", id=" << to_string(desc->id); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_column_major_ext_t& desc) { +inline std::string to_string(const ze_image_allocation_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_ext_t* desc) { +inline std::string to_string(const ze_linkage_inspection_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "vx_x=" << to_string(desc->vx_x); - oss << ", vx_y=" << to_string(desc->vx_y); - oss << ", vx_z=" << to_string(desc->vx_z); - oss << ", pad0=" << to_string(desc->pad0); - oss << ", vy_x=" << to_string(desc->vy_x); - oss << ", vy_y=" << to_string(desc->vy_y); - oss << ", vy_z=" << to_string(desc->vy_z); - oss << ", pad1=" << to_string(desc->pad1); - oss << ", vz_x=" << to_string(desc->vz_x); - oss << ", vz_y=" << to_string(desc->vz_y); - oss << ", vz_z=" << to_string(desc->vz_z); - oss << ", pad2=" << to_string(desc->pad2); - oss << ", p_x=" << to_string(desc->p_x); - oss << ", p_y=" << to_string(desc->p_y); - oss << ", p_z=" << to_string(desc->p_z); - oss << ", pad3=" << to_string(desc->pad3); + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_ext_t& desc) { +inline std::string to_string(const ze_linkage_inspection_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_row_major_ext_t* desc) { +inline std::string to_string(const ze_memory_compression_hints_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "vx_x=" << to_string(desc->vx_x); - oss << ", vy_x=" << to_string(desc->vy_x); - oss << ", vz_x=" << to_string(desc->vz_x); - oss << ", p_x=" << to_string(desc->p_x); - oss << ", vx_y=" << to_string(desc->vx_y); - oss << ", vy_y=" << to_string(desc->vy_y); - oss << ", vz_y=" << to_string(desc->vz_y); - oss << ", p_y=" << to_string(desc->p_y); - oss << ", vx_z=" << to_string(desc->vx_z); - oss << ", vy_z=" << to_string(desc->vy_z); - oss << ", vz_z=" << to_string(desc->vz_z); - oss << ", p_z=" << to_string(desc->p_z); + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_row_major_ext_t& desc) { +inline std::string to_string(const ze_memory_compression_hints_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_aabb_ext_t* desc) { +inline std::string to_string(const ze_driver_memory_free_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "lower=" << to_string(&desc->lower); - oss << ", upper=" << to_string(&desc->upper); + oss << "stype=" << to_string(&desc->stype); + oss << ", freePolicies=" << to_string(&desc->freePolicies); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_aabb_ext_t& desc) { +inline std::string to_string(const ze_driver_memory_free_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_triangle_indices_uint32_ext_t* desc) { +inline std::string to_string(const ze_memory_free_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "v0=" << to_string(desc->v0); - oss << ", v1=" << to_string(desc->v1); - oss << ", v2=" << to_string(desc->v2); + oss << "stype=" << to_string(&desc->stype); + oss << ", freePolicy=" << to_string(&desc->freePolicy); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_triangle_indices_uint32_ext_t& desc) { +inline std::string to_string(const ze_memory_free_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_quad_indices_uint32_ext_t* desc) { +inline std::string to_string(const ze_device_p2p_bandwidth_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "v0=" << to_string(desc->v0); - oss << ", v1=" << to_string(desc->v1); - oss << ", v2=" << to_string(desc->v2); - oss << ", v3=" << to_string(desc->v3); + oss << "stype=" << to_string(&desc->stype); + oss << ", logicalBandwidth=" << to_string(desc->logicalBandwidth); + oss << ", physicalBandwidth=" << to_string(desc->physicalBandwidth); + oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); + oss << ", logicalLatency=" << to_string(desc->logicalLatency); + oss << ", physicalLatency=" << to_string(desc->physicalLatency); + oss << ", latencyUnit=" << to_string(&desc->latencyUnit); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_quad_indices_uint32_ext_t& desc) { +inline std::string to_string(const ze_device_p2p_bandwidth_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_geometry_info_ext_t* desc) { +inline std::string to_string(const ze_copy_bandwidth_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "geometryType=" << to_string(&desc->geometryType); + oss << "stype=" << to_string(&desc->stype); + oss << ", copyBandwidth=" << to_string(desc->copyBandwidth); + oss << ", copyBandwidthUnit=" << to_string(&desc->copyBandwidthUnit); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_geometry_info_ext_t& desc) { +inline std::string to_string(const ze_copy_bandwidth_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_ext_t* desc) { +inline std::string to_string(const ze_device_luid_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "geometryType=" << to_string(&desc->geometryType); - oss << ", geometryFlags=" << to_string(&desc->geometryFlags); - oss << ", geometryMask=" << to_string(desc->geometryMask); - oss << ", triangleFormat=" << to_string(&desc->triangleFormat); - oss << ", vertexFormat=" << to_string(&desc->vertexFormat); - oss << ", triangleCount=" << to_string(desc->triangleCount); - oss << ", vertexCount=" << to_string(desc->vertexCount); - oss << ", triangleStride=" << to_string(desc->triangleStride); - oss << ", vertexStride=" << to_string(desc->vertexStride); - oss << ", pTriangleBuffer=" << to_string(desc->pTriangleBuffer); - oss << ", pVertexBuffer=" << to_string(desc->pVertexBuffer); + oss << "id=" << to_string(desc->id); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_ext_t& desc) { +inline std::string to_string(const ze_device_luid_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_quads_geometry_info_ext_t* desc) { +inline std::string to_string(const ze_device_luid_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "geometryType=" << to_string(&desc->geometryType); - oss << ", geometryFlags=" << to_string(&desc->geometryFlags); - oss << ", geometryMask=" << to_string(desc->geometryMask); - oss << ", quadFormat=" << to_string(&desc->quadFormat); - oss << ", vertexFormat=" << to_string(&desc->vertexFormat); - oss << ", quadCount=" << to_string(desc->quadCount); - oss << ", vertexCount=" << to_string(desc->vertexCount); - oss << ", quadStride=" << to_string(desc->quadStride); - oss << ", vertexStride=" << to_string(desc->vertexStride); - oss << ", pQuadBuffer=" << to_string(desc->pQuadBuffer); - oss << ", pVertexBuffer=" << to_string(desc->pVertexBuffer); + oss << "stype=" << to_string(&desc->stype); + oss << ", luid=" << to_string(&desc->luid); + oss << ", nodeMask=" << to_string(desc->nodeMask); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_quads_geometry_info_ext_t& desc) { +inline std::string to_string(const ze_device_luid_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_geometry_aabbs_ext_cb_params_t* desc) { +inline std::string to_string(const ze_fabric_vertex_pci_exp_address_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", primID=" << to_string(desc->primID); - oss << ", primIDCount=" << to_string(desc->primIDCount); - oss << ", pGeomUserPtr=" << to_string(desc->pGeomUserPtr); - oss << ", pBuildUserPtr=" << to_string(desc->pBuildUserPtr); - oss << ", pBoundsOut=" << to_string(desc->pBoundsOut); + oss << "domain=" << to_string(desc->domain); + oss << ", bus=" << to_string(desc->bus); + oss << ", device=" << to_string(desc->device); + oss << ", function=" << to_string(desc->function); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_geometry_aabbs_ext_cb_params_t& desc) { +inline std::string to_string(const ze_fabric_vertex_pci_exp_address_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_ext_t* desc) { +inline std::string to_string(const ze_fabric_vertex_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "geometryType=" << to_string(&desc->geometryType); - oss << ", geometryFlags=" << to_string(&desc->geometryFlags); - oss << ", geometryMask=" << to_string(desc->geometryMask); - oss << ", reserved=" << to_string(desc->reserved); - oss << ", primCount=" << to_string(desc->primCount); - oss << ", pfnGetBoundsCb=" << to_string(&desc->pfnGetBoundsCb); - oss << ", pGeomUserPtr=" << to_string(desc->pGeomUserPtr); + oss << "stype=" << to_string(&desc->stype); + oss << ", uuid=" << to_string(&desc->uuid); + oss << ", type=" << to_string(&desc->type); + oss << ", remote=" << to_string(&desc->remote); + oss << ", address=" << to_string(&desc->address); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_ext_t& desc) { +inline std::string to_string(const ze_fabric_vertex_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_instance_geometry_info_ext_t* desc) { +inline std::string to_string(const ze_fabric_edge_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "geometryType=" << to_string(&desc->geometryType); - oss << ", instanceFlags=" << to_string(&desc->instanceFlags); - oss << ", geometryMask=" << to_string(desc->geometryMask); - oss << ", transformFormat=" << to_string(&desc->transformFormat); - oss << ", instanceUserID=" << to_string(desc->instanceUserID); - oss << ", pTransform=" << to_string(desc->pTransform); - oss << ", pBounds=" << to_string(desc->pBounds); - oss << ", pAccelerationStructure=" << to_string(desc->pAccelerationStructure); + oss << "stype=" << to_string(&desc->stype); + oss << ", uuid=" << to_string(&desc->uuid); + oss << ", model=" << to_string(desc->model); + oss << ", bandwidth=" << to_string(desc->bandwidth); + oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); + oss << ", latency=" << to_string(desc->latency); + oss << ", latencyUnit=" << to_string(&desc->latencyUnit); + oss << ", duplexity=" << to_string(&desc->duplexity); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_instance_geometry_info_ext_t& desc) { +inline std::string to_string(const ze_fabric_edge_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_build_op_ext_desc_t* desc) { +inline std::string to_string(const ze_device_memory_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", rtasFormat=" << to_string(&desc->rtasFormat); - oss << ", buildQuality=" << to_string(desc->buildQuality); - oss << ", buildFlags=" << to_string(&desc->buildFlags); - oss << ", ppGeometries=" << to_string(desc->ppGeometries); - oss << ", numGeometries=" << to_string(desc->numGeometries); + oss << ", type=" << to_string(&desc->type); + oss << ", physicalSize=" << to_string(desc->physicalSize); + oss << ", readBandwidth=" << to_string(desc->readBandwidth); + oss << ", writeBandwidth=" << to_string(desc->writeBandwidth); + oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_rtas_builder_build_op_ext_desc_t& desc) { +inline std::string to_string(const ze_device_memory_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_vector_width_properties_ext_t* desc) { +inline std::string to_string(const ze_device_ip_version_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", vector_width_size=" << to_string(desc->vector_width_size); - oss << ", preferred_vector_width_char=" << to_string(desc->preferred_vector_width_char); - oss << ", preferred_vector_width_short=" << to_string(desc->preferred_vector_width_short); - oss << ", preferred_vector_width_int=" << to_string(desc->preferred_vector_width_int); - oss << ", preferred_vector_width_long=" << to_string(desc->preferred_vector_width_long); - oss << ", preferred_vector_width_float=" << to_string(desc->preferred_vector_width_float); - oss << ", preferred_vector_width_double=" << to_string(desc->preferred_vector_width_double); - oss << ", preferred_vector_width_half=" << to_string(desc->preferred_vector_width_half); - oss << ", native_vector_width_char=" << to_string(desc->native_vector_width_char); - oss << ", native_vector_width_short=" << to_string(desc->native_vector_width_short); - oss << ", native_vector_width_int=" << to_string(desc->native_vector_width_int); - oss << ", native_vector_width_long=" << to_string(desc->native_vector_width_long); - oss << ", native_vector_width_float=" << to_string(desc->native_vector_width_float); - oss << ", native_vector_width_double=" << to_string(desc->native_vector_width_double); - oss << ", native_vector_width_half=" << to_string(desc->native_vector_width_half); + oss << ", ipVersion=" << to_string(desc->ipVersion); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_vector_width_properties_ext_t& desc) { +inline std::string to_string(const ze_device_ip_version_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_external_memmap_sysmem_ext_desc_t* desc) { +inline std::string to_string(const ze_kernel_max_group_size_properties_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", pSystemMemory=" << to_string(desc->pSystemMemory); - oss << ", size=" << to_string(desc->size); + oss << ", maxGroupSize=" << to_string(desc->maxGroupSize); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_external_memmap_sysmem_ext_desc_t& desc) { +inline std::string to_string(const ze_kernel_max_group_size_properties_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_kernel_allocation_exp_properties_t* desc) { +inline std::string to_string(const ze_sub_allocation_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", base=" << to_string(desc->base); + oss << "base=" << to_string(desc->base); oss << ", size=" << to_string(desc->size); - oss << ", type=" << to_string(&desc->type); - oss << ", argIndex=" << to_string(desc->argIndex); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_kernel_allocation_exp_properties_t& desc) { +inline std::string to_string(const ze_sub_allocation_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_usablemem_size_ext_properties_t* desc) { +inline std::string to_string(const ze_memory_sub_allocations_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", currUsableMemSize=" << to_string(desc->currUsableMemSize); + oss << ", pCount=" << to_string(desc->pCount); + oss << ", pSubAllocations=" << to_string(desc->pSubAllocations); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_usablemem_size_ext_properties_t& desc) { +inline std::string to_string(const ze_memory_sub_allocations_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_image_format_support_ext_properties_t* desc) { +inline std::string to_string(const ze_event_query_kernel_timestamps_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", supported=" << to_string(&desc->supported); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_image_format_support_ext_properties_t& desc) { +inline std::string to_string(const ze_event_query_kernel_timestamps_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_ipc_mem_handle_type_ext_desc_t* desc) { +inline std::string to_string(const ze_synchronized_timestamp_data_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", typeFlags=" << to_string(&desc->typeFlags); + oss << "kernelStart=" << to_string(desc->kernelStart); + oss << ", kernelEnd=" << to_string(desc->kernelEnd); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_ipc_mem_handle_type_ext_desc_t& desc) { +inline std::string to_string(const ze_synchronized_timestamp_data_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_record_replay_graph_ext_properties_t* desc) { +inline std::string to_string(const ze_synchronized_timestamp_result_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", graphFlags=" << to_string(&desc->graphFlags); + oss << "global=" << to_string(&desc->global); + oss << ", context=" << to_string(&desc->context); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_record_replay_graph_ext_properties_t& desc) { +inline std::string to_string(const ze_synchronized_timestamp_result_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t* desc) { +inline std::string to_string(const ze_event_query_kernel_timestamps_results_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", mode=" << to_string(&desc->mode); + oss << ", pKernelTimestampsBuffer=" << to_string(desc->pKernelTimestampsBuffer); + oss << ", pSynchronizedTimestampsBuffer=" << to_string(desc->pSynchronizedTimestampsBuffer); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t& desc) { +inline std::string to_string(const ze_event_query_kernel_timestamps_results_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_readonly_memory_ext_properties_t* desc) { +inline std::string to_string(const ze_rtas_builder_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", readonlyCapability=" << to_string(&desc->readonlyCapability); + oss << ", builderVersion=" << to_string(&desc->builderVersion); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_readonly_memory_ext_properties_t& desc) { +inline std::string to_string(const ze_rtas_builder_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_cache_reservation_ext_desc_t* desc) { +inline std::string to_string(const ze_rtas_builder_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", maxCacheReservationSize=" << to_string(desc->maxCacheReservationSize); + oss << ", flags=" << to_string(&desc->flags); + oss << ", rtasBufferSizeBytesExpected=" << to_string(desc->rtasBufferSizeBytesExpected); + oss << ", rtasBufferSizeBytesMaxRequired=" << to_string(desc->rtasBufferSizeBytesMaxRequired); + oss << ", scratchBufferSizeBytes=" << to_string(desc->scratchBufferSizeBytes); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_cache_reservation_ext_desc_t& desc) { +inline std::string to_string(const ze_rtas_builder_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_image_memory_properties_exp_t* desc) { +inline std::string to_string(const ze_rtas_parallel_operation_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", size=" << to_string(desc->size); - oss << ", rowPitch=" << to_string(desc->rowPitch); - oss << ", slicePitch=" << to_string(desc->slicePitch); + oss << ", flags=" << to_string(&desc->flags); + oss << ", maxConcurrency=" << to_string(desc->maxConcurrency); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_image_memory_properties_exp_t& desc) { +inline std::string to_string(const ze_rtas_parallel_operation_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_image_view_planar_ext_desc_t* desc) { +inline std::string to_string(const ze_rtas_device_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", planeIndex=" << to_string(desc->planeIndex); + oss << ", flags=" << to_string(&desc->flags); + oss << ", rtasFormat=" << to_string(&desc->rtasFormat); + oss << ", rtasBufferAlignment=" << to_string(desc->rtasBufferAlignment); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_image_view_planar_ext_desc_t& desc) { +inline std::string to_string(const ze_rtas_device_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_image_view_planar_exp_desc_t* desc) { +inline std::string to_string(const ze_rtas_float3_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", planeIndex=" << to_string(desc->planeIndex); + oss << "x=" << to_string(desc->x); + oss << ", y=" << to_string(desc->y); + oss << ", z=" << to_string(desc->z); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_image_view_planar_exp_desc_t& desc) { +inline std::string to_string(const ze_rtas_float3_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_scheduling_hint_exp_properties_t* desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_column_major_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", schedulingHintFlags=" << to_string(desc->schedulingHintFlags); + oss << "vx_x=" << to_string(desc->vx_x); + oss << ", vx_y=" << to_string(desc->vx_y); + oss << ", vx_z=" << to_string(desc->vx_z); + oss << ", vy_x=" << to_string(desc->vy_x); + oss << ", vy_y=" << to_string(desc->vy_y); + oss << ", vy_z=" << to_string(desc->vy_z); + oss << ", vz_x=" << to_string(desc->vz_x); + oss << ", vz_y=" << to_string(desc->vz_y); + oss << ", vz_z=" << to_string(desc->vz_z); + oss << ", p_x=" << to_string(desc->p_x); + oss << ", p_y=" << to_string(desc->p_y); + oss << ", p_z=" << to_string(desc->p_z); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_scheduling_hint_exp_properties_t& desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_column_major_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_scheduling_hint_exp_desc_t* desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "vx_x=" << to_string(desc->vx_x); + oss << ", vx_y=" << to_string(desc->vx_y); + oss << ", vx_z=" << to_string(desc->vx_z); + oss << ", pad0=" << to_string(desc->pad0); + oss << ", vy_x=" << to_string(desc->vy_x); + oss << ", vy_y=" << to_string(desc->vy_y); + oss << ", vy_z=" << to_string(desc->vy_z); + oss << ", pad1=" << to_string(desc->pad1); + oss << ", vz_x=" << to_string(desc->vz_x); + oss << ", vz_y=" << to_string(desc->vz_y); + oss << ", vz_z=" << to_string(desc->vz_z); + oss << ", pad2=" << to_string(desc->pad2); + oss << ", p_x=" << to_string(desc->p_x); + oss << ", p_y=" << to_string(desc->p_y); + oss << ", p_z=" << to_string(desc->p_z); + oss << ", pad3=" << to_string(desc->pad3); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_transform_float3x4_row_major_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "vx_x=" << to_string(desc->vx_x); + oss << ", vy_x=" << to_string(desc->vy_x); + oss << ", vz_x=" << to_string(desc->vz_x); + oss << ", p_x=" << to_string(desc->p_x); + oss << ", vx_y=" << to_string(desc->vx_y); + oss << ", vy_y=" << to_string(desc->vy_y); + oss << ", vz_y=" << to_string(desc->vz_y); + oss << ", p_y=" << to_string(desc->p_y); + oss << ", vx_z=" << to_string(desc->vx_z); + oss << ", vy_z=" << to_string(desc->vy_z); + oss << ", vz_z=" << to_string(desc->vz_z); + oss << ", p_z=" << to_string(desc->p_z); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_transform_float3x4_row_major_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_aabb_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "lower=" << to_string(&desc->lower); + oss << ", upper=" << to_string(&desc->upper); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_aabb_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_triangle_indices_uint32_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "v0=" << to_string(desc->v0); + oss << ", v1=" << to_string(desc->v1); + oss << ", v2=" << to_string(desc->v2); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_triangle_indices_uint32_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_quad_indices_uint32_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "v0=" << to_string(desc->v0); + oss << ", v1=" << to_string(desc->v1); + oss << ", v2=" << to_string(desc->v2); + oss << ", v3=" << to_string(desc->v3); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_quad_indices_uint32_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_builder_geometry_info_exp_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "geometryType=" << to_string(&desc->geometryType); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_rtas_builder_geometry_info_exp_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(desc->flags); + oss << "geometryType=" << to_string(&desc->geometryType); + oss << ", geometryFlags=" << to_string(&desc->geometryFlags); + oss << ", geometryMask=" << to_string(desc->geometryMask); + oss << ", triangleFormat=" << to_string(&desc->triangleFormat); + oss << ", vertexFormat=" << to_string(&desc->vertexFormat); + oss << ", triangleCount=" << to_string(desc->triangleCount); + oss << ", vertexCount=" << to_string(desc->vertexCount); + oss << ", triangleStride=" << to_string(desc->triangleStride); + oss << ", vertexStride=" << to_string(desc->vertexStride); + oss << ", pTriangleBuffer=" << to_string(desc->pTriangleBuffer); + oss << ", pVertexBuffer=" << to_string(desc->pVertexBuffer); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_scheduling_hint_exp_desc_t& desc) { +inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t* desc) { +inline std::string to_string(const ze_rtas_builder_quads_geometry_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", hint=" << to_string(desc->hint); + oss << "geometryType=" << to_string(&desc->geometryType); + oss << ", geometryFlags=" << to_string(&desc->geometryFlags); + oss << ", geometryMask=" << to_string(desc->geometryMask); + oss << ", quadFormat=" << to_string(&desc->quadFormat); + oss << ", vertexFormat=" << to_string(&desc->vertexFormat); + oss << ", quadCount=" << to_string(desc->quadCount); + oss << ", vertexCount=" << to_string(desc->vertexCount); + oss << ", quadStride=" << to_string(desc->quadStride); + oss << ", vertexStride=" << to_string(desc->vertexStride); + oss << ", pQuadBuffer=" << to_string(desc->pQuadBuffer); + oss << ", pVertexBuffer=" << to_string(desc->pVertexBuffer); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t& desc) { +inline std::string to_string(const ze_rtas_builder_quads_geometry_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_eu_count_ext_t* desc) { +inline std::string to_string(const ze_rtas_geometry_aabbs_exp_cb_params_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", numTotalEUs=" << to_string(desc->numTotalEUs); + oss << ", primID=" << to_string(desc->primID); + oss << ", primIDCount=" << to_string(desc->primIDCount); + oss << ", pGeomUserPtr=" << to_string(desc->pGeomUserPtr); + oss << ", pBuildUserPtr=" << to_string(desc->pBuildUserPtr); + oss << ", pBoundsOut=" << to_string(desc->pBoundsOut); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_eu_count_ext_t& desc) { +inline std::string to_string(const ze_rtas_geometry_aabbs_exp_cb_params_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_pci_address_ext_t* desc) { +inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "domain=" << to_string(desc->domain); - oss << ", bus=" << to_string(desc->bus); - oss << ", device=" << to_string(desc->device); - oss << ", function=" << to_string(desc->function); + oss << "geometryType=" << to_string(&desc->geometryType); + oss << ", geometryFlags=" << to_string(&desc->geometryFlags); + oss << ", geometryMask=" << to_string(desc->geometryMask); + oss << ", reserved=" << to_string(desc->reserved); + oss << ", primCount=" << to_string(desc->primCount); + oss << ", pfnGetBoundsCb=" << to_string(&desc->pfnGetBoundsCb); + oss << ", pGeomUserPtr=" << to_string(desc->pGeomUserPtr); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_pci_address_ext_t& desc) { +inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_pci_speed_ext_t* desc) { +inline std::string to_string(const ze_rtas_builder_instance_geometry_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "genVersion=" << to_string(desc->genVersion); - oss << ", width=" << to_string(desc->width); - oss << ", maxBandwidth=" << to_string(desc->maxBandwidth); + oss << "geometryType=" << to_string(&desc->geometryType); + oss << ", instanceFlags=" << to_string(&desc->instanceFlags); + oss << ", geometryMask=" << to_string(desc->geometryMask); + oss << ", transformFormat=" << to_string(&desc->transformFormat); + oss << ", instanceUserID=" << to_string(desc->instanceUserID); + oss << ", pTransform=" << to_string(desc->pTransform); + oss << ", pBounds=" << to_string(desc->pBounds); + oss << ", pAccelerationStructure=" << to_string(desc->pAccelerationStructure); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_pci_speed_ext_t& desc) { +inline std::string to_string(const ze_rtas_builder_instance_geometry_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_pci_ext_properties_t* desc) { +inline std::string to_string(const ze_rtas_builder_build_op_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", address=" << to_string(&desc->address); - oss << ", maxSpeed=" << to_string(&desc->maxSpeed); + oss << ", rtasFormat=" << to_string(&desc->rtasFormat); + oss << ", buildQuality=" << to_string(desc->buildQuality); + oss << ", buildFlags=" << to_string(&desc->buildFlags); + oss << ", ppGeometries=" << to_string(desc->ppGeometries); + oss << ", numGeometries=" << to_string(desc->numGeometries); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_pci_ext_properties_t& desc) { +inline std::string to_string(const ze_rtas_builder_build_op_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_srgb_ext_desc_t* desc) { +inline std::string to_string(const ze_event_pool_counter_based_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", sRGB=" << to_string(&desc->sRGB); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_srgb_ext_desc_t& desc) { +inline std::string to_string(const ze_event_pool_counter_based_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_image_allocation_ext_properties_t* desc) { +inline std::string to_string(const ze_image_bindless_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", id=" << to_string(desc->id); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_image_allocation_ext_properties_t& desc) { +inline std::string to_string(const ze_image_bindless_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_linkage_inspection_ext_desc_t* desc) { +inline std::string to_string(const ze_image_pitched_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", ptr=" << to_string(desc->ptr); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_linkage_inspection_ext_desc_t& desc) { +inline std::string to_string(const ze_image_pitched_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_memory_compression_hints_ext_desc_t* desc) { +inline std::string to_string(const ze_device_pitched_alloc_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(desc->flags); + oss << ", maxImageLinearWidth=" << to_string(desc->maxImageLinearWidth); + oss << ", maxImageLinearHeight=" << to_string(desc->maxImageLinearHeight); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_memory_compression_hints_ext_desc_t& desc) { +inline std::string to_string(const ze_device_pitched_alloc_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_driver_memory_free_ext_properties_t* desc) { +inline std::string to_string(const ze_pitched_alloc_2dimage_linear_pitch_exp_info_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", freePolicies=" << to_string(&desc->freePolicies); + oss << ", pitchAlign=" << to_string(desc->pitchAlign); + oss << ", maxSupportedPitch=" << to_string(desc->maxSupportedPitch); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_driver_memory_free_ext_properties_t& desc) { +inline std::string to_string(const ze_pitched_alloc_2dimage_linear_pitch_exp_info_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_memory_free_ext_desc_t* desc) { +inline std::string to_string(const ze_custom_pitch_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", freePolicy=" << to_string(&desc->freePolicy); + oss << ", rowPitch=" << to_string(desc->rowPitch); + oss << ", slicePitch=" << to_string(desc->slicePitch); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_memory_free_ext_desc_t& desc) { +inline std::string to_string(const ze_custom_pitch_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_p2p_bandwidth_exp_properties_t* desc) { +inline std::string to_string(const ze_mutable_command_id_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", logicalBandwidth=" << to_string(desc->logicalBandwidth); - oss << ", physicalBandwidth=" << to_string(desc->physicalBandwidth); - oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); - oss << ", logicalLatency=" << to_string(desc->logicalLatency); - oss << ", physicalLatency=" << to_string(desc->physicalLatency); - oss << ", latencyUnit=" << to_string(&desc->latencyUnit); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_p2p_bandwidth_exp_properties_t& desc) { +inline std::string to_string(const ze_mutable_command_id_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_copy_bandwidth_exp_properties_t* desc) { +inline std::string to_string(const ze_mutable_command_list_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", copyBandwidth=" << to_string(desc->copyBandwidth); - oss << ", copyBandwidthUnit=" << to_string(&desc->copyBandwidthUnit); + oss << ", mutableCommandListFlags=" << to_string(&desc->mutableCommandListFlags); + oss << ", mutableCommandFlags=" << to_string(&desc->mutableCommandFlags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_copy_bandwidth_exp_properties_t& desc) { +inline std::string to_string(const ze_mutable_command_list_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_luid_ext_t* desc) { +inline std::string to_string(const ze_mutable_command_list_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "id=" << to_string(desc->id); + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_luid_ext_t& desc) { +inline std::string to_string(const ze_mutable_command_list_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_luid_ext_properties_t* desc) { +inline std::string to_string(const ze_mutable_commands_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", luid=" << to_string(&desc->luid); - oss << ", nodeMask=" << to_string(desc->nodeMask); + oss << ", flags=" << to_string(desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_luid_ext_properties_t& desc) { +inline std::string to_string(const ze_mutable_commands_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_fabric_vertex_pci_exp_address_t* desc) { +inline std::string to_string(const ze_mutable_kernel_argument_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "domain=" << to_string(desc->domain); - oss << ", bus=" << to_string(desc->bus); - oss << ", device=" << to_string(desc->device); - oss << ", function=" << to_string(desc->function); + oss << "stype=" << to_string(&desc->stype); + oss << ", commandId=" << to_string(desc->commandId); + oss << ", argIndex=" << to_string(desc->argIndex); + oss << ", argSize=" << to_string(desc->argSize); + oss << ", pArgValue=" << to_string(desc->pArgValue); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_fabric_vertex_pci_exp_address_t& desc) { +inline std::string to_string(const ze_mutable_kernel_argument_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_fabric_vertex_exp_properties_t* desc) { +inline std::string to_string(const ze_mutable_group_count_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", uuid=" << to_string(&desc->uuid); - oss << ", type=" << to_string(&desc->type); - oss << ", remote=" << to_string(&desc->remote); - oss << ", address=" << to_string(&desc->address); + oss << ", commandId=" << to_string(desc->commandId); + oss << ", pGroupCount=" << to_string(desc->pGroupCount); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_fabric_vertex_exp_properties_t& desc) { +inline std::string to_string(const ze_mutable_group_count_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_fabric_edge_exp_properties_t* desc) { +inline std::string to_string(const ze_mutable_group_size_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", uuid=" << to_string(&desc->uuid); - oss << ", model=" << to_string(desc->model); - oss << ", bandwidth=" << to_string(desc->bandwidth); - oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); - oss << ", latency=" << to_string(desc->latency); - oss << ", latencyUnit=" << to_string(&desc->latencyUnit); - oss << ", duplexity=" << to_string(&desc->duplexity); + oss << ", commandId=" << to_string(desc->commandId); + oss << ", groupSizeX=" << to_string(desc->groupSizeX); + oss << ", groupSizeY=" << to_string(desc->groupSizeY); + oss << ", groupSizeZ=" << to_string(desc->groupSizeZ); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_fabric_edge_exp_properties_t& desc) { +inline std::string to_string(const ze_mutable_group_size_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_memory_ext_properties_t* desc) { +inline std::string to_string(const ze_mutable_global_offset_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", type=" << to_string(&desc->type); - oss << ", physicalSize=" << to_string(desc->physicalSize); - oss << ", readBandwidth=" << to_string(desc->readBandwidth); - oss << ", writeBandwidth=" << to_string(desc->writeBandwidth); - oss << ", bandwidthUnit=" << to_string(&desc->bandwidthUnit); + oss << ", commandId=" << to_string(desc->commandId); + oss << ", offsetX=" << to_string(desc->offsetX); + oss << ", offsetY=" << to_string(desc->offsetY); + oss << ", offsetZ=" << to_string(desc->offsetZ); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_memory_ext_properties_t& desc) { +inline std::string to_string(const ze_mutable_global_offset_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_device_ip_version_ext_t* desc) { +inline std::string to_string(const ze_mutable_graph_argument_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", ipVersion=" << to_string(desc->ipVersion); + oss << ", commandId=" << to_string(desc->commandId); + oss << ", argIndex=" << to_string(desc->argIndex); + oss << ", pArgValue=" << to_string(desc->pArgValue); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_device_ip_version_ext_t& desc) { +inline std::string to_string(const ze_mutable_graph_argument_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_kernel_max_group_size_properties_ext_t* desc) { +inline std::string to_string(const ze_driver_ddi_handles_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", maxGroupSize=" << to_string(desc->maxGroupSize); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_kernel_max_group_size_properties_ext_t& desc) { +inline std::string to_string(const ze_driver_ddi_handles_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_sub_allocation_t* desc) { +inline std::string to_string(const ze_external_semaphore_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "base=" << to_string(desc->base); - oss << ", size=" << to_string(desc->size); + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_sub_allocation_t& desc) { +inline std::string to_string(const ze_external_semaphore_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_memory_sub_allocations_exp_properties_t* desc) { +inline std::string to_string(const ze_external_semaphore_win32_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", pCount=" << to_string(desc->pCount); - oss << ", pSubAllocations=" << to_string(desc->pSubAllocations); + oss << ", handle=" << to_string(desc->handle); + oss << ", name=" << to_string(desc->name); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_memory_sub_allocations_exp_properties_t& desc) { +inline std::string to_string(const ze_external_semaphore_win32_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_event_query_kernel_timestamps_ext_properties_t* desc) { +inline std::string to_string(const ze_external_semaphore_fd_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", fd=" << to_string(desc->fd); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_event_query_kernel_timestamps_ext_properties_t& desc) { +inline std::string to_string(const ze_external_semaphore_fd_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_synchronized_timestamp_data_ext_t* desc) { +inline std::string to_string(const ze_external_semaphore_signal_params_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "kernelStart=" << to_string(desc->kernelStart); - oss << ", kernelEnd=" << to_string(desc->kernelEnd); + oss << "stype=" << to_string(&desc->stype); + oss << ", value=" << to_string(desc->value); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_synchronized_timestamp_data_ext_t& desc) { +inline std::string to_string(const ze_external_semaphore_signal_params_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_synchronized_timestamp_result_ext_t* desc) { +inline std::string to_string(const ze_external_semaphore_wait_params_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; - oss << "{"; - oss << "global=" << to_string(&desc->global); - oss << ", context=" << to_string(&desc->context); + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", value=" << to_string(desc->value); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_synchronized_timestamp_result_ext_t& desc) { +inline std::string to_string(const ze_external_semaphore_wait_params_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_event_query_kernel_timestamps_results_ext_properties_t* desc) { +inline std::string to_string(const ze_device_cache_line_size_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", pKernelTimestampsBuffer=" << to_string(desc->pKernelTimestampsBuffer); - oss << ", pSynchronizedTimestampsBuffer=" << to_string(desc->pSynchronizedTimestampsBuffer); + oss << ", cacheLineSize=" << to_string(desc->cacheLineSize); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_event_query_kernel_timestamps_results_ext_properties_t& desc) { +inline std::string to_string(const ze_device_cache_line_size_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_exp_desc_t* desc) { +inline std::string to_string(const ze_rtas_builder_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2437,11 +2519,11 @@ inline std::string to_string(const ze_rtas_builder_exp_desc_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_builder_exp_desc_t& desc) { +inline std::string to_string(const ze_rtas_builder_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_exp_properties_t* desc) { +inline std::string to_string(const ze_rtas_builder_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2454,11 +2536,11 @@ inline std::string to_string(const ze_rtas_builder_exp_properties_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_builder_exp_properties_t& desc) { +inline std::string to_string(const ze_rtas_builder_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_parallel_operation_exp_properties_t* desc) { +inline std::string to_string(const ze_rtas_parallel_operation_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2469,11 +2551,11 @@ inline std::string to_string(const ze_rtas_parallel_operation_exp_properties_t* return oss.str(); } -inline std::string to_string(const ze_rtas_parallel_operation_exp_properties_t& desc) { +inline std::string to_string(const ze_rtas_parallel_operation_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_device_exp_properties_t* desc) { +inline std::string to_string(const ze_rtas_device_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2485,11 +2567,11 @@ inline std::string to_string(const ze_rtas_device_exp_properties_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_device_exp_properties_t& desc) { +inline std::string to_string(const ze_rtas_device_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_float3_exp_t* desc) { +inline std::string to_string(const ze_rtas_float3_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2500,11 +2582,11 @@ inline std::string to_string(const ze_rtas_float3_exp_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_float3_exp_t& desc) { +inline std::string to_string(const ze_rtas_float3_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_column_major_exp_t* desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_column_major_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2524,11 +2606,11 @@ inline std::string to_string(const ze_rtas_transform_float3x4_column_major_exp_t return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_column_major_exp_t& desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_column_major_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_exp_t* desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2552,11 +2634,11 @@ inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_maj return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_exp_t& desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_aligned_column_major_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_transform_float3x4_row_major_exp_t* desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_row_major_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2576,11 +2658,11 @@ inline std::string to_string(const ze_rtas_transform_float3x4_row_major_exp_t* d return oss.str(); } -inline std::string to_string(const ze_rtas_transform_float3x4_row_major_exp_t& desc) { +inline std::string to_string(const ze_rtas_transform_float3x4_row_major_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_aabb_exp_t* desc) { +inline std::string to_string(const ze_rtas_aabb_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2590,11 +2672,11 @@ inline std::string to_string(const ze_rtas_aabb_exp_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_aabb_exp_t& desc) { +inline std::string to_string(const ze_rtas_aabb_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_triangle_indices_uint32_exp_t* desc) { +inline std::string to_string(const ze_rtas_triangle_indices_uint32_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2605,11 +2687,11 @@ inline std::string to_string(const ze_rtas_triangle_indices_uint32_exp_t* desc) return oss.str(); } -inline std::string to_string(const ze_rtas_triangle_indices_uint32_exp_t& desc) { +inline std::string to_string(const ze_rtas_triangle_indices_uint32_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_quad_indices_uint32_exp_t* desc) { +inline std::string to_string(const ze_rtas_quad_indices_uint32_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2621,11 +2703,11 @@ inline std::string to_string(const ze_rtas_quad_indices_uint32_exp_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_quad_indices_uint32_exp_t& desc) { +inline std::string to_string(const ze_rtas_quad_indices_uint32_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_geometry_info_exp_t* desc) { +inline std::string to_string(const ze_rtas_builder_geometry_info_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2634,11 +2716,11 @@ inline std::string to_string(const ze_rtas_builder_geometry_info_exp_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_builder_geometry_info_exp_t& desc) { +inline std::string to_string(const ze_rtas_builder_geometry_info_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_exp_t* desc) { +inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2657,11 +2739,11 @@ inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_exp_t return oss.str(); } -inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_exp_t& desc) { +inline std::string to_string(const ze_rtas_builder_triangles_geometry_info_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_quads_geometry_info_exp_t* desc) { +inline std::string to_string(const ze_rtas_builder_quads_geometry_info_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2680,11 +2762,11 @@ inline std::string to_string(const ze_rtas_builder_quads_geometry_info_exp_t* de return oss.str(); } -inline std::string to_string(const ze_rtas_builder_quads_geometry_info_exp_t& desc) { +inline std::string to_string(const ze_rtas_builder_quads_geometry_info_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_geometry_aabbs_exp_cb_params_t* desc) { +inline std::string to_string(const ze_rtas_geometry_aabbs_ext_cb_params_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2698,11 +2780,11 @@ inline std::string to_string(const ze_rtas_geometry_aabbs_exp_cb_params_t* desc) return oss.str(); } -inline std::string to_string(const ze_rtas_geometry_aabbs_exp_cb_params_t& desc) { +inline std::string to_string(const ze_rtas_geometry_aabbs_ext_cb_params_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_exp_t* desc) { +inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2717,11 +2799,11 @@ inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_exp_ return oss.str(); } -inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_exp_t& desc) { +inline std::string to_string(const ze_rtas_builder_procedural_geometry_info_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_instance_geometry_info_exp_t* desc) { +inline std::string to_string(const ze_rtas_builder_instance_geometry_info_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2737,11 +2819,11 @@ inline std::string to_string(const ze_rtas_builder_instance_geometry_info_exp_t* return oss.str(); } -inline std::string to_string(const ze_rtas_builder_instance_geometry_info_exp_t& desc) { +inline std::string to_string(const ze_rtas_builder_instance_geometry_info_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_rtas_builder_build_op_exp_desc_t* desc) { +inline std::string to_string(const ze_rtas_builder_build_op_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; @@ -2755,233 +2837,151 @@ inline std::string to_string(const ze_rtas_builder_build_op_exp_desc_t* desc) { return oss.str(); } -inline std::string to_string(const ze_rtas_builder_build_op_exp_desc_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_event_pool_counter_based_exp_desc_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_event_pool_counter_based_exp_desc_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_image_bindless_exp_desc_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_image_bindless_exp_desc_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_image_pitched_exp_desc_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", ptr=" << to_string(desc->ptr); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_image_pitched_exp_desc_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_device_pitched_alloc_exp_properties_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", maxImageLinearWidth=" << to_string(desc->maxImageLinearWidth); - oss << ", maxImageLinearHeight=" << to_string(desc->maxImageLinearHeight); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_device_pitched_alloc_exp_properties_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_pitched_alloc_2dimage_linear_pitch_exp_info_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", pitchAlign=" << to_string(desc->pitchAlign); - oss << ", maxSupportedPitch=" << to_string(desc->maxSupportedPitch); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_pitched_alloc_2dimage_linear_pitch_exp_info_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const ze_custom_pitch_exp_desc_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", rowPitch=" << to_string(desc->rowPitch); - oss << ", slicePitch=" << to_string(desc->slicePitch); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_custom_pitch_exp_desc_t& desc) { +inline std::string to_string(const ze_rtas_builder_build_op_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_command_id_exp_desc_t* desc) { +inline std::string to_string(const ze_device_vector_width_properties_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", vector_width_size=" << to_string(desc->vector_width_size); + oss << ", preferred_vector_width_char=" << to_string(desc->preferred_vector_width_char); + oss << ", preferred_vector_width_short=" << to_string(desc->preferred_vector_width_short); + oss << ", preferred_vector_width_int=" << to_string(desc->preferred_vector_width_int); + oss << ", preferred_vector_width_long=" << to_string(desc->preferred_vector_width_long); + oss << ", preferred_vector_width_float=" << to_string(desc->preferred_vector_width_float); + oss << ", preferred_vector_width_double=" << to_string(desc->preferred_vector_width_double); + oss << ", preferred_vector_width_half=" << to_string(desc->preferred_vector_width_half); + oss << ", native_vector_width_char=" << to_string(desc->native_vector_width_char); + oss << ", native_vector_width_short=" << to_string(desc->native_vector_width_short); + oss << ", native_vector_width_int=" << to_string(desc->native_vector_width_int); + oss << ", native_vector_width_long=" << to_string(desc->native_vector_width_long); + oss << ", native_vector_width_float=" << to_string(desc->native_vector_width_float); + oss << ", native_vector_width_double=" << to_string(desc->native_vector_width_double); + oss << ", native_vector_width_half=" << to_string(desc->native_vector_width_half); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_command_id_exp_desc_t& desc) { +inline std::string to_string(const ze_device_vector_width_properties_ext_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_command_list_exp_properties_t* desc) { +inline std::string to_string(const ze_external_memmap_sysmem_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", mutableCommandListFlags=" << to_string(&desc->mutableCommandListFlags); - oss << ", mutableCommandFlags=" << to_string(&desc->mutableCommandFlags); + oss << ", pSystemMemory=" << to_string(desc->pSystemMemory); + oss << ", size=" << to_string(desc->size); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_command_list_exp_properties_t& desc) { +inline std::string to_string(const ze_external_memmap_sysmem_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_command_list_exp_desc_t* desc) { +inline std::string to_string(const ze_kernel_allocation_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); + oss << ", base=" << to_string(desc->base); + oss << ", size=" << to_string(desc->size); + oss << ", type=" << to_string(&desc->type); + oss << ", argIndex=" << to_string(desc->argIndex); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_command_list_exp_desc_t& desc) { +inline std::string to_string(const ze_kernel_allocation_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_commands_exp_desc_t* desc) { +inline std::string to_string(const ze_device_usablemem_size_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(desc->flags); + oss << ", currUsableMemSize=" << to_string(desc->currUsableMemSize); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_commands_exp_desc_t& desc) { +inline std::string to_string(const ze_device_usablemem_size_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_kernel_argument_exp_desc_t* desc) { +inline std::string to_string(const ze_image_format_support_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", commandId=" << to_string(desc->commandId); - oss << ", argIndex=" << to_string(desc->argIndex); - oss << ", argSize=" << to_string(desc->argSize); - oss << ", pArgValue=" << to_string(desc->pArgValue); + oss << ", supported=" << to_string(&desc->supported); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_kernel_argument_exp_desc_t& desc) { +inline std::string to_string(const ze_image_format_support_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_group_count_exp_desc_t* desc) { +inline std::string to_string(const ze_ipc_mem_handle_type_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", commandId=" << to_string(desc->commandId); - oss << ", pGroupCount=" << to_string(desc->pGroupCount); + oss << ", typeFlags=" << to_string(&desc->typeFlags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_group_count_exp_desc_t& desc) { +inline std::string to_string(const ze_ipc_mem_handle_type_ext_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_group_size_exp_desc_t* desc) { +inline std::string to_string(const ze_record_replay_graph_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", commandId=" << to_string(desc->commandId); - oss << ", groupSizeX=" << to_string(desc->groupSizeX); - oss << ", groupSizeY=" << to_string(desc->groupSizeY); - oss << ", groupSizeZ=" << to_string(desc->groupSizeZ); + oss << ", graphFlags=" << to_string(&desc->graphFlags); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_group_size_exp_desc_t& desc) { +inline std::string to_string(const ze_record_replay_graph_ext_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_global_offset_exp_desc_t* desc) { +inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", commandId=" << to_string(desc->commandId); - oss << ", offsetX=" << to_string(desc->offsetX); - oss << ", offsetY=" << to_string(desc->offsetY); - oss << ", offsetZ=" << to_string(desc->offsetZ); + oss << ", mode=" << to_string(&desc->mode); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_global_offset_exp_desc_t& desc) { +inline std::string to_string(const ze_record_replay_graph_ext_dump_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_mutable_graph_argument_exp_desc_t* desc) { +inline std::string to_string(const ze_device_readonly_memory_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", commandId=" << to_string(desc->commandId); - oss << ", argIndex=" << to_string(desc->argIndex); - oss << ", pArgValue=" << to_string(desc->pArgValue); + oss << ", readonlyCapability=" << to_string(&desc->readonlyCapability); oss << "}"; return oss.str(); } -inline std::string to_string(const ze_mutable_graph_argument_exp_desc_t& desc) { +inline std::string to_string(const ze_device_readonly_memory_ext_properties_t& desc) { return to_string(&desc); } diff --git a/source/utils/zes_to_string.h b/source/utils/zes_to_string.h index ca319fb7..a2d015b9 100644 --- a/source/utils/zes_to_string.h +++ b/source/utils/zes_to_string.h @@ -1192,78 +1192,6 @@ inline std::string to_string(const zes_temp_config_t& desc) { return to_string(&desc); } -inline std::string to_string(const zes_device_ecc_default_properties_ext_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", defaultState=" << to_string(&desc->defaultState); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const zes_device_ecc_default_properties_ext_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const zes_pci_link_speed_downgrade_ext_state_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", pciLinkSpeedDowngradeStatus=" << to_string(&desc->pciLinkSpeedDowngradeStatus); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const zes_pci_link_speed_downgrade_ext_state_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const zes_pci_link_speed_downgrade_ext_properties_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", pciLinkSpeedUpdateCapable=" << to_string(&desc->pciLinkSpeedUpdateCapable); - oss << ", maxPciGenSupported=" << to_string(desc->maxPciGenSupported); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const zes_pci_link_speed_downgrade_ext_properties_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const zes_device_ext_state_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", flags=" << to_string(&desc->flags); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const zes_device_ext_state_t& desc) { - return to_string(&desc); -} - -inline std::string to_string(const zes_oem_serial_id_ext_properties_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", length=" << to_string(desc->length); - oss << ", oemSerialId=" << to_string(desc->oemSerialId); - oss << "}"; - return oss.str(); -} - -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_power_limit_ext_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; @@ -1529,6 +1457,78 @@ inline std::string to_string(const zes_vf_util_engine_exp2_t& desc) { return to_string(&desc); } +inline std::string to_string(const zes_device_ecc_default_properties_ext_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", defaultState=" << to_string(&desc->defaultState); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_device_ecc_default_properties_ext_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const zes_pci_link_speed_downgrade_ext_state_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", pciLinkSpeedDowngradeStatus=" << to_string(&desc->pciLinkSpeedDowngradeStatus); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_pci_link_speed_downgrade_ext_state_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const zes_pci_link_speed_downgrade_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", pciLinkSpeedUpdateCapable=" << to_string(&desc->pciLinkSpeedUpdateCapable); + oss << ", maxPciGenSupported=" << to_string(desc->maxPciGenSupported); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_pci_link_speed_downgrade_ext_properties_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const zes_device_ext_state_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", flags=" << to_string(&desc->flags); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_device_ext_state_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const zes_oem_serial_id_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", length=" << to_string(desc->length); + oss << ", oemSerialId=" << to_string(desc->oemSerialId); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_oem_serial_id_ext_properties_t& desc) { + return to_string(&desc); +} + } // namespace loader #endif // _ZES_TO_STRING_H diff --git a/source/utils/zet_to_string.h b/source/utils/zet_to_string.h index 093f743c..7945ba57 100644 --- a/source/utils/zet_to_string.h +++ b/source/utils/zet_to_string.h @@ -324,201 +324,201 @@ inline std::string to_string(const zet_tracer_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_tracer_exp_desc_t* desc) { +inline std::string to_string(const zet_metric_global_timestamps_resolution_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", notifyEveryNBytes=" << to_string(desc->notifyEveryNBytes); + oss << ", timerResolution=" << to_string(desc->timerResolution); + oss << ", timestampValidBits=" << to_string(desc->timestampValidBits); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_tracer_exp_desc_t& desc) { +inline std::string to_string(const zet_metric_global_timestamps_resolution_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_entry_exp_t* desc) { +inline std::string to_string(const zet_metric_calculate_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "value=" << to_string(&desc->value); - oss << ", timeStamp=" << to_string(desc->timeStamp); - oss << ", metricIndex=" << to_string(desc->metricIndex); - oss << ", onSubdevice=" << to_string(&desc->onSubdevice); - oss << ", subdeviceId=" << to_string(desc->subdeviceId); + oss << "stype=" << to_string(&desc->stype); + oss << ", rawReportSkipCount=" << to_string(desc->rawReportSkipCount); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_entry_exp_t& desc) { +inline std::string to_string(const zet_metric_calculate_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_group_type_exp_t* desc) { +inline std::string to_string(const zet_metric_programmable_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", type=" << to_string(&desc->type); + oss << ", name=" << to_string(desc->name); + oss << ", description=" << to_string(desc->description); + oss << ", component=" << to_string(desc->component); + oss << ", tierNumber=" << to_string(desc->tierNumber); + oss << ", domain=" << to_string(desc->domain); + oss << ", parameterCount=" << to_string(desc->parameterCount); + oss << ", samplingType=" << to_string(&desc->samplingType); + oss << ", sourceId=" << to_string(desc->sourceId); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_group_type_exp_t& desc) { +inline std::string to_string(const zet_metric_programmable_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_export_dma_buf_exp_properties_t* desc) { +inline std::string to_string(const zet_value_uint64_range_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", fd=" << to_string(desc->fd); - oss << ", size=" << to_string(desc->size); + oss << "ui64Min=" << to_string(desc->ui64Min); + oss << ", ui64Max=" << to_string(desc->ui64Max); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_export_dma_buf_exp_properties_t& desc) { +inline std::string to_string(const zet_value_uint64_range_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_source_id_exp_t* desc) { +inline std::string to_string(const zet_value_fp64_range_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", sourceId=" << to_string(desc->sourceId); + oss << "fp64Min=" << to_string(desc->fp64Min); + oss << ", fp64Max=" << to_string(desc->fp64Max); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_source_id_exp_t& desc) { +inline std::string to_string(const zet_value_fp64_range_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_global_timestamps_resolution_exp_t* desc) { +inline std::string to_string(const zet_metric_programmable_param_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", timerResolution=" << to_string(desc->timerResolution); - oss << ", timestampValidBits=" << to_string(desc->timestampValidBits); + oss << ", type=" << to_string(&desc->type); + oss << ", name=" << to_string(desc->name); + oss << ", valueInfoType=" << to_string(&desc->valueInfoType); + oss << ", defaultValue=" << to_string(&desc->defaultValue); + oss << ", valueInfoCount=" << to_string(desc->valueInfoCount); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_global_timestamps_resolution_exp_t& desc) { +inline std::string to_string(const zet_metric_programmable_param_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_calculate_exp_desc_t* desc) { +inline std::string to_string(const zet_metric_programmable_param_value_info_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", rawReportSkipCount=" << to_string(desc->rawReportSkipCount); + oss << ", valueInfo=" << to_string(&desc->valueInfo); + oss << ", description=" << to_string(desc->description); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_calculate_exp_desc_t& desc) { +inline std::string to_string(const zet_metric_programmable_param_value_info_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_programmable_exp_properties_t* desc) { +inline std::string to_string(const zet_metric_programmable_param_value_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", name=" << to_string(desc->name); - oss << ", description=" << to_string(desc->description); - oss << ", component=" << to_string(desc->component); - oss << ", tierNumber=" << to_string(desc->tierNumber); - oss << ", domain=" << to_string(desc->domain); - oss << ", parameterCount=" << to_string(desc->parameterCount); - oss << ", samplingType=" << to_string(&desc->samplingType); - oss << ", sourceId=" << to_string(desc->sourceId); + oss << "value=" << to_string(&desc->value); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_programmable_exp_properties_t& desc) { +inline std::string to_string(const zet_metric_programmable_param_value_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_value_uint64_range_exp_t* desc) { +inline std::string to_string(const zet_metric_tracer_exp_desc_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "ui64Min=" << to_string(desc->ui64Min); - oss << ", ui64Max=" << to_string(desc->ui64Max); + oss << "stype=" << to_string(&desc->stype); + oss << ", notifyEveryNBytes=" << to_string(desc->notifyEveryNBytes); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_value_uint64_range_exp_t& desc) { +inline std::string to_string(const zet_metric_tracer_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_value_fp64_range_exp_t* desc) { +inline std::string to_string(const zet_metric_entry_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "fp64Min=" << to_string(desc->fp64Min); - oss << ", fp64Max=" << to_string(desc->fp64Max); + oss << "value=" << to_string(&desc->value); + oss << ", timeStamp=" << to_string(desc->timeStamp); + oss << ", metricIndex=" << to_string(desc->metricIndex); + oss << ", onSubdevice=" << to_string(&desc->onSubdevice); + oss << ", subdeviceId=" << to_string(desc->subdeviceId); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_value_fp64_range_exp_t& desc) { +inline std::string to_string(const zet_metric_entry_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_programmable_param_info_exp_t* desc) { +inline std::string to_string(const zet_metric_group_type_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); oss << ", type=" << to_string(&desc->type); - oss << ", name=" << to_string(desc->name); - oss << ", valueInfoType=" << to_string(&desc->valueInfoType); - oss << ", defaultValue=" << to_string(&desc->defaultValue); - oss << ", valueInfoCount=" << to_string(desc->valueInfoCount); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_programmable_param_info_exp_t& desc) { +inline std::string to_string(const zet_metric_group_type_exp_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_programmable_param_value_info_exp_t* desc) { +inline std::string to_string(const zet_export_dma_buf_exp_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; oss << "stype=" << to_string(&desc->stype); - oss << ", valueInfo=" << to_string(&desc->valueInfo); - oss << ", description=" << to_string(desc->description); + oss << ", fd=" << to_string(desc->fd); + oss << ", size=" << to_string(desc->size); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_programmable_param_value_info_exp_t& desc) { +inline std::string to_string(const zet_export_dma_buf_exp_properties_t& desc) { return to_string(&desc); } -inline std::string to_string(const zet_metric_programmable_param_value_exp_t* desc) { +inline std::string to_string(const zet_metric_source_id_exp_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; oss << "{"; - oss << "value=" << to_string(&desc->value); + oss << "stype=" << to_string(&desc->stype); + oss << ", sourceId=" << to_string(desc->sourceId); oss << "}"; return oss.str(); } -inline std::string to_string(const zet_metric_programmable_param_value_exp_t& desc) { +inline std::string to_string(const zet_metric_source_id_exp_t& desc) { return to_string(&desc); }